dhii / exception-interface
常见异常的接口
v0.2
2018-08-29 10:42 UTC
Requires
- php: ^5.3 | ^7.0
- dhii/stringable-interface: ^0.1
Requires (Dev)
- codeclimate/php-test-reporter: <=0.3.2
- dhii/php-cs-fixer-config: dev-php-5.3
- phpunit/phpunit: ^4.8
- ptrofimov/xpmock: ^1.1
This package is auto-updated.
Last update: 2024-09-07 05:18:47 UTC
README
常见异常的接口。
详情
ThrowableInterface- 所有异常接口的基础。以兼容的方式声明与Exception相同的方法,并额外扩展了StringableInterface。BadSubjectExceptionInterface- 与某些值无效、格式不正确、超出范围等相关的所有异常的基接口。通过getSubject()公开该值。InvalidArgumentExceptionInterface- 允许从普通的InvalidArgumentException解耦,并通过通过BadSubjectExceptionInterface#getSubejct()公开参数来使其更具有用。ArgumentCodeAwareInterface- 与InvalidArgumentExceptionInterface一起使用时很有用,可以提供有关有问题的参数来源的信息。OutOfBoundsExceptionInterface- 补充原生OutOfBoundsException,当在集合中找不到键时发生,例如访问不存在的数组键。公开了有问题的键。OutOfRangeExceptionInterface- 补充原生OutOfRangeException,当值有效但不合法时发生,即超出允许的范围,例如一个表示颜色的整数必须在0-255之间,但值为256。公开了有问题的值。RuntimeExceptionInterface- 通用运行时问题。InternalExceptionInterface- 与单元的内部工作相关的问题,并非由消费者引起。保证公开内部异常。