eee
This commit is contained in:
+12
-6
@@ -58,6 +58,12 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate
|
||||
protected array $httpHandler = [];
|
||||
|
||||
|
||||
/**
|
||||
* @var array<string, object>
|
||||
*/
|
||||
protected array $controllers = [];
|
||||
|
||||
|
||||
/**
|
||||
* @var Handler
|
||||
*/
|
||||
@@ -137,11 +143,11 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate
|
||||
{
|
||||
try {
|
||||
$route = $this->_splicing_routing($route);
|
||||
if ($closure instanceof Closure) {
|
||||
$handler = $this->interpreter->addRouteByClosure($closure);
|
||||
} else {
|
||||
$handler = $this->resolve($closure, $this->interpreter);
|
||||
}
|
||||
// if ($closure instanceof Closure) {
|
||||
// $handler = $this->interpreter->addRouteByClosure($closure);
|
||||
// } else {
|
||||
// }
|
||||
$handler = $this->resolve($closure, $this->interpreter);
|
||||
foreach ($method as $value) {
|
||||
if ($value instanceof RequestMethod) {
|
||||
$value = $value->getString();
|
||||
@@ -169,7 +175,7 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate
|
||||
foreach ($this->methods as $methodPath => $handler) {
|
||||
[$path, $method] = explode('_', $methodPath);
|
||||
|
||||
$controller = $handler->isClosure() ? '\Closure' : $handler->getClass() . '::' . $handler->getMethod();
|
||||
$controller = $handler instanceof Closure ? '\Closure' : $handler->getClass() . '::' . $handler->getMethod();
|
||||
$array[] = [
|
||||
'path' => $path,
|
||||
'method' => $method,
|
||||
|
||||
Reference in New Issue
Block a user