Get the middleware for the controller instance.

@param  \Illuminate\Routing\Controller  $instance
@param  string  $method
@return array
345917
protected function getMiddleware($instance, $method)
	{
		$middleware = $this->router->getMiddleware();

		$results = [];

		foreach ($instance->getMiddleware() as $name => $options)
		{
			if ( ! $this->methodExcludedByOptions($method, $options))
			{
				$results[] = array_get($middleware, $name, $name);
			}
		}

		return $results;
	}
625049
protected function callWithDependencies($instance, $method)
    {
        return call_user_func_array(
            [$instance, $method], $this->resolveClassMethodDependencies([], $instance, $method)
        );
    }
164363
public function map($uri, $method)
    {
        if ($uri === '/') {
            $uri = '';
        }

        $controller = $this;

        return $this->app->map(
            $this->baseUri.$uri,
            function () use ($controller, $method) {
                $params = func_get_args();
                $i = 0;
                $a = preg_replace_callback('/:(\w+)/', function($matches) use ($controller, $params, &$i) {
                    $value = @$params[$i++];
                    $controller->routeData($matches[1], $value);
                    return $value;
                }, $controller->baseUri);
                $controller->delegate($method, array_slice($params, $i));
            }
        );
    }
1017855
protected function callLumenControllerWithMiddleware($instance, $method, $routeInfo, $middleware)
    {
        $middleware = $this->gatherMiddlewareClassNames($middleware);

        return $this->sendThroughPipeline($middleware, function () use ($instance, $method, $routeInfo) {
            return $this->callControllerCallable([$instance, $method], $routeInfo[2]);
        });
    }
1057762
public function getInvokeMiddlewareNext($controller, MiddleWares $middleWares, $decorators)
    {
        return $this->nextClosure($middleWares, function() use ($controller, $decorators) {
            $controller = $this->closureBinder($controller);
            return $this->injectionClosure($controller, $decorators);
        });
    }
968843
private function mapArguments(AbstractController $controller, string $method, array $args) : array
    {
        $return = [];

        $reflection = new \ReflectionClass($controller);
        if (!$reflection->hasMethod($method)) {
            throw new \InvalidArgumentException(sprintf(
                "Method '%s' does not exist on '%s' for route '%s'",
                $method,
                get_class($controller),
                $this->currentRoute->getName()
            ));
        }

        $method = $reflection->getMethod($method);

        foreach ($method->getParameters() as $parameter) {
            if (!isset($args[$parameter->getName()]) && $parameter->isOptional() === false) {
                if ($method->getName() === 'init') {
                    continue;
                }

                throw new \InvalidArgumentException(sprintf(
                    "Missing mandatory arguments on controller definition '%s' on '%s'",
                    $parameter->getName(),
                    get_class($controller)
                ));
            }

            $return[$parameter->getName()] = null;

            if (array_key_exists($parameter->getName(), $args) && $args[$parameter->getName()] !== '') {
                $value = $args[$parameter->getName()];

                if ($parameter->getClass() && $parameter->getClass()->getName() == 'Cawa\Date\DateTime') {
                    $value = new DateTime($value);
                }

                $return[$parameter->getName()] = $value;
            } elseif (!array_key_exists($parameter->getName(), $args)) {
                $return[$parameter->getName()] = $parameter->getDefaultValue();
            }
        }

        return $return;
    }
1092665
public function isRoutable(ReflectionMethod $method, $controller)
	{
		if ($method->class == 'Fly\Routing\Controller') return false;

		return $method->isPublic() && starts_with($method->name, $this->verbs);
	}
111988
protected function getRequired($scope = 'Index', $method = Doozr_Http::REQUEST_METHOD_GET)
    {
        // prepare storage on method/verb level
        if (!isset($this->required[$method])) {
            return [];
        }

        // prepare storage on scope level
        if (!isset($this->required[$method][$scope])) {
            return [];
        }

        return $this->required[$method][$scope];
    }
134750
public function dispatch(Route $route, Request $request, $controller, $method)
	{
		// First we will make an instance of this controller via the IoC container instance
		// so that we can call the methods on it. We will also apply any "after" filters
		// to the route so that they will be run by the routers after this processing.
		$instance = $this->makeController($controller);

		$this->assignAfter($instance, $route, $request, $method);

		$response = $this->before($instance, $route, $request, $method);

		// If no before filters returned a response we'll call the method on the controller
		// to get the response to be returned to the router. We will then return it back
		// out for processing by this router and the after filters can be called then.
		if (is_null($response))
		{
			$response = $this->call($instance, $route, $method);
		}

		return $response;
	}
338889
protected function getRouteCallExampleResponse($route, $method)
	{
		$url = $this->getRouteUrlWithBindings($route);
		
		$response = $this->callRoute($method, $url, []);
		
		if (is_null($response)) {
			return null;
		}

		if (is_object($response)) {
			$response = $response->content();
		}

		return $response;
	}
1061566
public function getInMethod(string $method): array
    {
        if (isset($this->methodIndex[$method])) {
            return $this->methodIndex[$method];
        }

        return [];
    }
270930
public function injectionClass($controller, $method, $args)
    {
        $dependentService = $this->dependentService;
        $refClass = $dependentService->newClass($controller);
        return $refClass->injection($method, $args);
    }
1341681
protected function get($method = null)
	{
		if (is_null($method)) return $this->getRoutes();

		return array_get($this->routes, $method, array());
	}
314990
public function getControllerMethod()
    {
        if (! isset($this->method)) {
            list (, $method) = $this->parseControllerCallback();

            return $this->method = $method;
        }

        return $this->method;
    }
341598
public function dispatch(Route $route, $controller, $method)
    {
        $parameters = $this->resolveClassMethodDependencies(
            $route->parametersWithoutNulls(), $controller, $method
        );

        if (method_exists($controller, 'callAction')) {
            return $controller->callAction($method, $parameters);
        }

        return call_user_func_array(array($controller, $method), $parameters);
    }
951363
public function getAppControllersMethod($methodName, $scope = '')
    {
        $methods = [];
        
        if ($this->appControllerRefls) {
            foreach ($this->appControllerRefls as $appRefl) {
                if ($appRefl->hasMethod($methodName)) {
                    $method = $appRefl->getMethod($methodName);
                    
                    if ($this->isApplicationController($method->getDeclaringClass()->getName())) {
                        if ($scope) {
                            $isScope = 'is' . ucfirst($scope);
                            if (!$method->$isScope()) {
                                continue;
                            }
                        }
                        $methods[] = $method->getClosure($this);
                    }
                }
            }
        }
        
        return $methods;
    }
599529
public function dispatch($route, $controller, $method)
    {
        if (method_exists($controller, $method)) {
            return $this->container->call(
                [$controller, $method],
                $this->getMethodArguments($route)
            );
        }

        return $controller->missingMethod($method);
    }