- Added MethodNotAllowed interface
This commit is contained in:
1 parent
990f57b94e
commit
74a56bd72f
3 files changed
+19
-1
No files matched your search
@@ -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;
|
||||
@@ -31,4 +33,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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Lean\ApplicationStrategy;
|
||||
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
|
||||
interface MethodNotAllowedInterface extends MiddlewareInterface
|
||||
{
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user