This commit is contained in:
2021-05-08 11:18:31 +08:00
parent f49539cfd6
commit c43ce9270c
+3 -2
View File
@@ -31,8 +31,6 @@ class Router extends HttpService implements RouterInterface
public array $groupTacks = []; public array $groupTacks = [];
public ?string $dir = 'App\\Http\\Controllers'; public ?string $dir = 'App\\Http\\Controllers';
public array $hashMap = [];
const NOT_FOUND = 'Page not found or method not allowed.'; const NOT_FOUND = 'Page not found or method not allowed.';
/** @var string[] */ /** @var string[] */
@@ -100,6 +98,7 @@ class Router extends HttpService implements RouterInterface
* @param $handler * @param $handler
* @param string $method * @param string $method
* @return ?Node * @return ?Node
* @throws Exception
*/ */
public function addRoute($path, $handler, $method = 'any'): ?Node public function addRoute($path, $handler, $method = 'any'): ?Node
{ {
@@ -159,6 +158,7 @@ class Router extends HttpService implements RouterInterface
* @param $handler * @param $handler
* @param string $method * @param string $method
* @return Node * @return Node
* @throws Exception
*/ */
private function tree($path, $handler, $method = 'any'): Node private function tree($path, $handler, $method = 'any'): Node
{ {
@@ -182,6 +182,7 @@ class Router extends HttpService implements RouterInterface
* @param array $explode * @param array $explode
* @param $method * @param $method
* @return Node * @return Node
* @throws Exception
*/ */
private function bindNode(Node $parent, array $explode, $method): Node private function bindNode(Node $parent, array $explode, $method): Node
{ {