Compare commits
8 Commits
5ead710468
..
0.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| d54f75dc9b | |||
| 04a633030b | |||
| 64ed7212f8 | |||
| 85dcbf9071 | |||
| 41f9e4242f | |||
| 34f4cd2c81 | |||
| 0314c93c94 | |||
| 73c9b43bfb |
@@ -0,0 +1,3 @@
|
|||||||
|
composer.lock
|
||||||
|
/nbproject/
|
||||||
|
/vendor/
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "potter/router",
|
||||||
|
"type": "library",
|
||||||
|
"license": "MIT",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Potter\\Router\\": "src/Potter/Router/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Jay Potter",
|
||||||
|
"email": "j@ypotter.ca"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"require": {
|
||||||
|
"league/route": "^6.0.0",
|
||||||
|
"nikic/fast-route": "^1.3.1",
|
||||||
|
"opis/closure": "^3.7.0",
|
||||||
|
"psr/http-factory": "^1.1.0",
|
||||||
|
"psr/http-server-handler": "^1.0.2",
|
||||||
|
"psr/http-server-middleware": "^1.0.2",
|
||||||
|
"psr/simple-cache": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Router;
|
||||||
|
|
||||||
|
use \Potter\Container;
|
||||||
|
|
||||||
|
trait Behaviour
|
||||||
|
{
|
||||||
|
private static function addRouter(Container $container): void
|
||||||
|
{
|
||||||
|
$container->addShared(Router::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function addRouterBehaviour(Container $container): void
|
||||||
|
{
|
||||||
|
self::addRouter($container);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function getRouter(Container $container): Router
|
||||||
|
{
|
||||||
|
return $container->get(Router::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Router;
|
||||||
|
|
||||||
|
final class Router extends \League\Route\Router
|
||||||
|
{ }
|
||||||
Reference in New Issue
Block a user