From 27f31d5b25bbf3ab05e7d5685e2bac25320b5245 Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 11 Feb 2022 13:40:24 +0200 Subject: [PATCH] updated composer, badges --- OSSMETADATA | 1 + README.md | 9 +++++++++ composer.json | 7 +++---- src/ErrorHandlerFactory.php | 6 ++---- src/LogErrorHandlerFactory.php | 5 ++--- 5 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 OSSMETADATA diff --git a/OSSMETADATA b/OSSMETADATA new file mode 100644 index 0000000..6c7e106 --- /dev/null +++ b/OSSMETADATA @@ -0,0 +1 @@ +osslifecycle=active \ No newline at end of file diff --git a/README.md b/README.md index 624b195..9d40128 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ Logging Error Handler for DotKernel +![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-errorhandler) + +[![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-debugbar/issues) +[![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-debugbar/network) +[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-debugbar/stargazers) +[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-errorhandler)](https://github.com/dotkernel/dot-debugbar/blob/main/LICENSE.md) + +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/3.1.1) + ## Adding the error handler * Add the composer package: diff --git a/composer.json b/composer.json index 5421e26..6383b55 100644 --- a/composer.json +++ b/composer.json @@ -21,13 +21,12 @@ ], "require": { "php": "^7.4", + "dotkernel/dot-log": "^3.0", + "laminas/laminas-dependency-plugin": "^2.0", "laminas/laminas-diactoros": "^2.2", - "mezzio/mezzio": "^3.2", "laminas/laminas-log": "^2.12", - "dotkernel/dot-log": "^3.0", "psr/http-message": "^1.0", - "psr/container": "^1.0", - "laminas/laminas-dependency-plugin": "^2.0" + "psr/container": "^1.0" }, "autoload": { "psr-4": { diff --git a/src/ErrorHandlerFactory.php b/src/ErrorHandlerFactory.php index 114624f..681c1d0 100644 --- a/src/ErrorHandlerFactory.php +++ b/src/ErrorHandlerFactory.php @@ -11,15 +11,13 @@ use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; -use Mezzio\Middleware\ErrorResponseGenerator; -// use Dot\ErrorHandler\ErrorHandler; class ErrorHandlerFactory { public function __invoke(ContainerInterface $container) : ErrorHandler { - $generator = $container->has(ErrorResponseGenerator::class) - ? $container->get(ErrorResponseGenerator::class) + $generator = $container->has(\Mezzio\Middleware\ErrorResponseGenerator::class) + ? $container->get(\Mezzio\Middleware\ErrorResponseGenerator::class) : null; return new ErrorHandler($container->get(ResponseInterface::class), $generator); diff --git a/src/LogErrorHandlerFactory.php b/src/LogErrorHandlerFactory.php index 7f72c89..f76d680 100644 --- a/src/LogErrorHandlerFactory.php +++ b/src/LogErrorHandlerFactory.php @@ -8,7 +8,6 @@ use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Server\MiddlewareInterface; -use Mezzio\Middleware\ErrorResponseGenerator; use Laminas\Log\LoggerInterface; class LogErrorHandlerFactory @@ -33,8 +32,8 @@ public function __invoke(ContainerInterface $container) : MiddlewareInterface $logger = $container->get($errorHandlerConfig['logger']); } - $generator = $container->has(ErrorResponseGenerator::class) - ? $container->get(ErrorResponseGenerator::class) + $generator = $container->has(\Mezzio\Middleware\ErrorResponseGenerator::class) + ? $container->get(\Mezzio\Middleware\ErrorResponseGenerator::class) : null; return new LogErrorHandler($container->get(ResponseInterface::class), $generator, $logger);