eee
This commit is contained in:
+5
-1
@@ -211,11 +211,15 @@ class Router
|
|||||||
foreach ($router->getMethods() as $name => $method) {
|
foreach ($router->getMethods() as $name => $method) {
|
||||||
$middlewares = $method->getMiddlewares();
|
$middlewares = $method->getMiddlewares();
|
||||||
$validator = MiddlewareManager::getValidator($method->getClass(), $method->getMethod());
|
$validator = MiddlewareManager::getValidator($method->getClass(), $method->getMethod());
|
||||||
|
|
||||||
|
|
||||||
|
var_dump(sprintf("%s::%s(%s)", $method->getClass(), $method->getMethod(), json_encode($middlewares, JSON_UNESCAPED_UNICODE)));
|
||||||
|
|
||||||
|
|
||||||
if (!is_null($validator)) {
|
if (!is_null($validator)) {
|
||||||
array_unshift($middlewares, new ValidatorMiddleware(di(ResponseInterface::class), $method->getClass(), $method->getMethod()));
|
array_unshift($middlewares, new ValidatorMiddleware(di(ResponseInterface::class), $method->getClass(), $method->getMethod()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// var_dump(sprintf("%s::%s(%s)",$method->getClass(), $method->getMethod(), json_encode($middlewares,JSON_UNESCAPED_UNICODE)));
|
|
||||||
$router->setHttpHandler($name, new HttpRequestHandler($middlewares, $method));
|
$router->setHttpHandler($name, new HttpRequestHandler($middlewares, $method));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,10 +206,7 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate
|
|||||||
public function register(string $path, string $method, Handler $handler): void
|
public function register(string $path, string $method, Handler $handler): void
|
||||||
{
|
{
|
||||||
$this->methods[$method . '_' . $path] = $handler;
|
$this->methods[$method . '_' . $path] = $handler;
|
||||||
$middlewares = $this->registerMiddleware($handler->getClass(), $handler->getMethod());
|
$handler->setMiddlewares($this->registerMiddleware($handler->getClass(), $handler->getMethod()));
|
||||||
if (count($middlewares) > 0) {
|
|
||||||
$handler->setMiddlewares($middlewares);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -247,9 +244,6 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var_dump($class.'::'.$method. '(' . json_encode($response, JSON_UNESCAPED_UNICODE) . ')');
|
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user