8000 bug #26794 [PhpUnitBridge] Catch deprecation error handler (cvilleger) · symfony/symfony@603f3ab · GitHub
[go: up one dir, main page]

Skip to content

Commit 603f3ab

Browse files
bug #26794 [PhpUnitBridge] Catch deprecation error handler (cvilleger)
This PR was squashed before being merged into the 3.4 branch (closes #26794). Discussion ---------- [PhpUnitBridge] Catch deprecation error handler | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26476 | License | MIT This fix `DeprecationErrorHandler` to catch deprecation triggered by `SymfonyTestListenerTrait`. `$trace[$i]['class']` points to `Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV6`, not the aliased version. The condition has been refactored to handle future version `SymfonyTestsListenerForV{x}` Commits ------- f40f181 [PhpUnitBridge] Catch deprecation error handler
2 parents 5d189e1 + f40f181 commit 603f3ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function register($mode = 0)
118118
}
119119

120120
if (isset($trace[$i]['object']) || isset($trace[$i]['class'])) {
121-
if (isset($trace[$i]['class']) && in_array($trace[$i]['class'], array('Symfony\Bridge\PhpUnit\SymfonyTestsListener', 'Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener'), true)) {
121+
if (isset($trace[$i]['class']) && 0 === strpos($trace[$i]['class'], 'Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerFor')) {
122122
$parsedMsg = unserialize($msg);
123123
$msg = $parsedMsg['deprecation'];
124124
$class = $parsedMsg['class'];
@@ -216,7 +216,7 @@ public static function register($mode = 0)
216216

217217
$groups = array('unsilenced', 'remaining');
218218
if (DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode) {
219-
$groups[] = 'remaining vendor';
219+
$groups[] = 'remaining vendor';
220220
}
221221
array_push($groups, 'legacy', 'other');
222222

0 commit comments

Comments
 (0)
0