From ca388e8a52fe8a1b6d20f7d83aa4eece57908581 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH] - Merged with master done --- meta/definitions/http.php | 4 ++-- src/ApplicationStrategy.php | 7 +++++++ src/ApplicationStrategy/MethodNotAllowedInterface.php | 10 ++++++++++ view/lean/picto/undraw_error.phtml~ | 5 +++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/ApplicationStrategy/MethodNotAllowedInterface.php create mode 100644 view/lean/picto/undraw_error.phtml~ diff --git a/meta/definitions/http.php b/meta/definitions/http.php index cee0964..56fd0ff 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -2,8 +2,7 @@ use Psr\Container\ContainerInterface; - -use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator }; +use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator, MethodNotAllowedInterface, }; use Psr\Http\Message\ServerRequestInterface; use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterInterface, HttpHandlerRunner\Emitter\SapiEmitter }; use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; @@ -36,4 +35,5 @@ return [ ThrowableHandlerInterface::class => autowire(ThrowableHandler::class), NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class), + # MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class), ]; diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index f0de3e8..5ca5196 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -2,8 +2,10 @@ namespace Lean; +use League\Route\Http\Exception\MethodNotAllowedException; use League\Route\Strategy; use League\Route\Http\Exception\NotFoundException; +use Lean\ApplicationStrategy\MethodNotAllowedInterface; use Lean\ApplicationStrategy\NotFoundDecoratorInterface; use Lean\ApplicationStrategy\ThrowableHandlerInterface; use Lean\Factory\HttpFactoryInterface; @@ -32,4 +34,9 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->getContainer()->get(ThrowableHandlerInterface::class); } + + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + { + return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); + } } \ No newline at end of file diff --git a/src/ApplicationStrategy/MethodNotAllowedInterface.php b/src/ApplicationStrategy/MethodNotAllowedInterface.php new file mode 100644 index 0000000..90b6653 --- /dev/null +++ b/src/ApplicationStrategy/MethodNotAllowedInterface.php @@ -0,0 +1,10 @@ + +======= +bug fixing +>>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)