Fix deprecation when using "static" in callables (#1403)

This commit is contained in:
Nicolas Grekas
2023-09-19 18:11:21 +02:00
committed by GitHub
parent bb8cce7bcf
commit deee2b6d60
+7 -1
View File
@@ -197,7 +197,13 @@ class KeyPrefixProcessor implements ProcessorInterface
if ($command instanceof PrefixableCommandInterface) {
$command->prefixKeys($this->prefix);
} elseif (isset($this->commands[$commandID = strtoupper($command->getId())])) {
call_user_func($this->commands[$commandID], $command, $this->prefix);
$callable = $this->commands[$commandID];
if (is_string($callable) && 0 === strpos($callable, 'static::')) {
$callable = substr_replace($callable, get_class($this), 0, 6);
}
call_user_func($callable, $command, $this->prefix);
}
}