icanboogie/errors
最新稳定版本:v3.0.0
Composer 安装命令:
composer require icanboogie/errors
包简介
Collects and render errors
关键字:
README 文档
README
Collects formatted errors.
Installation
composer require icanboogie/errors
Usage
<?php use ICanBoogie\ErrorCollection; $errors = new ErrorCollection; var_dump($errors['password']); // null $errors->add('password'); var_dump($errors['password']); // [ Error{ format: '', params: [] } ] $errors->add('password', 'Invalid password: {value}', [ 'value' => "123" ]); var_dump($errors['password']); // 'Invalid password: 123' $errors['password'] = 'Ugly password'; var_dump($errors['password']); // array('Invalid password', 'Ugly password') $errors->add_generic('General error'); count($errors); // 3 $errors->each(function($name, $message) { echo "$name: $message\n"; }); // General error // password: Invalid password // password: Ugly password
Continuous Integration
The project is continuously tested by GitHub actions.
Code of Conduct
This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you are expected to uphold this code.
Contributing
Please see CONTRIBUTING for details.
License
icanboogie/errors is released under the BSD-3-Clause.
统计信息
- 总下载量: 4.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2012-12-30