This library offers some ready to use PHP Exceptions.
Array
Case
Class
Name |
Parameter |
Usage |
---|---|---|
ClassInvalidException |
string $class string $expected |
Used to indicate that a given or passed class is invalid. |
Configuration
Name |
Parameter |
Usage |
---|---|---|
ConfigurationMissingException |
string $hint |
Used to indicate that a configuration or an action is missing. |
Db
Name |
Parameter |
Usage |
---|---|---|
DbEntityNotFoundException |
string $class |
Used to indicate that a db entity was not found. |
File
Function
Parser
Name |
Parameter |
Usage |
---|---|---|
ParserException |
string $parseString string $context |
Used to indicate that a given string could not be parsed. |
Type
Name |
Parameter |
Usage |
---|---|---|
TypeInvalidException |
string $expected ?string $given = null |
Used to indicate that a given or passed variable is the wrong type. |
composer require ixnode/php-exception
vendor/bin/php-exception -V
php-exception 0.1.0 (12-30-2022 11:41:25) - Björn Hempel <[email protected]>
use Ixnode\PhpException\FileNotFoundException;
throw new FileNotFoundException('path-to-file');
git clone [email protected]:ixnode/php-exception.git && cd php-exception
composer install
composer test
This tool is licensed under the MIT License - see the LICENSE file for details