generated from Potter/Template
init
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
},
|
},
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.3"
|
"php": "^8.3",
|
||||||
|
"league/route": "^6.2",
|
||||||
|
"psr/http-server-handler": "^1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/Potter/Http/AbstractHttpRouter.php
Normal file
10
src/Potter/Http/AbstractHttpRouter.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Http;
|
||||||
|
|
||||||
|
use \League\Route\Router as BaseHttpRouter;
|
||||||
|
|
||||||
|
abstract class AbstractHttpRouter extends BaseHttpRouter implements HttpRouterInterface
|
||||||
|
{ }
|
||||||
10
src/Potter/Http/HttpRouter.php
Normal file
10
src/Potter/Http/HttpRouter.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Http;
|
||||||
|
|
||||||
|
final class HttpRouter extends AbstractHttpRouter
|
||||||
|
{
|
||||||
|
use HttpRouterTrait;
|
||||||
|
}
|
||||||
17
src/Potter/Http/HttpRouterInterface.php
Normal file
17
src/Potter/Http/HttpRouterInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Http;
|
||||||
|
|
||||||
|
use \League\Route\MatchResult;
|
||||||
|
use \League\Router\RouterInterface as BaseHttpRouterInterface;
|
||||||
|
use \Psr\Http\Message\ResponseInterface as PsrResponseInterface;
|
||||||
|
use \Psr\Http\Server\RequestHandlerInterface as PsrRequestHandlerInterface;
|
||||||
|
use \Psr\Http\Server\ServerRequestInterface as PsrServerRequestInterface;
|
||||||
|
|
||||||
|
interface HttpRouterInterface extends PsrRequestHandlerInterface, BaseHttpRouterInterface
|
||||||
|
{
|
||||||
|
public function dispatch(PsrServerRequestInterface $request): PsrResponseInterface;
|
||||||
|
public function match(PsrServerRequestInterface $request): MatchResult;
|
||||||
|
}
|
||||||
8
src/Potter/Http/HttpRouterTrait.php
Normal file
8
src/Potter/Http/HttpRouterTrait.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Http;
|
||||||
|
|
||||||
|
trait HttpRouterTrait
|
||||||
|
{ }
|
||||||
Reference in New Issue
Block a user