icanboogie/errors
Collects and render errors
Maintainers
v3.0.0
2021-07-23 08:58 UTC
Requires
- php: >=8.0
- icanboogie/common: ^2.0
Requires (Dev)
- phpstan/phpstan: ^0.12.93
- phpunit/phpunit: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
BSD-3-Clause 302f1b6bb1f09d2dbd82d28adb2f3cb47a2971f9
- Olivier Laviale <olivier.laviale.woop@gmail.com>
README
👁 Release
👁 Code Quality
👁 Code Coverage
👁 Packagist
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.
👁 Tests
👁 Static Analysis
👁 Code Style
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.
