Skip to content

Commit 91b61a5

Browse files
jamiehdbarryvdh
authored andcommitted
Change php7 errors to exception to maintain compatability with function declaration php-debugbar#264 (php-debugbar#279)
1 parent 41d982b commit 91b61a5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"require": {
2020
"php": ">=5.3.0",
2121
"psr/log": "^1.0",
22-
"symfony/var-dumper": "^2.6|^3.0"
22+
"symfony/var-dumper": "^2.6|^3.0",
23+
"symfony/debug": "^2.6|^3.0"
2324
},
2425
"require-dev": {
2526
"phpunit/phpunit": "^4.0|^5.0"

src/DebugBar/DataCollector/ExceptionsCollector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
namespace DebugBar\DataCollector;
1212

13+
use Error;
1314
use Exception;
15+
use Symfony\Component\Debug\Exception\FatalThrowableError;
1416

1517
/**
1618
* Collects info about exceptions
@@ -29,6 +31,9 @@ public function addException(Exception $e)
2931
{
3032
$this->exceptions[] = $e;
3133
if ($this->chainExceptions && $previous = $e->getPrevious()) {
34+
if ($previous instanceof Error) {
35+
$previous = new FatalThrowableError($previous);
36+
}
3237
$this->addException($previous);
3338
}
3439
}

0 commit comments

Comments
 (0)