Run the route action as callable and return the response.

@return mixed
@throws LogicException
496815
protected function runCallable()
    {
        $parameters = $this->resolveMethodDependencies(
            $this->getParametersWithoutNulls(), new ReflectionFunction($this->action['uses'])
        );

        $callable = $this->action['uses'];

        return call_user_func_array($callable, $parameters);
    }
915245
private function runAction()
    {
        // Get URL
        $url = $this->request->url();

        // Get route action
        $action = $this->router->getAction($url);

        // Perform the filter
        if ($action['filter']) {
            $filter = $this->router->performFilter($action['filter']);
        }

        // Check if the controller exists
        if (!isset($action) || !is_string($action['class']) || !class_exists($action['class'])) {
            throw new \Exception('Controller not found', 404);
        }

        // Create the required controller
        $controller = $this->make($action['class']);

        // Execute the required method and return the response
        return $this->response->output(call_user_func_array([$controller, $action['method']], $action['params']? : []));
    }
1272125
public function run()
    {
        // Creates the current controller instance
        $this->controller = new $this->controller($this->twig);

        // Calls the action method on the controller
        $response = call_user_func([$this->controller, $this->action]);

        // Shows the response
        echo $response;
    }
867776
private function execute()
	{
		if ($this->currentRoute == null) {
			$this->router->getRoute('error_page')->setAction('_notFound');
			$this->toRoute('error_page');
			return;
		}
		$controllerName = $this->currentRoute->getController();
		if ($controllerName == '') {
			if ($this->currentRoute->getParams() != null && array_key_exists('controller', $this->currentRoute->getParams()))
				$controllerName = $this->currentRoute->getParams()['controller'];
			elseif ($this->currentRoute->getDefault() != null)
				$controllerName = $this->currentRoute->getDefault()->getController();
			else {
				throw new \Exception($this->translator->translate("The requested url has a bad route configuration!"));
			}
		}

		if (array_key_exists($controllerName, $this->invokable))
			$controllerName = $this->invokable[$controllerName];
		elseif (strpos($controllerName, 'decoy\base') === false)
			throw new \Exception('The requested Controller: \'' . $controllerName . '\' is not registered!');
		$c = new $controllerName($this);
		if ($c->getResult() && !in_array($c->identifier, $this->disableRender) && $this->enableRender) {
			echo $this->response->output($c);
		}
	}
59906
public function query()
    {
        // Pre-execute callbacks
        if( !empty($this->preExecuteCallbacks) ) {
            foreach( $this->preExecuteCallbacks as $callable ) {
                call_user_func($callable, $this);
            }
        }
        // Execute
        if( $this->database ) {
            //$this->interpolateParams();
            $result = $this->database->query($this);
        } else if( $this->queryCallback ) {
            $query = $this->toString();
            $params = $this->params();
            if( $this->interpolation ) {
                $result = call_user_func($this->queryCallback, $query);
            } else {
                $result = call_user_func($this->queryCallback, $query, $params);
            }
        } else {
            throw new LogicException('query() called when no callback or database adapter set');
        }
        // Post-execute callbacks
        if( !empty($this->postExecuteCallbacks) ) {
            foreach( $this->postExecuteCallbacks as $callable ) {
                call_user_func($callable, $result, $this);
            }
        }
        return $result;
    }
514842
public function execute()
	{
		if (count($this->children) && count($this->input->args))
		{
			$name = $this->input->args[0];

			try
			{
				return $this->executeSubCommand($name);
			}
			catch (CommandNotFoundException $e)
			{
				$e->getCommand()->renderAlternatives($e->getChild(), $e);

				return $e->getCode();
			}
			catch (\Exception $e)
			{
				$this->renderException($e);

				return $e->getCode();
			}
		}

		if ($this->handler)
		{
			if ($this->handler instanceof \Closure)
			{
				$code = $this->handler;

				return $code($this);
			}
			elseif (is_callable($this->handler))
			{
				return call_user_func($this->handler, $this);
			}
		}

		return $this->doExecute();
	}
710918
public function runAction()
    {
        try {
            $this->commandBus->dispatch(CreateDefaultProcessingConfigFile::in(ConfigLocation::fromPath(Definition::getSystemConfigDir())));

            $sqliteDbFile = SqliteDbFile::initializeFromDist(Definition::getEventStoreSqliteDbFile());

            $esConfigLocation = ConfigLocation::fromPath(Definition::getSystemConfigDir());

            $this->commandBus->dispatch(InitializeEventStore::setUpWithSqliteDbAdapter($sqliteDbFile, $esConfigLocation));

        } catch (\Exception $ex) {
            $this->commandBus->dispatch(UndoSystemSetUp::removeConfigs(
                Definition::getSystemConfigDir(),
                Definition::getSystemConfigDir(),
                Definition::getEventStoreSqliteDbFile()
            ));

            throw $ex;
        }

        return $this->redirect()->toRoute('prooph.link/system_config');
    }
