itamit / classifier-error-bundle
symfony分类错误组件包
dev-develop
2020-06-04 06:51 UTC
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-09-04 16:34:52 UTC
README
从异常自动生成错误
分类器表示应用程序异常监听器。为了将异常转换为HTTP响应,请在异常的code字段中指定分类器已知错误代码。
状态
此包目前正在积极开发中。
要求
- PHP 7.2或更高版本
- Symfony 4.4
安装
-
使用Composer要求组件和一个PSR 7/17实现
composer require itamit/classifier-error-bundle
-
在
config/bundles.php中启用组件,通过将其添加到数组中Itamit\ClassifierErrorBundle\ClassifierErrorBundle::class => ['all' => true]
添加自定义分类错误
-
创建一个实现接口
Itamit\ClassifierErrorBundle\Provider\ErrorProviderInterface的类 -
将创建的类作为服务注册,标签为
classifier_error.error_provider