fix reported class when deprecated method is static

This commit is contained in:
Christian Flothmann 2021-03-23 21:33:06 +01:00
parent 1665555dd5
commit aa80df609f

View File

@ -79,7 +79,7 @@ class Deprecation
$this->getOriginalFilesStack();
array_splice($this->originalFilesStack, 0, $j, [$this->triggeringFile]);
if (preg_match('/(?|"([^"]++)" that is deprecated|should implement method "([^:]++))/', $message, $m) || preg_match('/^(?:The|Method) "([^":]++)/', $message, $m)) {
if (preg_match('/(?|"([^"]++)" that is deprecated|should implement method "(?:static )?([^:]++))/', $message, $m) || preg_match('/^(?:The|Method) "([^":]++)/', $message, $m)) {
$this->triggeringFile = (new \ReflectionClass($m[1]))->getFileName();
array_unshift($this->originalFilesStack, $this->triggeringFile);
}