src/Valkyrja/Dispatcher/NativeDispatcher.php
public function dispatchClassMethod(Dispatch $dispatch, array $arguments = null)
    {
        $response = null;

        // Ensure a class and method exist before continuing
        if (null === $dispatch->getClass() || null === $dispatch->getMethod()) {
            return $response;
        }

        // Set the class through the container if this isn't a static method
        $class    = $dispatch->isStatic()
            ? $dispatch->getClass()
            : $this->app->container()->get($dispatch->getClass());
        $method   = $dispatch->getMethod();
        $response = null;

        // If there are arguments
        if (null !== $arguments) {
            // Unpack arguments and dispatch
            if ($dispatch->isStatic()) {
                $response = $class::$method(...$arguments);
            } else {
                $response = $class->$method(...$arguments);
            }
        } else {
            // Dispatch without unpacking
            if ($dispatch->isStatic()) {
                $response = $class::$method();
            } else {
                $response = $class->$method();
            }
        }

        return $response ?? $this->DISPATCHED;
    }
public function dispatchClassMethod(Dispatch $dispatch, array $arguments = null)
    {
        $response = null;

        // Ensure a class and method exist before continuing
        if (null === $dispatch->getClass() || null === $dispatch->getMethod()) {
            return $response;
        }

        // Set the class through the container if this isn't a static method
        $class    = $dispatch->isStatic()
            ? $dispatch->getClass()
            : $this->app->container()->get($dispatch->getClass());
        $method   = $dispatch->getMethod();
        $response = null;

        // If there are arguments
        if (null !== $arguments) {
            // Unpack arguments and dispatch
            if ($dispatch->isStatic()) {
                $response = $class::$method(...$arguments);
            } else {
                $response = $class->$method(...$arguments);
            }
        } else {
            // Dispatch without unpacking
            if ($dispatch->isStatic()) {
                $response = $class::$method();
            } else {
                $response = $class->$method();
            }
        }

        return $response ?? $this->DISPATCHED;
    }
Dispatch a class method.

@param Dispatch $dispatch  The dispatch
@param array    $arguments [optional] The arguments

@return mixed