Skip to content

Commit 7c629fd

Browse files
Merge branch '6.4' into 7.0
* 6.4: [PhpUnitBridge] Fix classifying doctrine/deprecations as direct/indirect [PhpUnitBridge] Add missing line in changelog [Serializer] Fix ignoring objects that only implement DenormalizableInterface
2 parents e43c8d4 + b30f308 commit 7c629fd

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Add support for mocking the `enum_exists` function
8+
* Enable reporting of deprecations triggered by Doctrine by default
89

910
6.2
1011
---

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)