private function doRun()
    {
        $dispatcher = (new DispatcherInjector)->build();

        //покажем событие Request
        if (($response = $dispatcher->signal('kernel.request')) instanceof ResponseInterface) {
            return $response; // событие завершило очередь
        }

        $resolver = $this->getResolver();

        //покажем событие Route
        if (($response = $dispatcher->signal('kernel.route', ['resolver' => $resolver])) instanceof ResponseInterface) {
            return $response; // событие завершило очередь
        }

        /** @var Console|IController $controller */
        $controller = $resolver->getApp();
        $action = $resolver->getAction();

        //покажем событие Controller
        if (($response = $dispatcher->signal('kernel.controller',
                ['controller' => $controller, 'action' => $action])) instanceof ResponseInterface
        ) {
            return $response; // событие завершило очередь
        }

        $response = $controller->action((string)$action);

        if (!($response instanceof ResponseInterface)) {
            $responser = (new ResponseInjector)->build();
            $stream = $responser->getBody();
            $stream->write((string)$response);

            $response = $responser->withBody($stream);
        }

        $dispatcher->signal('kernel.response', ['response' => $response]);

        return $response;
    }
private function doRun()
    {
        $dispatcher = (new DispatcherInjector)->build();

        //покажем событие Request
        if (($response = $dispatcher->signal('kernel.request')) instanceof ResponseInterface) {
            return $response; // событие завершило очередь
        }

        $resolver = $this->getResolver();

        //покажем событие Route
        if (($response = $dispatcher->signal('kernel.route', ['resolver' => $resolver])) instanceof ResponseInterface) {
            return $response; // событие завершило очередь
        }

        /** @var Console|IController $controller */
        $controller = $resolver->getApp();
        $action = $resolver->getAction();

        //покажем событие Controller
        if (($response = $dispatcher->signal('kernel.controller',
                ['controller' => $controller, 'action' => $action])) instanceof ResponseInterface
        ) {
            return $response; // событие завершило очередь
        }

        $response = $controller->action((string)$action);

        if (!($response instanceof ResponseInterface)) {
            $responser = (new ResponseInjector)->build();
            $stream = $responser->getBody();
            $stream->write((string)$response);

            $response = $responser->withBody($stream);
        }

        $dispatcher->signal('kernel.response', ['response' => $response]);

        return $response;
    }
private function doRun ( ) { $ dispatcher = ( new DispatcherInjector ) -> build ( ) ; //покажем событие Request if ( ( $ response = $ dispatcher -> signal ( 'kernel.request' ) ) instanceof ResponseInterface ) { return $ response ; // событие завершило очередь } $ resolver = $ this -> getResolver ( ) ; //покажем событие Route if ( ( $ response = $ dispatcher -> signal ( 'kernel.route' , [ 'resolver' => $ resolver ] ) ) instanceof ResponseInterface ) { return $ response ; // событие завершило очередь } /** @var Console|IController $controller */ $ controller = $ resolver -> getApp ( ) ; $ action = $ resolver -> getAction ( ) ; //покажем событие Controller if ( ( $ response = $ dispatcher -> signal ( 'kernel.controller' , [ 'controller' => $ controller , 'action' => $ action ] ) ) instanceof ResponseInterface ) { return $ response ; // событие завершило очередь } $ response = $ controller -> action ( ( string ) $ action ) ; if ( ! ( $ response instanceof ResponseInterface ) ) { $ responser = ( new ResponseInjector ) -> build ( ) ; $ stream = $ responser -> getBody ( ) ; $ stream -> write ( ( string ) $ response ) ; $ response = $ responser -> withBody ( $ stream ) ; } $ dispatcher -> signal ( 'kernel.response' , [ 'response' => $ response ] ) ; return $ response ; }
Real run application

@return ResponseInterface
Real run application