改名
This commit is contained in:
@@ -79,7 +79,9 @@ class Router extends HttpService implements RouterInterface
|
|||||||
*/
|
*/
|
||||||
public function addPortListen($port, Closure|array|string $closure, $method = null)
|
public function addPortListen($port, Closure|array|string $closure, $method = null)
|
||||||
{
|
{
|
||||||
if (is_string($closure)) {
|
if (!is_string($closure)) {
|
||||||
|
$this->addRoute('add-port-listen/port_' . $port, $closure, 'listen');
|
||||||
|
} else {
|
||||||
if (empty($method)) {
|
if (empty($method)) {
|
||||||
throw new NotFindClassException($closure . '::' . $method);
|
throw new NotFindClassException($closure . '::' . $method);
|
||||||
}
|
}
|
||||||
@@ -87,10 +89,8 @@ class Router extends HttpService implements RouterInterface
|
|||||||
if (!method_exists($_closure, $method)) {
|
if (!method_exists($_closure, $method)) {
|
||||||
throw new NotFindClassException($closure . '::' . $method);
|
throw new NotFindClassException($closure . '::' . $method);
|
||||||
}
|
}
|
||||||
|
$this->addRoute('add-port-listen/port_' . $port, [$_closure, $method], 'listen');
|
||||||
$closure = [$closure, $method];
|
|
||||||
}
|
}
|
||||||
$this->addRoute('add-port-listen/port_' . $port, $closure, 'listen');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user