Skip to content

Commit b020249

Browse files
wouterjfabpot
authored andcommitted
Do not override correct triggering file for return type deprecations
1 parent e9c0548 commit b020249

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DeprecationErrorHandler/Deprecation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct($message, array $trace, $file)
8787
$this->getOriginalFilesStack();
8888
array_splice($this->originalFilesStack, 0, $j, [$this->triggeringFile]);
8989

90-
if (preg_match('/(?|"([^"]++)" that is deprecated|should implement method "(?:static )?([^:]++))/', $message, $m) || preg_match('/^(?:The|Method) "([^":]++)/', $message, $m)) {
90+
if (preg_match('/(?|"([^"]++)" that is deprecated|should implement method "(?:static )?([^:]++))/', $message, $m) || (false === strpos($message, 'native return type declaration') && preg_match('/^(?:The|Method) "([^":]++)/', $message, $m))) {
9191
$this->triggeringFile = (new \ReflectionClass($m[1]))->getFileName();
9292
array_unshift($this->originalFilesStack, $this->triggeringFile);
9393
}

0 commit comments

Comments
 (0)