averay/http-exceptions
Discrete exceptions for all HTTP error status code for use in a server application.
Maintainers
v1.0.1
2025-05-19 05:52 UTC
Requires
- php: >=8.2
- fig/http-message-util: ^1.1
Requires (Dev)
- vimeo/psalm: ^5.26
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 62238d4205649d5190b38ebce8f7dfabc300c533
README
Discrete exceptions for all HTTP error status code for use in a server application.
Example
<?php // ... if ($item === null) { throw new HttpNotFoundException('Unknown item.'); } if ($user === null) { throw new HttpUnauthorizedException('User not logged in.'); } if (!$user->hasAccess($item)) { throw new HttpForbiddenException('User does not have access to item.'); } // ...
