Skip to content

Commit

Permalink
bug #36867 [PhpUnitBridge] fix bad detection of unsilenced deprecatio…
Browse files Browse the repository at this point in the history
…ns (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix bad detection of unsilenced deprecations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

9d5bb11 [PhpUnitBridge] fix bad detection of unsilenced deprecations
  • Loading branch information
fabpot committed May 19, 2020
2 parents 7ee33f9 + 9d5bb11 commit 8e428ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
Expand Up @@ -140,7 +140,7 @@ public static function register($mode = 0)

$Test = $UtilPrefix.'Test';

if (0 !== error_reporting()) {
if (error_reporting() & $type) {
$group = 'unsilenced';
} elseif (0 === strpos($method, 'testLegacy')
|| 0 === strpos($method, 'provideLegacy')
Expand Down Expand Up @@ -292,7 +292,7 @@ public static function collectDeprecations($outputFile)

return \call_user_func(DeprecationErrorHandler::getPhpUnitErrorHandler(), $type, $msg, $file, $line, $context);
}
$deprecations[] = array(error_reporting(), $msg, $file);
$deprecations[] = array(error_reporting() & $type, $msg, $file);

return null;
});
Expand Down
Expand Up @@ -352,7 +352,7 @@ public function handleError($type, $msg, $file, $line, $context = array())
if (\is_array($parsedMsg)) {
$msg = $parsedMsg['deprecation'];
}
if (error_reporting()) {
if (error_reporting() & $type) {
$msg = 'Unsilenced deprecation: '.$msg;
}
$this->gatheredDeprecations[] = $msg;
Expand Down

0 comments on commit 8e428ed

Please sign in to comment.