Skip to content

Commit

Permalink
Replace symfony/debug with symfony/error-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceKLWilliams committed Mar 20, 2024
1 parent 948675b commit 7392ef0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"timber/timber": "^1.24.0",
"monolog/monolog": "^2.9.1",
"http-interop/response-sender": "^1.0",
"symfony/debug": "^4.4.44",
"illuminate/collections": "^8.53.1||^9.52.16",
"statamic/stringy": "^3.1.3",
"laminas/laminas-diactoros": "^2.25.2",
Expand All @@ -23,7 +22,8 @@
"mindplay/middleman": "^3.1.0",
"psr/log": "^1.1.4",
"laminas/laminas-zendframework-bridge": "^1.7",
"symfony/var-dumper": "^5.0||^6.3.6"
"symfony/var-dumper": "^5.0||^6.3.6",
"symfony/error-handler": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^9.6.13",
Expand Down
10 changes: 4 additions & 6 deletions src/Bootstrappers/RegisterExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Exceptions\HandlerInterface;
use Rareloop\Router\Responsable;
use Symfony\Component\Debug\Exception\FatalErrorException;
use Symfony\Component\ErrorHandler\Error\FatalError;
use Zend\Diactoros\ServerRequestFactory;
use function Http\Response\send;

Expand Down Expand Up @@ -122,16 +122,14 @@ public function handleShutdown()
*
* @param array $error
* @param int|null $traceOffset
* @return \Symfony\Component\Debug\Exception\FatalErrorException
* @return \Symfony\Component\ErrorHandler\Error\FatalError
*/
protected function fatalExceptionFromError(array $error, $traceOffset = null)
{
return new FatalErrorException(
return new FatalError(
$error['message'],
$error['type'],
0,
$error['file'],
$error['line'],
$error,
$traceOffset
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Facades\Config;
use Symfony\Component\ErrorHandler\ErrorHandler as SymfonyExceptionHandler;
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Zend\Diactoros\Response\HtmlResponse;

class Handler implements HandlerInterface
Expand Down Expand Up @@ -38,7 +38,7 @@ public function render(ServerRequestInterface $request, Exception $e) : Response
{
$e = FlattenException::create($e);

$handler = new SymfonyExceptionHandler(Config::get('app.debug', false));
$handler = new SymfonyExceptionHandler(null, Config::get('app.debug', false));

return new HtmlResponse($handler->getHtml($e), $e->getStatusCode(), $e->getHeaders());
}
Expand Down
1 change: 0 additions & 1 deletion tests/Unit/Bootstrappers/RegisterExceptionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Rareloop\Lumberjack\Exceptions\HandlerInterface;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Router\Responsable;
use Symfony\Component\Debug\Exception\FatalErrorException;
use Zend\Diactoros\Response;
use Zend\Diactoros\Response\TextResponse;
use Zend\Diactoros\ServerRequest;
Expand Down

0 comments on commit 7392ef0

Please sign in to comment.