改名
This commit is contained in:
@@ -63,8 +63,6 @@ use Snowflake\Snowflake;
|
|||||||
|
|
||||||
$method = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri);
|
$method = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri);
|
||||||
|
|
||||||
var_dump($method);
|
|
||||||
|
|
||||||
$node = $router->addRoute($method, $handler, 'sw::socket');
|
$node = $router->addRoute($method, $handler, 'sw::socket');
|
||||||
|
|
||||||
return $this->add($node);
|
return $this->add($node);
|
||||||
|
|||||||
@@ -58,17 +58,18 @@ class Node extends Application
|
|||||||
* @return Node
|
* @return Node
|
||||||
* @throws
|
* @throws
|
||||||
*/
|
*/
|
||||||
public function bindHandler($handler)
|
public function bindHandler($handler): static
|
||||||
{
|
{
|
||||||
if ($handler instanceof Closure) {
|
if ($handler instanceof Closure) {
|
||||||
$this->handler = $handler;
|
$this->handler = $handler;
|
||||||
} else if (is_string($handler) && strpos($handler, '@') !== false) {
|
} else if (is_string($handler) && str_contains($handler, '@')) {
|
||||||
list($controller, $action) = explode('@', $handler);
|
list($controller, $action) = explode('@', $handler);
|
||||||
if (!empty($this->namespace)) {
|
if (!empty($this->namespace)) {
|
||||||
$controller = implode('\\', $this->namespace) . '\\' . $controller;
|
$controller = implode('\\', $this->namespace) . '\\' . $controller;
|
||||||
}
|
}
|
||||||
$this->handler = $this->getReflect($controller, $action);
|
$this->handler = $this->getReflect($controller, $action);
|
||||||
} else if ($handler != null && !is_callable($handler, true)) {
|
} else if ($handler != null && !is_callable($handler, true)) {
|
||||||
|
var_dump($handler);
|
||||||
$this->_error = 'Controller is con\'t exec.';
|
$this->_error = 'Controller is con\'t exec.';
|
||||||
} else {
|
} else {
|
||||||
$this->handler = $handler;
|
$this->handler = $handler;
|
||||||
|
|||||||
@@ -471,7 +471,6 @@ class Server extends Application
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach ($aliases as $alias) {
|
foreach ($aliases as $alias) {
|
||||||
var_dump($alias);
|
|
||||||
$handler = $alias['handler'];
|
$handler = $alias['handler'];
|
||||||
foreach ($alias['attributes'] as $key => $attribute) {
|
foreach ($alias['attributes'] as $key => $attribute) {
|
||||||
if ($attribute instanceof IAnnotation) {
|
if ($attribute instanceof IAnnotation) {
|
||||||
|
|||||||
Reference in New Issue
Block a user