src/Strategy/ApplicationStrategy.php
protected function throwThrowableMiddleware(Throwable $error) : MiddlewareInterface
    {
        return new class($error) implements MiddlewareInterface
        {
            protected $error;

            public function __construct(Throwable $error)
            {
                $this->error = $error;
            }

            public function process(
                ServerRequestInterface $request,
                RequestHandlerInterface $requestHandler
            ) : ResponseInterface {
                throw $this->error;
            }
        };
    }
protected function throwThrowableMiddleware(Throwable $error) : MiddlewareInterface
    {
        return new class($error) implements MiddlewareInterface
        {
            protected $error;

            public function __construct(Throwable $error)
            {
                $this->error = $error;
            }

            public function process(
                ServerRequestInterface $request,
                RequestHandlerInterface $requestHandler
            ) : ResponseInterface {
                throw $this->error;
            }
        };
    }
protected function throwThrowableMiddleware ( Throwable $ error ) : MiddlewareInterface { return new class ( $ error ) implements MiddlewareInterface { protected $ error ; public function __construct ( Throwable $ error ) { $ this -> error = $ error ; } public function process ( ServerRequestInterface $ request , RequestHandlerInterface $ requestHandler ) : ResponseInterface { throw $ this -> error ; } } ; }
Return a middleware that simply throws an error

@param \Throwable $error

@return \Psr\Http\Server\MiddlewareInterface
Return a middleware that simply throws an error