130676
private function runController(): void
    {
        //get route information
        $action = $this->routeAction;
        $param = $this->routeParam;

        //action - call controller passing params
        if (!empty($param)) {
            \call_user_func_array([$this->controller, $action], $param);
            return;
        }

        //action - call controller
        if ($action) {
            \call_user_func([$this->controller, $action]);
        }
    }
114314
public function callController($route = null)
    {
        if (!isset($route)) {
            $route = $this->route;
        }

        $callback = Handler::get($route, null, 'controller');

        if (!$callback[0] instanceof CliController) {
            throw new LogicException('Controller must be instance of \gplcart\core\CliController');
        }

        call_user_func($callback);

        throw new LogicException('The command was completed incorrectly');
    }
1249308
public function run()
    {
        $routeInfo = $this->getRouter()->filter();
        $event = new Dispatch([
            'application' => $this,
            'routeInfo' => $routeInfo
        ]);
        $this->getEventManager()
            ->trigger(Dispatch::BEFORE_DISPATCH, $this, $event);
        $response = $this->dispatcher->dispatch($routeInfo);
        $event->response = $response;
        $this->getEventManager()
            ->trigger(Dispatch::AFTER_DISPATCH, $this, $event);
        return $event->response;
    }
764710
public function reconnect()
    {
        if (is_callable($this->reconnector)) {
            $this->doctrineConnection = null;

            return call_user_func($this->reconnector, $this);
        }

        throw new LogicException('Lost connection and no reconnector available.');
    }
1042389
public function run()
    {
        $this->container = $this->container ?: new Container;

        try {
            if ($this->isControllerAction()) {
                return $this->runController();
            }

            return $this->runCallable();
        } catch (HttpResponseException $e) {
            return $e->getResponse();
        }
    }
896874
public function invoke(Callable $callable)
	{
		$reflection = $this->reflectCallable($callable);

		$args = [];

		foreach($reflection->getParameters() as $param) {
			$type = $param->getClass()->getName();

			if (in_array($type, $this->resolving)) {
				throw new \LogicException("Recursive dependency: $type is currently instatiating.");
			}

			$args[] = ($param->allowsNull() && !isset($this[$type])) ? null : $this[$type];
		}

		return call_user_func_array($callable, $args);
	}
515733
public function execute(ReturnExpr $expr, FragmentInterface $query, Connection $connection, MapperInterface $mapper)
    {
        $name = $expr->getExecutionStrategy();

        if (!isset($this->strategies[$name])) {
            throw new LogicException(sprintf(
                'The execution strategy named "%s" is not available.',
                $name
            ));
        }

        return $this->strategies[$name]->execute($query, $connection, $mapper, $expr->getField(), $expr->getType());
    }
466287
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = ($this->handler)($request, $handler);

        if (!($response instanceof ResponseInterface)) {
            throw new \LogicException('The middleware must return a ResponseInterface');
        }

        return $response;
    }
958662
public function run()
    {
        try
        {
            $this['triggers']->callTrigger('before-match-request', $this);

            $this['request']->attributes->add(
                $this['router']->matchRequest($this['request'])
            );

            $this['triggers']->callTrigger('before-controller-resolver', $this);

            $this['response'] = $this->controllerResolver();
        }
        catch (ResourceNotFoundException $e)
        {
            $this['response'] = (new Controller($this))->serve404();
        }
        catch (\Exception $e)
        {
            $this['response'] = new Response();
            $this['response']->headers->set('Content-Type', 'text/plain');
            $this['response']->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
            $this['response']->setContent($e->getMessage());
        }

        if ($this['x-frame-options']) {
            $this['response']->headers->set('x-frame-options', $this['x-frame-options']);
        }

        $this['response']->prepare($this['request']);

        $this['triggers']->callTrigger('before-send-response', $this);

        $this['response']->send();
    }
459051
public function handle()
    {
        if (! $model = $this->getModel()) {
            return;
        }

        $configurator = $model->getIndexConfigurator();

        $mapping = array_merge_recursive(
            $configurator->getDefaultMapping(),
            $model->getMapping()
        );

        if (empty($mapping)) {
            throw new LogicException('Nothing to update: the mapping is not specified.');
        }

        $payload = new TypePayload($model);

        if (in_array(Migratable::class, class_uses_recursive($configurator))) {
            $payload->useAlias('write');
        }

        $payload->set('body.'.$model->searchableAs(), $mapping);

        ElasticClient::indices()
            ->putMapping($payload->get());

        $this->info(sprintf(
            'The %s mapping was updated!',
            $model->searchableAs()
        ));
    }