- Merged with master done
This commit is contained in:
parent
b12fc65ea9
commit
ca388e8a52
@ -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),
|
||||
];
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
10
src/ApplicationStrategy/MethodNotAllowedInterface.php
Normal file
10
src/ApplicationStrategy/MethodNotAllowedInterface.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Lean\ApplicationStrategy;
|
||||
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
|
||||
interface MethodNotAllowedInterface extends MiddlewareInterface
|
||||
{
|
||||
|
||||
}
|
||||
5
view/lean/picto/undraw_error.phtml~
Normal file
5
view/lean/picto/undraw_error.phtml~
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user