silencenjoyer / silence-error-handling
Silence error handling system.
0.0.3
2025-07-21 17:07 UTC
Requires
- php: ^8.3.0
- psr/container: ^2.0
- psr/http-factory: ^1.0.0
- psr/http-message: ^1.1|^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0.0
- psr/log: ^3.0.0
- silencenjoyer/silence-http: ^0.0
- silencenjoyer/silence-http-parser: ^0.0
- silencenjoyer/silence-http-spec: ^0.0
Requires (Dev)
- phpstan/phpstan: *
- shipmonk/composer-dependency-analyser: dev-master
- symfony/var-dumper: ^7.3
README
The package is designed for centralised processing of errors and exceptions. It provides a readable view of errors.
This package is part of the monorepository silencenjoyer/silence, but can be used independently.
โ๏ธ Installation
composer require silencenjoyer/silence-error-handling
๐ Quick start
<?php use Silence\ErrorHandler\ErrorHandler; use Silence\ErrorHandler\Renderers\HtmlRenderer; $errorHandler = new ErrorHandler(new HtmlRenderer()); $errorHandler->register();
๐งฑ Features:
- Interception of unhandled exceptions, compatible with PSR-15 middleware.
- Memory reserve to Avoid "Out of Memory" lockups
- Dynamic memory reserve adjustment
- Graceful fallback - When in non-debug mode, hides internal details.
- Detailed trace - When debug mode is enabled, provides full details.
- Shutdown error capture
- Unified rendering
๐งช Testing
php vendor/bin/phpunit
๐งฉ Use in the composition of Silence
The package is used to intercept errors in the Silence application.
If you are writing your own package, you can connect silencenjoyer/silence-error-handling
for the same reason.
๐ License
This package is distributed under the MIT licence. For more details, see LICENSE.