mirror of
https://github.com/flarum/core.git
synced 2025-10-23 04:36:08 +02:00
Replace ControllerInterface with PSR-15 interface
The custom interface already had the same signature as the one from the standard (except for the return type hint), so why not use that one now? :)
This commit is contained in:
@@ -11,11 +11,11 @@
|
||||
|
||||
namespace Flarum\Http;
|
||||
|
||||
use Flarum\Http\Controller\ControllerInterface;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
|
||||
class ControllerRouteHandler
|
||||
{
|
||||
@@ -55,15 +55,15 @@ class ControllerRouteHandler
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @return ControllerInterface
|
||||
* @return RequestHandlerInterface
|
||||
*/
|
||||
protected function resolveController($class)
|
||||
{
|
||||
$controller = $this->container->make($class);
|
||||
|
||||
if (! ($controller instanceof ControllerInterface)) {
|
||||
if (! ($controller instanceof RequestHandlerInterface)) {
|
||||
throw new InvalidArgumentException(
|
||||
'Controller must be an instance of '.ControllerInterface::class
|
||||
'Controller must be an instance of '.RequestHandlerInterface::class
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user