Skip to content

Commit 9217c57

Browse files
bug #50525 [PhpUnitBridge] Fix classifying doctrine/deprecations as direct/indirect (nicolas-grekas)
This PR was merged into the 6.3 branch. Discussion ---------- [PhpUnitBridge] Fix classifying doctrine/deprecations as direct/indirect | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- d2b5209 [PhpUnitBridge] Fix classifying doctrine/deprecations as direct/indirect
2 parents c7fb0fd + d2b5209 commit 9217c57

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1313

14+
use Doctrine\Deprecations\Deprecation as DoctrineDeprecation;
1415
use PHPUnit\Framework\TestCase;
1516
use PHPUnit\Framework\TestSuite;
1617
use PHPUnit\Metadata\Api\Groups;
@@ -60,9 +61,18 @@ class Deprecation
6061
*/
6162
public function __construct($message, array $trace, $file, $languageDeprecation = false)
6263
{
63-
if (isset($trace[2]['function']) && 'trigger_deprecation' === $trace[2]['function']) {
64-
$file = $trace[2]['file'];
65-
array_splice($trace, 1, 1);
64+
switch ($trace[2]['function'] ?? '') {
65+
case 'trigger_deprecation':
66+
$file = $trace[2]['file'];
67+
array_splice($trace, 1, 1);
68+
break;
69+
70+
case 'delegateTriggerToBackend':
71+
if (DoctrineDeprecation::class === ($trace[2]['class'] ?? '')) {
72+
$file = $trace[3]['file'];
73+
array_splice($trace, 1, 2);
74+
}
75+
break;
6676
}
6777

6878
$this->trace = $trace;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy