Skip to content

Commit d64df18

Browse files
minor #43251 [PhpUnitBridge] Fix skipping triggering file override for missing return types on 5.3 (chalasr)
This PR was merged into the 5.3 branch. Discussion ---------- [PhpUnitBridge] Fix skipping triggering file override for missing return types on 5.3 | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | - | Tickets | - | License | MIT | Doc PR | - symfony/symfony#43241 was merged in 5.3 instead of 5.4, but the deprecation notice was reworded on 5.4: symfony/symfony#42935. Commits ------- c1034dc940 [PHPUnitBridge] Fix skipping triggering file override on 5.3
2 parents 5afa7c4 + 4628107 commit d64df18

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) || (false === strpos($message, 'native return type declaration') && preg_match('/^(?:The|Method) "([^":]++)/', $message, $m))) {
90+
if (preg_match('/(?|"([^"]++)" that is deprecated|should implement method "(?:static )?([^:]++))/', $message, $m) || (false === strpos($message, '()" will return') && 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)