public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $container = new ControllerContainer($this->container, $request);

        $placeholders = array_map([$request, 'getAttribute'], $this->attributes);

        $controller = $container->get($this->controller);

        if (is_object($controller)) {

            $action = [$controller, $this->method];

            return ($this->factory)($action)->value($container, $placeholders);

        }

        throw new ContainedControllerTypeException($this->controller, $controller);
    }
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $container = new ControllerContainer($this->container, $request);

        $placeholders = array_map([$request, 'getAttribute'], $this->attributes);

        $controller = $container->get($this->controller);

        if (is_object($controller)) {

            $action = [$controller, $this->method];

            return ($this->factory)($action)->value($container, $placeholders);

        }

        throw new ContainedControllerTypeException($this->controller, $controller);
    }
public function handle ( ServerRequestInterface $ request ) : ResponseInterface { $ container = new ControllerContainer ( $ this -> container , $ request ) ; $ placeholders = array_map ( [ $ request , 'getAttribute' ] , $ this -> attributes ) ; $ controller = $ container -> get ( $ this -> controller ) ; if ( is_object ( $ controller ) ) { $ action = [ $ controller , $ this -> method ] ; return ( $ this -> factory ) ( $ action ) -> value ( $ container , $ placeholders ) ; } throw new ContainedControllerTypeException ( $ this -> controller , $ controller ) ; }
Return a response from the controller method. Use a controller container
using the given request to get the controller and execute the controller
method using the resolvable callable factory.

@param \Psr\Http\Message\ServerRequestInterface  $request
@return \Psr\Http\Message\ResponseInterface
@throws \Ellipse\Handlers\Exceptions\ContainedControllerTypeException
Return a response from the controller method . Use a controller container using the given request to get the controller and execute the controller method using the resolvable callable factory .