public function prepare(): bool
    {
        $request = $this->getRequest();
        $response = $this->getResponse();
        $thrown = false;

        try {
            //dispatch an init
            $continue = $this->getPreprocessor()->process($request, $response);
        //we are going to ignore this because
        //there is a conflict between PHP5.6 and PHP7
        //and how it deals with Throwable
        // @codeCoverageIgnoreStart
        } catch (Throwable $e) {
            //if there is an exception
            //you may not want to out
            //right throw it out
            $thrown = true;
            $response->setStatus(500, HttpHandler::STATUS_500);
            $continue = $this->getErrorProcessor()->process($request, $response, $e);
            //if there's an error in the errorware then let it be thrown
        } catch (Exception $e) {
            if (!$thrown) {
                //same logic as above
                $response->setStatus(500, HttpHandler::STATUS_500);
                $continue = $this->getErrorProcessor()->process($request, $response, $e);
                //if there's an error in the errorware then let it be thrown
            }
        }
        // @codeCoverageIgnoreEnd

        return $continue;
    }
public function prepare(): bool
    {
        $request = $this->getRequest();
        $response = $this->getResponse();
        $thrown = false;

        try {
            //dispatch an init
            $continue = $this->getPreprocessor()->process($request, $response);
        //we are going to ignore this because
        //there is a conflict between PHP5.6 and PHP7
        //and how it deals with Throwable
        // @codeCoverageIgnoreStart
        } catch (Throwable $e) {
            //if there is an exception
            //you may not want to out
            //right throw it out
            $thrown = true;
            $response->setStatus(500, HttpHandler::STATUS_500);
            $continue = $this->getErrorProcessor()->process($request, $response, $e);
            //if there's an error in the errorware then let it be thrown
        } catch (Exception $e) {
            if (!$thrown) {
                //same logic as above
                $response->setStatus(500, HttpHandler::STATUS_500);
                $continue = $this->getErrorProcessor()->process($request, $response, $e);
                //if there's an error in the errorware then let it be thrown
            }
        }
        // @codeCoverageIgnoreEnd

        return $continue;
    }
public function prepare ( ) : bool { $ request = $ this -> getRequest ( ) ; $ response = $ this -> getResponse ( ) ; $ thrown = false ; try { //dispatch an init $ continue = $ this -> getPreprocessor ( ) -> process ( $ request , $ response ) ; //we are going to ignore this because //there is a conflict between PHP5.6 and PHP7 //and how it deals with Throwable // @codeCoverageIgnoreStart } catch ( Throwable $ e ) { //if there is an exception //you may not want to out //right throw it out $ thrown = true ; $ response -> setStatus ( 500 , HttpHandler :: STATUS_500 ) ; $ continue = $ this -> getErrorProcessor ( ) -> process ( $ request , $ response , $ e ) ; //if there's an error in the errorware then let it be thrown } catch ( Exception $ e ) { if ( ! $ thrown ) { //same logic as above $ response -> setStatus ( 500 , HttpHandler :: STATUS_500 ) ; $ continue = $ this -> getErrorProcessor ( ) -> process ( $ request , $ response , $ e ) ; //if there's an error in the errorware then let it be thrown } } // @codeCoverageIgnoreEnd return $ continue ; }
Prepares the event and calls the preprocessors

@return bool Whether if the process should continue
Prepares the event and calls the preprocessors