src/main/php/routing/Interceptors.php
private function executePostInterceptor($postInterceptor, Request $request, Response $response)
    {
        if (is_callable($postInterceptor)) {
            return $postInterceptor($request, $response);
        }

        if ($postInterceptor instanceof PostInterceptor) {
            return $postInterceptor->postProcess($request, $response);
        }

        $instance = $this->injector->getInstance($postInterceptor);
        if (!($instance instanceof PostInterceptor)) {
            $response->write(
                    $response->internalServerError(
                            'Configured post interceptor ' . $postInterceptor
                            . ' is not an instance of ' . PostInterceptor::class
                    )
            );
            return false;
        }

        return $instance->postProcess($request, $response);
    }
private function executePostInterceptor($postInterceptor, Request $request, Response $response)
    {
        if (is_callable($postInterceptor)) {
            return $postInterceptor($request, $response);
        }

        if ($postInterceptor instanceof PostInterceptor) {
            return $postInterceptor->postProcess($request, $response);
        }

        $instance = $this->injector->getInstance($postInterceptor);
        if (!($instance instanceof PostInterceptor)) {
            $response->write(
                    $response->internalServerError(
                            'Configured post interceptor ' . $postInterceptor
                            . ' is not an instance of ' . PostInterceptor::class
                    )
            );
            return false;
        }

        return $instance->postProcess($request, $response);
    }
private function executePostInterceptor ( $ postInterceptor , Request $ request , Response $ response ) { if ( is_callable ( $ postInterceptor ) ) { return $ postInterceptor ( $ request , $ response ) ; } if ( $ postInterceptor instanceof PostInterceptor ) { return $ postInterceptor -> postProcess ( $ request , $ response ) ; } $ instance = $ this -> injector -> getInstance ( $ postInterceptor ) ; if ( ! ( $ instance instanceof PostInterceptor ) ) { $ response -> write ( $ response -> internalServerError ( 'Configured post interceptor ' . $ postInterceptor . ' is not an instance of ' . PostInterceptor :: class ) ) ; return false ; } return $ instance -> postProcess ( $ request , $ response ) ; }
executes post interceptor

@param   mixed                      $postInterceptor
@param   \stubbles\webapp\Request   $request          current request
@param   \stubbles\webapp\Response  $response         response to send
@return  bool|null
executes post interceptor