diff --git a/.laminas-ci.json b/.laminas-ci.json new file mode 100644 index 0000000..82cd446 --- /dev/null +++ b/.laminas-ci.json @@ -0,0 +1,6 @@ +{ + "ignore_php_platform_requirements": { + "8.4": true + }, + "backwardCompatibilityCheck": true +} diff --git a/README.md b/README.md index 9b1a63e..3b9bfea 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,18 @@ # dot-errorhandler -Error Logging Handler for DotKernel +Error Logging Handler for Dotkernel ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-errorhandler) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/4.0.0) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/4.1.0) [![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-errorhandler/issues) [![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-errorhandler/network) [![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-errorhandler/stargazers) -[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-errorhandler/blob/3.0/LICENSE) +[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-errorhandler/blob/4.0/LICENSE) [![Build Static](https://github.com/dotkernel/dot-errorhandler/actions/workflows/continuous-integration.yml/badge.svg?branch=4.0)](https://github.com/dotkernel/dot-errorhandler/actions/workflows/continuous-integration.yml) [![codecov](https://codecov.io/gh/dotkernel/dot-errorhandler/branch/4.0/graph/badge.svg?token=0KIJARS5RS)](https://codecov.io/gh/dotkernel/dot-errorhandler) -[![SymfonyInsight](https://insight.symfony.com/projects/cf1f8d89-f230-4157-bc8b-7cce20c75454/big.svg)](https://insight.symfony.com/projects/cf1f8d89-f230-4157-bc8b-7cce20c75454) - ## Adding the error handler - Add the composer package: diff --git a/composer.json b/composer.json index 854cc32..a59a04e 100644 --- a/composer.json +++ b/composer.json @@ -26,8 +26,8 @@ } }, "require": { - "php": "~8.2.0 || ~8.3.0", - "dotkernel/dot-log": "^4.0.2", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", + "dotkernel/dot-log": "^4.1.0", "laminas/laminas-diactoros": "^3.3", "laminas/laminas-stratigility": "^3.11", "mezzio/mezzio": "^3.19", @@ -35,7 +35,7 @@ "psr/http-server-middleware": "^1.0" }, "require-dev": { - "laminas/laminas-coding-standard": "^2.5", + "laminas/laminas-coding-standard": "^3.0", "mikey179/vfsstream": "^1.6.7", "phpunit/phpunit": "^10.5", "vimeo/psalm": "^5.22" @@ -54,7 +54,8 @@ "scripts": { "check": [ "@cs-check", - "@test" + "@test", + "@static-analysis" ], "cs-check": "phpcs", "cs-fix": "phpcbf", diff --git a/docs/book/index.md b/docs/book/index.md deleted file mode 100644 index fe84005..0000000 --- a/docs/book/index.md +++ /dev/null @@ -1 +0,0 @@ -../../README.md \ No newline at end of file diff --git a/docs/book/index.md b/docs/book/index.md new file mode 120000 index 0000000..fe84005 --- /dev/null +++ b/docs/book/index.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file diff --git a/docs/book/v3/installation.md b/docs/book/v3/installation.md index 723581c..3d2d181 100644 --- a/docs/book/v3/installation.md +++ b/docs/book/v3/installation.md @@ -2,4 +2,6 @@ Install `dotkernel/dot-errorhandler` by executing the following Composer command: - composer require dotkernel/dot-errorhandler +```shell +composer require dotkernel/dot-errorhandler +``` diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index c124631..9570f5a 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -1,6 +1,6 @@ # Overview -`dot-errorhandler` is DotKernel's logging error handler, providing two options: +`dot-errorhandler` is Dotkernel's logging error handler, providing two options: - `Dot\ErrorHandler\ErrorHandler`, same as the Zend Expressive error handling class with the only difference being the removal of the `final` statement for making extension possible - `Dot\ErrorHandler\LogErrorHandler` adds logging support to the default `ErrorHandler` class diff --git a/docs/book/v4/installation.md b/docs/book/v4/installation.md index 723581c..3d2d181 100644 --- a/docs/book/v4/installation.md +++ b/docs/book/v4/installation.md @@ -2,4 +2,6 @@ Install `dotkernel/dot-errorhandler` by executing the following Composer command: - composer require dotkernel/dot-errorhandler +```shell +composer require dotkernel/dot-errorhandler +``` diff --git a/docs/book/v4/overview.md b/docs/book/v4/overview.md index c124631..6fc31dd 100644 --- a/docs/book/v4/overview.md +++ b/docs/book/v4/overview.md @@ -1,6 +1,10 @@ # Overview -`dot-errorhandler` is DotKernel's logging error handler, providing two options: +`dot-errorhandler` is Dotkernel's logging error handler, providing two options: - `Dot\ErrorHandler\ErrorHandler`, same as the Zend Expressive error handling class with the only difference being the removal of the `final` statement for making extension possible - `Dot\ErrorHandler\LogErrorHandler` adds logging support to the default `ErrorHandler` class + +> Versions **>=4.0.0** and **<4.1.0** use laminas/laminas-servicemanager **3.x** + +> Versions **>=4.1.0** use laminas/laminas-servicemanager **4.x** diff --git a/test/ErrorHandlerFactoryTest.php b/test/ErrorHandlerFactoryTest.php index 85676fd..2cf7de6 100644 --- a/test/ErrorHandlerFactoryTest.php +++ b/test/ErrorHandlerFactoryTest.php @@ -57,7 +57,7 @@ public function testWillCreateWithErrorResponseGenerator(): void { $this->container->method('has') ->with(ErrorResponseGenerator::class) - ->willReturn($this->createMock(ErrorResponseGenerator::class)); + ->willReturn(true); $this->container->method('get') ->willReturnMap([ diff --git a/test/LogErrorHandlerTest.php b/test/LogErrorHandlerTest.php index 9afbb6d..2d6e4b6 100644 --- a/test/LogErrorHandlerTest.php +++ b/test/LogErrorHandlerTest.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\MockObject\Exception; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psr\Container\ContainerExceptionInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamInterface; @@ -194,6 +195,9 @@ public function testErrorHandlingTriggersListeners(): void $this->assertSame($this->response, $result); } + /** + * @throws ContainerExceptionInterface + */ public function testHandleThrowableLogsError(): void { $config = $this->getConfig();