averay/http-exceptions

Discrete exceptions for all HTTP error status code for use in a server application.

Installs: 296

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/averay/http-exceptions

v1.0.1 2025-05-19 05:52 UTC

This package is auto-updated.

Last update: 2025-09-30 11:25:09 UTC


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.');
}

// ...