This commit is contained in:
2020-12-15 17:12:21 +08:00
parent 2ad462ee2d
commit 357093fa45
3 changed files with 3 additions and 5 deletions
-2
View File
@@ -63,8 +63,6 @@ use Snowflake\Snowflake;
$method = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri);
var_dump($method);
$node = $router->addRoute($method, $handler, 'sw::socket');
return $this->add($node);
+3 -2
View File
@@ -58,17 +58,18 @@ class Node extends Application
* @return Node
* @throws
*/
public function bindHandler($handler)
public function bindHandler($handler): static
{
if ($handler instanceof Closure) {
$this->handler = $handler;
} else if (is_string($handler) && strpos($handler, '@') !== false) {
} else if (is_string($handler) && str_contains($handler, '@')) {
list($controller, $action) = explode('@', $handler);
if (!empty($this->namespace)) {
$controller = implode('\\', $this->namespace) . '\\' . $controller;
}
$this->handler = $this->getReflect($controller, $action);
} else if ($handler != null && !is_callable($handler, true)) {
var_dump($handler);
$this->_error = 'Controller is con\'t exec.';
} else {
$this->handler = $handler;
-1
View File
@@ -471,7 +471,6 @@ class Server extends Application
return;
}
foreach ($aliases as $alias) {
var_dump($alias);
$handler = $alias['handler'];
foreach ($alias['attributes'] as $key => $attribute) {
if ($attribute instanceof IAnnotation) {