改名
This commit is contained in:
@@ -37,7 +37,7 @@ use Snowflake\Event as SEvent;
|
|||||||
public function execute(mixed $class, mixed $method = null): bool
|
public function execute(mixed $class, mixed $method = null): bool
|
||||||
{
|
{
|
||||||
// TODO: Implement execute() method.
|
// TODO: Implement execute() method.
|
||||||
SEvent::on($this->name, [$class, $method], $this->params);
|
SEvent::on($this->name, [$class, $method]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,22 +197,22 @@ abstract class BaseApplication extends Service
|
|||||||
private function addEvent($key, $value): void
|
private function addEvent($key, $value): void
|
||||||
{
|
{
|
||||||
if ($value instanceof \Closure) {
|
if ($value instanceof \Closure) {
|
||||||
Event::on($key, $value, [], true);
|
Event::on($key, $value, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (is_object($value)) {
|
if (is_object($value)) {
|
||||||
Event::on($key, $value, [], true);
|
Event::on($key, $value, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
if (is_object($value[0]) && !($value[0] instanceof \Closure)) {
|
if (is_object($value[0]) && !($value[0] instanceof \Closure)) {
|
||||||
Event::on($key, $value, [], true);
|
Event::on($key, $value, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_string($value[0])) {
|
if (is_string($value[0])) {
|
||||||
$value[0] = Snowflake::createObject($value[0]);
|
$value[0] = Snowflake::createObject($value[0]);
|
||||||
Event::on($key, $value, [], true);
|
Event::on($key, $value, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ abstract class BaseApplication extends Service
|
|||||||
if (!is_callable($item, true)) {
|
if (!is_callable($item, true)) {
|
||||||
throw new InitException("Class does not hav callback.");
|
throw new InitException("Class does not hav callback.");
|
||||||
}
|
}
|
||||||
Event::on($key, $item, [], true);
|
Event::on($key, $item, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user