Core/Core/Core.php
public function execute($silent = false)
    {
        try {
            // Execute middleware stack
            /** @var callable $start */
            $start = $this->middleware->top();
            $response = $start();
        } catch (NotFoundException $e) {
            $response = $this->notFound($e);
        } catch (Exception $e) {
            $response = $this->internalError($e);
        }

        // Send response
        if (isset($response) && !$silent) {
            if (!$response instanceof ResponseInterface) {
                throw new Exception("Controllers, hooks and middleware must return instance of ResponseInterface");
            }
            $response->send();
        }

        // Post response hook.
        if (isset($this->hooks['after.execute'])) {
            $this->hooks['after.execute']();
        }

        return $response;
    }
public function execute($silent = false)
    {
        try {
            // Execute middleware stack
            /** @var callable $start */
            $start = $this->middleware->top();
            $response = $start();
        } catch (NotFoundException $e) {
            $response = $this->notFound($e);
        } catch (Exception $e) {
            $response = $this->internalError($e);
        }

        // Send response
        if (isset($response) && !$silent) {
            if (!$response instanceof ResponseInterface) {
                throw new Exception("Controllers, hooks and middleware must return instance of ResponseInterface");
            }
            $response->send();
        }

        // Post response hook.
        if (isset($this->hooks['after.execute'])) {
            $this->hooks['after.execute']();
        }

        return $response;
    }
public function execute ( $ silent = false ) { try { // Execute middleware stack /** @var callable $start */ $ start = $ this -> middleware -> top ( ) ; $ response = $ start ( ) ; } catch ( NotFoundException $ e ) { $ response = $ this -> notFound ( $ e ) ; } catch ( Exception $ e ) { $ response = $ this -> internalError ( $ e ) ; } // Send response if ( isset ( $ response ) && ! $ silent ) { if ( ! $ response instanceof ResponseInterface ) { throw new Exception ( "Controllers, hooks and middleware must return instance of ResponseInterface" ) ; } $ response -> send ( ) ; } // Post response hook. if ( isset ( $ this -> hooks [ 'after.execute' ] ) ) { $ this -> hooks [ 'after.execute' ] ( ) ; } return $ response ; }
Route request and execute associated action.

@param bool $silent
@return ResponseInterface
@throws Exception
Route request and execute associated action .