Skip to content

Commit

Permalink
Remove symfony/debug dependency (#1321)
Browse files Browse the repository at this point in the history
* Migrate from symfony/debug to symfony/error-handler

* Fix wrong version constraints

* Remove Laravel 6 Support

* Remove lumen 6 from test matrix

* Remove symfony/error-handler
  • Loading branch information
Jubeki authored Jul 11, 2022
1 parent 814b36a commit 3372ed6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ jobs:
strategy:
matrix:
php: [8.0, 7.4, 7.3, 7.2]
lumen: [8.*, 7.*, 6.*]
lumen: [8.*, 7.*]
exclude:
- lumen: 8.*
php: 7.2
- lumen: 7.*
php: 8.0
- lumen: 6.*
php: 8.0
name: P${{ matrix.php }} - Lumen${{ matrix.lumen }}
steps:
- name: Checkout code
Expand Down Expand Up @@ -69,7 +67,7 @@ jobs:
strategy:
matrix:
php: [8.0, 7.4, 7.3, 7.2]
laravel: [8.*, 7.*, 6.*]
laravel: [8.*, 7.*]
exclude:
- laravel: 8.*
php: 7.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
php: [8.0, 7.4, 7.3, 7.2]
laravel: [9.*, 8.*, 6.*, 7.*]
laravel: [9.*, 8.*, 7.*]
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- laravel: 8.*
Expand Down
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
}
],
"require": {
"php": ">=7.2",
"php": ">=7.2.5",
"maximebf/debugbar": "^1.17.2",
"illuminate/routing": "^6|^7|^8|^9",
"illuminate/session": "^6|^7|^8|^9",
"illuminate/support": "^6|^7|^8|^9",
"symfony/debug": "^4.3|^5|^6",
"symfony/finder": "^4.3|^5|^6"
"illuminate/routing": "^7|^8|^9",
"illuminate/session": "^7|^8|^9",
"illuminate/support": "^7|^8|^9",
"symfony/finder": "^5|^6"
},
"require-dev": {
"mockery/mockery": "^1.3.3",
"orchestra/testbench-dusk": "^4|^5|^6|^7",
"orchestra/testbench-dusk": "^5|^6|^7",
"phpunit/phpunit": "^8.5|^9.0",
"squizlabs/php_codesniffer": "^3.5"
},
Expand Down
12 changes: 4 additions & 8 deletions src/Middleware/InjectDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Barryvdh\Debugbar\Middleware;

use Error;
use Closure;
use Exception;
use Illuminate\Http\Request;
use Barryvdh\Debugbar\LaravelDebugbar;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Throwable;

class InjectDebugbar
{
Expand Down Expand Up @@ -65,10 +64,7 @@ public function handle($request, Closure $next)
try {
/** @var \Illuminate\Http\Response $response */
$response = $next($request);
} catch (Exception $e) {
$response = $this->handleException($request, $e);
} catch (Error $error) {
$e = new FatalThrowableError($error);
} catch (Throwable $e) {
$response = $this->handleException($request, $e);
}

Expand All @@ -84,11 +80,11 @@ public function handle($request, Closure $next)
* (Copy from Illuminate\Routing\Pipeline by Taylor Otwell)
*
* @param $passable
* @param Exception $e
* @param Throwable $e
* @return mixed
* @throws Exception
*/
protected function handleException($passable, Exception $e)
protected function handleException($passable, $e)
{
if (! $this->container->bound(ExceptionHandler::class) || ! $passable instanceof Request) {
throw $e;
Expand Down

0 comments on commit 3372ed6

Please sign in to comment.