jeremykendall / exception-interfaces
受Schindler、Barton和Beck启发的异常接口。
1.0.1
2014-02-07 19:31 UTC
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is auto-updated.
Last update: 2024-08-25 06:31:53 UTC
README
受Ralph Schindler的PHP 5.3异常最佳实践博客文章启发的PHP异常接口
- Exception Best Practices in PHP 5.3
- John Barton的RFC for the 7XX Range of HTTP Status codes - Developer Errors项目
- 这篇推文
用法
只需创建自己的自定义异常,扩展\Exception
并实现一个异常接口。完成!
<?php namespace Example; use JeremyKendall\Exception\EdgeCases\ThatsJustSilly; class RidiculousException extends \Exception implements ThatsJustSilly {}
请参阅上文中链接的Ralph Schindler的文章,以获取背景信息。
安装
通过Composer安装。