slick / error-handler
PHP Error Handler module that captures and displays all throwable errors in a given format, making debugging easier and more efficient
Requires
- php: >=8.2
Requires (Dev)
- phpmd/phpmd: dev-master
- phpspec/prophecy: 1.x-dev
- phpspec/prophecy-phpunit: ^2.0@dev
- phpstan/phpstan: 2.0.x-dev
- phpunit/phpunit: 11.4.x-dev
- squizlabs/php_codesniffer: 4.0.x-dev
- twig/twig: ^3
This package is auto-updated.
Last update: 2024-10-11 00:07:07 UTC
README
This custom PHP Error Handler is designed to intercept and manage all throwable errors, including exceptions and fatal errors providing a robust and user-friendly error handling experience. The module captures detailed error information and presents it within a well-structured template, offering clear and concise feedback to developers. This enhances debugging by displaying the error type, message, file, line number, and a stack trace, all within an aesthetically pleasing and easily navigable interface. This approach ensures a smooth user experience while simplifying error diagnosis and resolution for developers.
This package is compliant with PSR-2 code standards and PSR-4 autoload standards. It also applies the semantic version 2.0.0 specification.
Install
Via Composer
$ composer require slick/error-handler
Usage
In you startup script add the following:
// index.php <?php use Slick\ErrorHandler\Runner; use Slick\ErrorHandler\Util\SystemFacade; require_once 'vendor/autoload.php'; $runner = new Runner(new SystemFacade()); $runner->pushHandler(fn (Throwable $throwable) => echo $throwable->getMessage()) ->register();
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email slick.framework@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.