From 50417fba657439ff07c04b80db44fafc868ba7db Mon Sep 17 00:00:00 2001 From: recca0120 Date: Wed, 9 Feb 2022 01:17:02 +0800 Subject: [PATCH] laravel 9 --- composer.json | 14 +++++++------- src/DebuggerManager.php | 2 +- src/Exceptions/Handler.php | 2 +- tests/Exceptions/HandlerTest.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 30d4b19..24783e2 100644 --- a/composer.json +++ b/composer.json @@ -21,19 +21,19 @@ ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "^5.1|^6.0|^7.0|^8.0", - "illuminate/database": "^5.1|^6.0|^7.0|^8.0", - "illuminate/routing": "^5.1|^6.0|^7.0|^8.0", - "illuminate/session": "^5.1|^6.0|^7.0|^8.0", - "illuminate/support": "^5.1|^6.0|^7.0|^8.0", - "illuminate/view": "^5.1|^6.0|^7.0|^8.0", + "illuminate/contracts": "^5.1|^6.0|^7.0|^8.0|^9.0", + "illuminate/database": "^5.1|^6.0|^7.0|^8.0|^9.0", + "illuminate/routing": "^5.1|^6.0|^7.0|^8.0|^9.0", + "illuminate/session": "^5.1|^6.0|^7.0|^8.0|^9.0", + "illuminate/support": "^5.1|^6.0|^7.0|^8.0|^9.0", + "illuminate/view": "^5.1|^6.0|^7.0|^8.0|^9.0", "recca0120/terminal": "^1.8", "tracy/tracy": ">=2.4,<2.9" }, "require-dev": { "mockery/mockery": "^1.0", "nesbot/carbon": "^1.20|^2.0", - "orchestra/testbench": "^2.0|^3.0|^4.18|^5.20|^6.23", + "orchestra/testbench": "^2.0|^3.0|^4.18|^5.20|^6.23|^7.0", "phpunit/phpunit": "^4.8|^5.4|^6.1|^7.0|^8.0|^9.0" }, "autoload": { diff --git a/src/DebuggerManager.php b/src/DebuggerManager.php index e8f4741..e34ef8d 100644 --- a/src/DebuggerManager.php +++ b/src/DebuggerManager.php @@ -83,7 +83,7 @@ public static function init($config = []) 'scream' => true, 'showLocation' => true, 'strictMode' => true, - 'currentTime' => $_SERVER['REQUEST_TIME_FLOAT'] ?: microtime(true), + 'currentTime' => array_key_exists('REQUEST_TIME_FLOAT', $_SERVER) ? $_SERVER['REQUEST_TIME_FLOAT'] : microtime(true), 'editorMapping' => isset(Debugger::$editorMapping) === true ? Debugger::$editorMapping : [], ], $config); diff --git a/src/Exceptions/Handler.php b/src/Exceptions/Handler.php index b9e4777..29cd90d 100644 --- a/src/Exceptions/Handler.php +++ b/src/Exceptions/Handler.php @@ -80,7 +80,7 @@ public function render($request, Throwable $e) $response = $this->exceptionHandler->render($request, $e); if ($this->shouldRenderException($response) === true) { - $_SERVER = $request->server(); + $_SERVER = (array) $request->server(); $response->setContent($this->debuggerManager->exceptionHandler($e)); } diff --git a/tests/Exceptions/HandlerTest.php b/tests/Exceptions/HandlerTest.php index 98a04ef..2c14f4f 100644 --- a/tests/Exceptions/HandlerTest.php +++ b/tests/Exceptions/HandlerTest.php @@ -162,7 +162,7 @@ public function testRender() $response = m::spy(SymfonyResponse::class); $exceptionHandler->expects('render')->with($request, $exception)->andReturns($response); - $response->expects('getContent')->andReturns(null); + $response->expects('getContent')->andReturns(''); $debuggerManager->expects('exceptionHandler')->with($exception)->andReturns($content = 'foo'); $response->expects('setContent')->with($content);