From 1f3dc4e142aa1733816d670b25a83a27c818be95 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 01:52:49 +0100 Subject: [PATCH 01/11] Updated to PHP 8.1 [ci skip] --- .travis.yml | 4 +++- README.md | 2 +- composer.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8fed667..b56904d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +dist: bionic + cache: apt: true directories: @@ -6,7 +8,7 @@ cache: language: php php: - - 8.0.0 + - 8.1.0 env: - XDEBUG_MODE=coverage diff --git a/README.md b/README.md index f211b9a..6653165 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Whoops error handler middleware to handle application or middleware specific err $ composer require "designcise/bitframe-whoops" ``` -Please note that this package requires PHP 8.0 or newer. +Please note that this package requires PHP 8.1.0 or newer. ## Quickstart diff --git a/composer.json b/composer.json index e938d38..9f408ce 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=8.0", + "php": ">=8.1", "filp/whoops": "~2.7", "psr/http-factory": "~1.0", "psr/http-server-handler": "~1.0", From 90cccf599784c28c8364a2b88c6064f9e027e119 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 01:58:29 +0100 Subject: [PATCH 02/11] Refactoring --- src/ErrorHandler.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index caac548..dcd6f36 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -31,17 +31,12 @@ class ErrorHandler implements MiddlewareInterface use HandlerOptionsAwareTrait; /** @var int */ - private const STATUS_INTERNAL_SERVER_ERROR = 500; + final private const STATUS_INTERNAL_SERVER_ERROR = 500; private SystemFacade $system; private RunInterface $whoops; - private ResponseFactoryInterface $responseFactory; - - /** @var ProviderInterface|string */ - private $handlerProvider; - private array $options; private bool $catchGlobalErrors; @@ -50,7 +45,7 @@ class ErrorHandler implements MiddlewareInterface public static function fromNegotiator( ResponseFactoryInterface $responseFactory, - array $options = [] + array $options = [], ): self { return new self( $responseFactory, @@ -65,13 +60,10 @@ public static function fromNegotiator( * @param array $options */ public function __construct( - ResponseFactoryInterface $responseFactory, - $handlerProvider = HandlerProviderNegotiator::class, - array $options = [] + private ResponseFactoryInterface $responseFactory, + private ProviderInterface|string $handlerProvider = HandlerProviderNegotiator::class, + array $options = [], ) { - $this->responseFactory = $responseFactory; - $this->handlerProvider = $handlerProvider; - if (! is_a($this->handlerProvider, ProviderInterface::class, true)) { throw new InvalidArgumentException( 'Handler provider must be instance of ' . ProviderInterface::class @@ -91,7 +83,7 @@ public function __construct( */ public function process( ServerRequestInterface $request, - RequestHandlerInterface $handler + RequestHandlerInterface $handler, ): ResponseInterface { $this->whoops->allowQuit(false); $this->whoops->writeToOutput($this->catchGlobalErrors); @@ -131,7 +123,6 @@ public function handleException(Throwable $exception): string $this->system->startOutputBuffering(); - $handlerResponse = null; $handlerContentType = null; $handlerStack = array_reverse($this->whoops->getHandlers()); @@ -147,7 +138,7 @@ public function handleException(Throwable $exception): string ? $handler->contentType() : null; - if (in_array($handlerResponse, [Handler::LAST_HANDLER, Handler::QUIT])) { + if (in_array($handlerResponse, [Handler::LAST_HANDLER, Handler::QUIT], true)) { break; } } @@ -156,7 +147,7 @@ public function handleException(Throwable $exception): string } if ($this->whoops->writeToOutput()) { - if (Misc::canSendHeaders() && $handlerContentType) { + if ($handlerContentType && Misc::canSendHeaders()) { header("Content-Type: {$handlerContentType}", true, $this->getStatusCode()); } From d6608c36b4cef3ead904d0386d8ac919ca7af2cd Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:00:48 +0100 Subject: [PATCH 03/11] Refactoring --- src/Handler/JsonpResponseHandler.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Handler/JsonpResponseHandler.php b/src/Handler/JsonpResponseHandler.php index 05ffe50..d34ad1a 100644 --- a/src/Handler/JsonpResponseHandler.php +++ b/src/Handler/JsonpResponseHandler.php @@ -51,20 +51,13 @@ class JsonpResponseHandler extends Handler private bool $jsonApi = false; - private string $callback; - - private int $encodingOptions; - public function __construct( - string $callback, - int $encodingOptions = self::DEFAULT_ENCODING, + private string $callback, + private int $encodingOptions = self::DEFAULT_ENCODING, ) { if (! $this->isCallbackValid($callback)) { throw new InvalidArgumentException('Callback name is invalid'); } - - $this->callback = $callback; - $this->encodingOptions = $encodingOptions; } public function addTraceToOutput(bool $returnFrames): self From ce0dac9f0c6ce7d48bfb24dbdef155abd53a0f31 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:02:03 +0100 Subject: [PATCH 04/11] Updated dependency --- src/Provider/HandlerProviderNegotiator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Provider/HandlerProviderNegotiator.php b/src/Provider/HandlerProviderNegotiator.php index 3471d44..c111b7f 100644 --- a/src/Provider/HandlerProviderNegotiator.php +++ b/src/Provider/HandlerProviderNegotiator.php @@ -19,7 +19,7 @@ use function is_a; use function asort; use function array_key_last; -use function strpos; +use function str_contains; /** * Detect any of the supported preferred formats from an From a291aaac30d58c5dff1620e05112945bd4236c27 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:02:57 +0100 Subject: [PATCH 05/11] Added final to consts --- src/Provider/HandlerProviderNegotiator.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Provider/HandlerProviderNegotiator.php b/src/Provider/HandlerProviderNegotiator.php index c111b7f..d07a820 100644 --- a/src/Provider/HandlerProviderNegotiator.php +++ b/src/Provider/HandlerProviderNegotiator.php @@ -28,19 +28,19 @@ class HandlerProviderNegotiator implements ProviderInterface { /** @var string */ - public const HTML = 'html'; + final public const HTML = 'html'; /** @var string */ - public const JSON = 'json'; + final public const JSON = 'json'; /** @var string */ - public const JSONP = 'jsonp'; + final public const JSONP = 'jsonp'; /** @var string */ - public const TEXT = 'text'; + final public const TEXT = 'text'; /** @var string */ - public const XML = 'xml'; + final public const XML = 'xml'; private array $handlerProviders = [ self::HTML => HtmlHandlerProvider::class, From 3cc85851dc0eff701ba25c354d69c9b21fa3caf6 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:05:42 +0100 Subject: [PATCH 06/11] Removed redundant comment --- src/ErrorHandler.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index dcd6f36..ecd0597 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -54,11 +54,6 @@ public static function fromNegotiator( ); } - /** - * @param ResponseFactoryInterface $responseFactory - * @param string|ProviderInterface $handlerProvider - * @param array $options - */ public function __construct( private ResponseFactoryInterface $responseFactory, private ProviderInterface|string $handlerProvider = HandlerProviderNegotiator::class, From f8167e9387fac114c63457334cd17a1ac115c9ac Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:07:31 +0100 Subject: [PATCH 07/11] Updated copyright info [ci skip] --- LICENSE.md | 2 +- src/ErrorHandler.php | 2 +- src/Handler/JsonpResponseHandler.php | 2 +- src/HandlerOptionsAwareTrait.php | 2 +- src/Provider/HandlerProviderNegotiator.php | 2 +- src/Provider/HtmlHandlerProvider.php | 2 +- src/Provider/JsonHandlerProvider.php | 2 +- src/Provider/JsonpHandlerProvider.php | 2 +- src/Provider/ProviderInterface.php | 2 +- src/Provider/TextHandlerProvider.php | 2 +- src/Provider/XmlHandlerProvider.php | 2 +- test/Asset/MiddlewareDecoratorTrait.php | 2 +- test/Asset/MiddlewareHandler.php | 2 +- test/ErrorHandlerTest.php | 2 +- test/Handler/JsonpResponseHandlerTest.php | 2 +- test/Provider/HandlerProviderNegotiatorTest.php | 2 +- test/Provider/HtmlHandlerProviderTest.php | 2 +- test/Provider/JsonHandlerProviderTest.php | 2 +- test/Provider/JsonpHandlerProviderTest.php | 2 +- test/Provider/TextHandlerProviderTest.php | 2 +- test/Provider/XmlHandlerProviderTest.php | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 21a2cf3..c0aae9a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -5,7 +5,7 @@ Portions of the "BitFrame Whoops Middleware" incorporates the work by (as provid All other copyright for the "BitFrame Whoops Middleware" are held by: -* Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) +* Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index ecd0597..4244e7b 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/Handler/JsonpResponseHandler.php b/src/Handler/JsonpResponseHandler.php index d34ad1a..bd3ac7a 100644 --- a/src/Handler/JsonpResponseHandler.php +++ b/src/Handler/JsonpResponseHandler.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/HandlerOptionsAwareTrait.php b/src/HandlerOptionsAwareTrait.php index a5c35e8..4843e7a 100644 --- a/src/HandlerOptionsAwareTrait.php +++ b/src/HandlerOptionsAwareTrait.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/Provider/HandlerProviderNegotiator.php b/src/Provider/HandlerProviderNegotiator.php index d07a820..9f99c11 100644 --- a/src/Provider/HandlerProviderNegotiator.php +++ b/src/Provider/HandlerProviderNegotiator.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/Provider/HtmlHandlerProvider.php b/src/Provider/HtmlHandlerProvider.php index cdf0819..18efd99 100644 --- a/src/Provider/HtmlHandlerProvider.php +++ b/src/Provider/HtmlHandlerProvider.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/Provider/JsonHandlerProvider.php b/src/Provider/JsonHandlerProvider.php index 9643ccc..116c64c 100644 --- a/src/Provider/JsonHandlerProvider.php +++ b/src/Provider/JsonHandlerProvider.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/Provider/JsonpHandlerProvider.php b/src/Provider/JsonpHandlerProvider.php index db01703..d99e3a2 100644 --- a/src/Provider/JsonpHandlerProvider.php +++ b/src/Provider/JsonpHandlerProvider.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/Provider/ProviderInterface.php b/src/Provider/ProviderInterface.php index b76c3a8..94c5154 100644 --- a/src/Provider/ProviderInterface.php +++ b/src/Provider/ProviderInterface.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/Provider/TextHandlerProvider.php b/src/Provider/TextHandlerProvider.php index 29d5830..4e1fa89 100644 --- a/src/Provider/TextHandlerProvider.php +++ b/src/Provider/TextHandlerProvider.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/src/Provider/XmlHandlerProvider.php b/src/Provider/XmlHandlerProvider.php index 38b3a29..ba994f1 100644 --- a/src/Provider/XmlHandlerProvider.php +++ b/src/Provider/XmlHandlerProvider.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Asset/MiddlewareDecoratorTrait.php b/test/Asset/MiddlewareDecoratorTrait.php index 81ca6b6..007fb88 100644 --- a/test/Asset/MiddlewareDecoratorTrait.php +++ b/test/Asset/MiddlewareDecoratorTrait.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Asset/MiddlewareHandler.php b/test/Asset/MiddlewareHandler.php index 45c0091..9f781e5 100644 --- a/test/Asset/MiddlewareHandler.php +++ b/test/Asset/MiddlewareHandler.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/ErrorHandlerTest.php b/test/ErrorHandlerTest.php index e9e955f..bcdece4 100644 --- a/test/ErrorHandlerTest.php +++ b/test/ErrorHandlerTest.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Handler/JsonpResponseHandlerTest.php b/test/Handler/JsonpResponseHandlerTest.php index 5e15153..bf814a2 100644 --- a/test/Handler/JsonpResponseHandlerTest.php +++ b/test/Handler/JsonpResponseHandlerTest.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Provider/HandlerProviderNegotiatorTest.php b/test/Provider/HandlerProviderNegotiatorTest.php index 3b85698..88a5fd4 100644 --- a/test/Provider/HandlerProviderNegotiatorTest.php +++ b/test/Provider/HandlerProviderNegotiatorTest.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Provider/HtmlHandlerProviderTest.php b/test/Provider/HtmlHandlerProviderTest.php index 2cbc671..a06a25a 100644 --- a/test/Provider/HtmlHandlerProviderTest.php +++ b/test/Provider/HtmlHandlerProviderTest.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Provider/JsonHandlerProviderTest.php b/test/Provider/JsonHandlerProviderTest.php index ffd6b68..ccb853f 100644 --- a/test/Provider/JsonHandlerProviderTest.php +++ b/test/Provider/JsonHandlerProviderTest.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Provider/JsonpHandlerProviderTest.php b/test/Provider/JsonpHandlerProviderTest.php index 5b32d7f..0f8f982 100644 --- a/test/Provider/JsonpHandlerProviderTest.php +++ b/test/Provider/JsonpHandlerProviderTest.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Provider/TextHandlerProviderTest.php b/test/Provider/TextHandlerProviderTest.php index d602162..11d9b6d 100644 --- a/test/Provider/TextHandlerProviderTest.php +++ b/test/Provider/TextHandlerProviderTest.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ diff --git a/test/Provider/XmlHandlerProviderTest.php b/test/Provider/XmlHandlerProviderTest.php index 235b35d..2197bb1 100644 --- a/test/Provider/XmlHandlerProviderTest.php +++ b/test/Provider/XmlHandlerProviderTest.php @@ -4,7 +4,7 @@ * BitFrame Framework (https://www.bitframephp.com) * * @author Daniyal Hamid - * @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com) + * @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com) * @license https://bitframephp.com/about/license MIT License */ From 8652861d8774acd5226d863696cfcdff31f31543 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:08:34 +0100 Subject: [PATCH 08/11] Fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6653165..8763052 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ For example, to handle middleware-specific errors with `BitFrame\App` (or other use BitFrame\App; use BitFrame\Emitter\SapiEmitter; use BitFrame\Whoops\ErrorHandler; -use \BitFrame\Whoops\Provider\HandlerProviderNegotiator; +use BitFrame\Whoops\Provider\HandlerProviderNegotiator; use BitFrame\Factory\HttpFactory; $app = new App(); From 6c4be174bb920804066b69b43d54e65ce84b7de0 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:11:47 +0100 Subject: [PATCH 09/11] Removed redundant final --- src/ErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index 4244e7b..000f591 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -31,7 +31,7 @@ class ErrorHandler implements MiddlewareInterface use HandlerOptionsAwareTrait; /** @var int */ - final private const STATUS_INTERNAL_SERVER_ERROR = 500; + private const STATUS_INTERNAL_SERVER_ERROR = 500; private SystemFacade $system; From 0503db45778c7e4aee54c22d1cc603feb3841268 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:14:38 +0100 Subject: [PATCH 10/11] Removed redundant docblock --- src/Handler/JsonpResponseHandler.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Handler/JsonpResponseHandler.php b/src/Handler/JsonpResponseHandler.php index bd3ac7a..b2ebd22 100644 --- a/src/Handler/JsonpResponseHandler.php +++ b/src/Handler/JsonpResponseHandler.php @@ -66,9 +66,6 @@ public function addTraceToOutput(bool $returnFrames): self return $this; } - /** - * @return int - */ public function handle(): int { $error = Formatter::formatExceptionAsDataArray( From 2fbed789406f50c3383dbf964ac08cdc866e56e6 Mon Sep 17 00:00:00 2001 From: Daniyal Hamid Date: Sun, 2 Jan 2022 02:21:29 +0100 Subject: [PATCH 11/11] Bumped up package version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9f408ce..04a9306 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": ">=8.1", - "filp/whoops": "~2.7", + "filp/whoops": "~2.14", "psr/http-factory": "~1.0", "psr/http-server-handler": "~1.0", "psr/http-server-middleware": "~1.0"