- Added MethodNotAllowed interface

This commit is contained in:
mcndave authored and Dave Mc Nicoll committed 2026-06-01 15:23:04 +00:00
1 parent e934c1a92c
commit c6e9bb6a38
2 files changed
+6 -1

No files matched your search

+1 -1
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) {
+5
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);
}
} }