8000 Merge branch '4.0' · symfony/symfony@ebf3f0e · GitHub
[go: up one dir, main page]

Skip to content

Commit ebf3f0e

Browse files
Merge branch '4.0'
* 4.0: [Bridge/PhpUnit] Fix BC/FC of serialized deprecations
2 parents d275178 + 4900d80 commit ebf3f0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static function register($mode = 0)
125125
// \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait::endTest()
126126
// then we need to use the serialized information to determine
127127
// if the error has been triggered from vendor code.
128-
$isWeak = DeprecationErrorHandler::MODE_WEAK === $mode || (DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $isVendor = $inVendors($parsedMsg['triggering_file']));
128+
$isWeak = DeprecationErrorHandler::MODE_WEAK === $mode || (DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $isVendor = isset($parsedMsg['triggering_file']) && $inVendors($parsedMsg['triggering_file']));
129129
} else {
130130
$class = isset($trace[$i]['object']) ? get_class($trace[$i]['object']) : $trace[$i]['class'];
131131
$method = $trace[$i]['function'];

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function endTest($test, $time)
263263
unlink($this->runsInSeparateProcess);
264264
putenv('SYMFONY_DEPRECATIONS_SERIALIZE');
265265
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
266-
$error = serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => $deprecation[2]));
266+
$error = serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null));
267267
if ($deprecation[0]) {
268268
trigger_error($error, E_USER_DEPRECATED);
269269
} else {

0 commit comments

Comments
 (0)
0