src/Slim/Handlers/Strategies/ActionStrategy.php
protected function callHandler(
        callable $callable,
        ServerRequestInterface $request,
        ResponseInterface $response,
        array $routeArguments
    ) {
        # Action is a closure
        if ($callable instanceof Closure) {
            array_unshift($routeArguments, $request, $response);
            $result = call_user_func_array($callable, $routeArguments);
        } else {
            # Action is a method of an Action class
            if (is_array($callable) && $callable[0] instanceof Action\ActionInterface) {
                $callable[0]->setResponse($response);
                $callable[0]->setRequest($request);
            }

            # Call Action method
            $result   = $this->callAction($callable, $request, $response, $routeArguments);
            /** @var Action\ActionInterface $action */
            $action   = $callable[0];
            $response = $action->getResponse();
        }

        if (($result instanceof ResponseInterface)) {
            $response = $result;
        } else {
            $response = $this->buildResponse($result, $response, $request);
        }

        return $response;
    }
protected function callHandler(
        callable $callable,
        ServerRequestInterface $request,
        ResponseInterface $response,
        array $routeArguments
    ) {
        # Action is a closure
        if ($callable instanceof Closure) {
            array_unshift($routeArguments, $request, $response);
            $result = call_user_func_array($callable, $routeArguments);
        } else {
            # Action is a method of an Action class
            if (is_array($callable) && $callable[0] instanceof Action\ActionInterface) {
                $callable[0]->setResponse($response);
                $callable[0]->setRequest($request);
            }

            # Call Action method
            $result   = $this->callAction($callable, $request, $response, $routeArguments);
            /** @var Action\ActionInterface $action */
            $action   = $callable[0];
            $response = $action->getResponse();
        }

        if (($result instanceof ResponseInterface)) {
            $response = $result;
        } else {
            $response = $this->buildResponse($result, $response, $request);
        }

        return $response;
    }
protected function callHandler ( callable $ callable , ServerRequestInterface $ request , ResponseInterface $ response , array $ routeArguments ) { # Action is a closure if ( $ callable instanceof Closure ) { array_unshift ( $ routeArguments , $ request , $ response ) ; $ result = call_user_func_array ( $ callable , $ routeArguments ) ; } else { # Action is a method of an Action class if ( is_array ( $ callable ) && $ callable [ 0 ] instanceof Action \ ActionInterface ) { $ callable [ 0 ] -> setResponse ( $ response ) ; $ callable [ 0 ] -> setRequest ( $ request ) ; } # Call Action method $ result = $ this -> callAction ( $ callable , $ request , $ response , $ routeArguments ) ; /** @var Action\ActionInterface $action */ $ action = $ callable [ 0 ] ; $ response = $ action -> getResponse ( ) ; } if ( ( $ result instanceof ResponseInterface ) ) { $ response = $ result ; } else { $ response = $ this -> buildResponse ( $ result , $ response , $ request ) ; } return $ response ; }
Call action with built params

@param callable               $callable
@param ServerRequestInterface $request
@param ResponseInterface      $response
@param array                  $routeArguments

@return mixed
@throws Exception
Call action with built params