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);
    }