Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ec23ffa

Browse filesBrowse files
[PhpUnitBridge] fix reporting deprecations from DebugClassLoader
1 parent a78fb18 commit ec23ffa
Copy full SHA for ec23ffa

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,14 @@ public function __construct($message, array $trace, $file)
7373
if ('trigger_error' === $trace[$j]['function'] && !isset($trace[$j]['class'])) {
7474
if (\in_array($trace[1 + $j]['class'], [DebugClassLoader::class, LegacyDebugClassLoader::class], true)) {
7575
$class = $trace[1 + $j]['args'][0];
76-
$this->triggeringFile = isset($trace[1 + $j]['args'][1]) ? realpath($trace[1 + $j]['args'][1]) : (new \ReflectionClass($class))->getFileName();
76+
$this->triggeringFile = (new \ReflectionClass($class))->getFileName();
7777
$this->getOriginalFilesStack();
7878
array_splice($this->originalFilesStack, 0, $j, [$this->triggeringFile]);
79+
80+
if (preg_match('/(?|"([^"]++)" that is deprecated|should implement method "([^:]++))/', $message, $m) || preg_match('/^(?:The|Method) "([^":]++)/', $message, $m)) {
81+
$this->triggeringFile = (new \ReflectionClass($m[1]))->getFileName();
82+
array_unshift($this->originalFilesStack, $this->triggeringFile);
83+
}
7984
}
8085

8186
break;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.