Skip to content

Commit

Permalink
Merge pull request #40 from dotkernel/issue-39
Browse files Browse the repository at this point in the history
Issue #39: Added support for `laminas/laminas-servicemanager:4.x`
  • Loading branch information
alexmerlin authored Jan 17, 2025
2 parents 0c46abe + d78e946 commit ee1bd4f
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ignore_php_platform_requirements": {
"8.4": true
},
"backwardCompatibilityCheck": true
}
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
}
},
"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",
"psr/http-message": "^1.0 || ^2.0",
"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"
Expand All @@ -54,7 +54,8 @@
"scripts": {
"check": [
"@cs-check",
"@test"
"@test",
"@static-analysis"
],
"cs-check": "phpcs",
"cs-fix": "phpcbf",
Expand Down
1 change: 0 additions & 1 deletion docs/book/index.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/book/index.md
4 changes: 3 additions & 1 deletion docs/book/v3/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion docs/book/v3/overview.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion docs/book/v4/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
6 changes: 5 additions & 1 deletion docs/book/v4/overview.md
Original file line number Diff line number Diff line change
@@ -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**
2 changes: 1 addition & 1 deletion test/ErrorHandlerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
4 changes: 4 additions & 0 deletions test/LogErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -194,6 +195,9 @@ public function testErrorHandlingTriggersListeners(): void
$this->assertSame($this->response, $result);
}

/**
* @throws ContainerExceptionInterface
*/
public function testHandleThrowableLogsError(): void
{
$config = $this->getConfig();
Expand Down

0 comments on commit ee1bd4f

Please sign in to comment.