cubicmushroom/exceptions
最新稳定版本:1.0.5
Composer 安装命令:
composer require cubicmushroom/exceptions
包简介
A basic, abstract exceptions class
README 文档
README
Cubic Mushroom Exceptions
This library provides just a single abstract exception class with it's own bild() method for easily creating exceptions with various properties, passed as an array of arguments.
How to use
Just have a look at the src/CubicMushroom/Exceptions/AbstractException class methods for basic methods, but here is a
brief overview...
AbstractException provides build() method that can be used to prepare exceptions to be thrown.
When using build(), you don't need to pass in a $message, $code. If you don't the default for the class will be
used. This is returned by the classes getDefaultMessage() and getDefaultCode() methods, if they exist.
As it's not helpful when an exception doesn't have a message, if no message is either passed, or a default set in the
exception class, a MissingExceptionMessageException will be thrown.
The build() method also accepts a second array parameter. If passed, the build() method will attempt to set all the
properties on the build exception using the setter for the property. If the setter is not found, then a
SetterNotFoundException will be thrown.
Roadmap
- Add way of defining required additional parameters
- More stuff, as I think of it
统计信息
- 总下载量: 206
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-31