Skip to content

Commit

Permalink
Suppress warning in case unserialize() does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 21, 2019
1 parent db1dce3 commit a3c6192
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Runner/DefaultTestResultCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,21 @@ public function load(): void
}
// @codeCoverageIgnoreEnd

\set_error_handler(
function ($errorNumber, $errorString)
{
if ($errorNumber === \E_WARNING) {
return;
}

return false;
}
);

$cache = @\unserialize($cacheData, ['allowed_classes' => [self::class]]);

\restore_error_handler();

if ($cache === false) {
return;
}
Expand Down

0 comments on commit a3c6192

Please sign in to comment.