siwayll/kapow
Composer 安装命令:
composer require siwayll/kapow
包简介
simple base for customizing exceptions
README 文档
README
Kapow !
Simple exception with variables in it.
Quick examples
Create an Exception
use Siwayll\Kapow\Exception as Kapow; use Siwayll\Kapow\Level; ... class DodgeSpecialAttack extends Kapow { protected $superVillain; protected $superHero; protected $specialAttack; /** * Message of the exception */ public $message = 'The super villain {superVillain} has dodge {superHero} super hero special attack {specialAttack}'; public $code = Level::CRITICAL; public function __construct(Mutant $superVillain, Mutant $superHero, string $specialAttack) { $this->superVillain = $superVillain->getName(); $this->superHero = $superHero->getName(); $this->specialAttack = $specialAttack; } }
Throw it !
throw new DodgeSpecialAttack($villan, $hero, 'ultra smash 2');
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request
Running the tests
make install ./bin/atoum
License
MIT
统计信息
- 总下载量: 99
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-26