itamit / classifier-error-bundle
Bundle for symfony classifier error
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.2
- symfony/config: ^4.2
- symfony/dependency-injection: ^4.2
- symfony/http-kernel: ^4.2
- symfony/yaml: ^4.2
Requires (Dev)
- ext-xdebug: *
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2024-05-04 15:40:31 UTC
README
Automatic error generation from exceptions
The classifier represents application exception listeners.
In order for the exception to be converted into an HTTP response, specify the error code known to the classifier in the code
field of the exception.
Status
This package is currently in the active development.
Requirements
- PHP 7.2 or greater
- Symfony 4.4
Installation
-
Require the bundle and a PSR 7/17 implementation with Composer:
composer require itamit/classifier-error-bundle
-
Enable the bundle in
config/bundles.php
by adding it to the array:Itamit\ClassifierErrorBundle\ClassifierErrorBundle::class => ['all' => true]
Adding custom classifier error
-
Create a class that implements an interface
Itamit\ClassifierErrorBundle\Provider\ErrorProviderInterface
-
Register the created class as a service with a tag
classifier_error.error_provider