22
33dot-errorhandler is Dotkernel's PSR-15 compliant error handler.
44
5+ ## Version History
6+
7+ | Branch | Release | Service Manager | Log style implementation | PHP Version |
8+ | --------| ----------| -------------------| --------------------------| ------------------------------------------------------------------------------------------------------------------|
9+ | 4.1 | >= 4.2.0 | Service Manager 4 | PSR-Log | ![ PHP from Packagist (specify version)] ( https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/4.4.0 ) |
10+ | 4.1 | < 4.2.0 | Service Manager 4 | Laminas Log style | ![ PHP from Packagist (specify version)] ( https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/4.1.1 ) |
11+ | 4.0 | < 4.1.0 | Service Manager 3 | Laminas Log style | ![ PHP from Packagist (specify version)] ( https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/4.0.1 ) |
12+ | 3.0 | < 4.0.0 | Service Manager 3 | Laminas Log | ![ PHP from Packagist (specify version)] ( https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/3.4.1 ) |
13+
514## Documentation
615
716Documentation is available at: https://docs.dotkernel.org/dot-errorhandler/
817
918## Badges
1019
1120![ OSS Lifecycle] ( https://img.shields.io/osslifecycle/dotkernel/dot-errorhandler )
12- ![ PHP from Packagist (specify version)] ( https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/4.3 .0 )
21+ ![ PHP from Packagist (specify version)] ( https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/4.4 .0 )
1322
1423[ ![ GitHub issues] ( https://img.shields.io/github/issues/dotkernel/dot-errorhandler )] ( https://github.com/dotkernel/dot-errorhandler/issues )
1524[ ![ GitHub forks] ( https://img.shields.io/github/forks/dotkernel/dot-errorhandler )] ( https://github.com/dotkernel/dot-errorhandler/network )
@@ -45,18 +54,16 @@ In `config/autoload/error-handling.global.php`:
4554
4655use Dot\ErrorHandler\ErrorHandlerInterface;
4756use Dot\ErrorHandler\LogErrorHandler;
48- use Dot\ErrorHandler\ErrorHandler;
4957
5058return [
5159 'dependencies' => [
5260 'aliases' => [
5361 ErrorHandlerInterface::class => LogErrorHandler::class,
54- ]
55-
62+ ],
5663 ],
5764 'dot-errorhandler' => [
5865 'loggerEnabled' => true,
59- 'logger' => 'dot-log.default_logger'
66+ 'logger' => 'dot-log.default_logger',
6067 ]
6168];
6269```
@@ -71,26 +78,26 @@ When configuring the error handler in your application, you can choose between t
7178> Both ` LogErrorHandler ` and ` ErrorHandler ` have factories declared in the package's ` ConfigProvider ` .
7279> If you need a custom ErrorHandler, it must have a factory declared in the config, as in the below example:
7380
81+ Example:
82+
7483``` php
7584<?php
7685
77- use Dot\ErrorHandler\ErrorHandlerInterface;
78- use Custom\MyErrorHandler;
79- use Custom\MyErrorHandlerFactory;
86+ declare(strict_types=1);
8087
8188return [
82- 'dependencies' => [
89+ 'dependencies' => [
8390 'factories' => [
84- MyErrorHandler ::class => MyCustomHandlerFactory ::class,
91+ \App\CustomErrorHandler ::class => \App\CustomHandlerFactory ::class,
8592 ],
8693 'aliases' => [
87- ErrorHandlerInterface::class => MyErrorHandler ::class,
88- ]
94+ \Dot\ErrorHandler\ ErrorHandlerInterface::class => \App\CustomErrorHandler ::class,
95+ ],
8996 ],
9097 'dot-errorhandler' => [
9198 'loggerEnabled' => true,
92- 'logger' => 'dot-log.default_logger',
93- ]
99+ 'logger' => 'dot-log.default_logger',
100+ ],
94101];
95102```
96103
0 commit comments