- Added MethodNotAllowed interface

This commit is contained in:
Dave M. 2025-09-12 19:54:00 +00:00 committed by Dave Mc Nicoll
parent e934c1a92c
commit c6e9bb6a38
2 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,7 @@ use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterI
use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; use Lean\Factory\{ HttpFactory, HttpFactoryInterface };
use Picea\Picea; use Picea\Picea;
use function DI\autowire, DI\create, DI\get; use function DI\{ autowire, create, get };
return [ return [
ServerRequestInterface::class => function ($c) { ServerRequestInterface::class => function ($c) {

View File

@ -38,4 +38,9 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy {
{ {
return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception);
} }
public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface
{
return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception);
}
} }