Hook에 Closure를 리스너로 등록할 수 있도록 개선

This commit is contained in:
kkigomi
2023-06-26 22:34:49 +09:00
committed by GitHub
parent 4eba618a82
commit 81792d2595

View File

@ -19,7 +19,7 @@ Class GML_Hook extends Hook {
$args = $this->getArguments($argsNumber, $args);
if (! ($class && $method) && function_exists($function)) {
if (! ($class && $method) && is_callable($function)) {
return call_user_func_array($function, $args);
} elseif ($obj = call_user_func(array($class, $this->singleton))) {
if ($obj !== false) {
@ -161,4 +161,4 @@ Class GML_Hook extends Hook {
}
}
// end Hook Class;
// end Hook Class;