{"id":18610573,"url":"https://github.com/ixnode/php-exception","last_synced_at":"2025-04-10T22:32:20.544Z","repository":{"id":65144730,"uuid":"583633742","full_name":"ixnode/php-exception","owner":"ixnode","description":"This library offers some ready to use PHP Exceptions.","archived":false,"fork":false,"pushed_at":"2024-12-07T21:25:53.000Z","size":103,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T05:51:13.886Z","etag":null,"topics":["exception","exception-handling","php","php8"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ixnode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-30T11:47:09.000Z","updated_at":"2024-12-07T21:25:52.000Z","dependencies_parsed_at":"2024-11-07T03:11:18.545Z","dependency_job_id":"554dd3da-d919-49b4-a67b-7eb19a932e24","html_url":"https://github.com/ixnode/php-exception","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"06b3a61ce4a14a679a01e45310bda22c59386d5e"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-exception","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-exception/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-exception/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-exception/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ixnode","download_url":"https://codeload.github.com/ixnode/php-exception/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248310109,"owners_count":21082350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exception","exception-handling","php","php8"],"created_at":"2024-11-07T03:11:06.141Z","updated_at":"2025-04-10T22:32:15.530Z","avatar_url":"https://github.com/ixnode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Exception\n\n[![Release](https://img.shields.io/github/v/release/ixnode/php-exception)](https://github.com/ixnode/php-exception/releases)\n[![PHP](https://img.shields.io/badge/PHP-^8.0-777bb3.svg?logo=php\u0026logoColor=white\u0026labelColor=555555\u0026style=flat)](https://www.php.net/supported-versions.php)\n[![PHPStan](https://img.shields.io/badge/PHPStan-Level%20Max-brightgreen.svg?style=flat)](https://phpstan.org/user-guide/rule-levels)\n[![PHPCS](https://img.shields.io/badge/PHPCS-PSR12-brightgreen.svg?style=flat)](https://www.php-fig.org/psr/psr-12/)\n[![LICENSE](https://img.shields.io/github/license/ixnode/php-exception)](https://github.com/ixnode/php-exception/blob/master/LICENSE)\n\n\u003e This library offers some ready to use PHP Exceptions.\n\n## Exception Classes\n\n### Group `Array`\n\n\u003ctable id=\"group-array\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eArray\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eArrayKeyNotFoundException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\n                \u003cnobr\u003e\u003ccode\u003estring $key\u003c/code\u003e\u003c/nobr\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a key in an array does not exist.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eArrayCountException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\n                \u003cnobr\u003e\u003ccode\u003enone\u003c/code\u003e\u003c/nobr\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that two given arrays do not match in size.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Group `Case`\n\n\u003ctable id=\"group-case\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eCase\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eCaseInvalidException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\n                \u003cnobr\u003e\u003ccode\u003estring $given\u003c/code\u003e\u003c/nobr\u003e\u003cbr\u003e\u003cnobr\u003e\u003ccode\u003earray $expected\u003c/code\u003e\u003c/nobr\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a specified case is not supported (match, switch, etc.).\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eCaseUnsupportedException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\n                \u003cnobr\u003e\u003ccode\u003estring $case\u003c/code\u003e\u003c/nobr\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a specified case is not supported (logic\nmissing things, etc.).\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Group `Class`\n\n\u003ctable id=\"group-class\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eClass\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eClassInvalidException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $class\u003c/code\u003e\u003c/nobr\u003e\u003cbr\u003e\u003cnobr\u003e\u003ccode\u003estring $expected\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a given or passed class is invalid.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Group `Configuration`\n\n\u003ctable id=\"group-configuration\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eConfiguration\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eConfigurationMissingException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $hint\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a configuration or an action is missing.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Group `Db`\n\n\u003ctable id=\"group-db\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eDb\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eDbEntityNotFoundException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $class\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a db entity was not found.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Group `File`\n\n\u003ctable id=\"group-file\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eFile\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eFileNotFoundException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $path\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a given file was not found.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eFileNotReadableException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $path\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a given file is not readable.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eFileNotWriteableException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $path\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a file cannot be written.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Group `Function`\n\n\u003ctable id=\"group-function\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eFunction\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eFunctionCurlExecException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $error\u003c/code\u003e\u003c/nobr\u003e\u003cbr\u003e\u003cnobr\u003e\u003ccode\u003estring $url\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that the curl_exec function is not working properly.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eFunctionFOpenException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003enone\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that the function fopen does not work properly.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eFunctionJsonEncodeException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003enone\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that an object cannot be converted into a JSON string.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eFunctionReplaceException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $replacePattern\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a value could not be replaced (str_replace, preg_replace, etc.).\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Group `Parser`\n\n\u003ctable id=\"group-type\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eParser\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eParserException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $parseString\u003c/code\u003e\u003c/nobr\u003e\u003cbr\u003e\u003cnobr\u003e\u003ccode\u003estring $context\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a given string could not be parsed.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Group `Type`\n\n\u003ctable id=\"group-type\"\u003e\n    \u003ccaption\u003e\u003ccode\u003eType\u003c/code\u003e\u003c/caption\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cimg width=\"200\" height=\"0\"\u003e\u003cbr\u003eName\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"150\" height=\"0\"\u003e\u003cbr\u003eParameter\u003c/th\u003e\n            \u003cth\u003e\u003cimg width=\"1\" height=\"0\"\u003e\u003cbr\u003eUsage\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003ccode\u003eTypeInvalidException\u003c/code\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003e\u003cnobr\u003e\u003ccode\u003estring $expected\u003c/code\u003e\u003c/nobr\u003e\u003cbr\u003e\u003cnobr\u003e\u003ccode\u003e?string $given = null\u003c/code\u003e\u003c/nobr\u003e\u003c/td\u003e\n            \u003ctd align=\"left\" valign=\"top\"\u003eUsed to indicate that a given or passed variable is the wrong type.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Installation\n\n```bash\ncomposer require ixnode/php-exception\n```\n\n```bash\nvendor/bin/php-exception -V\n```\n\n```bash\nphp-exception 0.1.0 (12-30-2022 11:41:25) - Björn Hempel \u003cbjoern@hempel.li\u003e\n```\n\n## Usage\n\n```php\nuse Ixnode\\PhpException\\FileNotFoundException;\n```\n\n```php\nthrow new FileNotFoundException('path-to-file');\n```\n\n## Development\n\n```bash\ngit clone git@github.com:ixnode/php-exception.git \u0026\u0026 cd php-exception\n```\n\n```bash\ncomposer install\n```\n\n```bash\ncomposer test\n```\n\n## License\n\nThis tool is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-exception","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fixnode%2Fphp-exception","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-exception/lists"}