Download the PHP package hradigital/php-exceptions without Composer

On this page you can find all versions of the php package hradigital/php-exceptions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-exceptions

php-exceptions

CI Release Release Latest Version on Packagist Total Downloads PHP Version Last Commit Open Issues Contributors Stars Code Size Conventional Commits

A curated set of reusable, semantic domain exceptions for Domain-Driven Design PHP applications. Their names mirror the HTTP 4XX/5XX families because that vocabulary is widely understood, but they are raised in the domain layer, outside any transport, and translated at the boundary into an HTTP response, RPC error, CLI exit or queue dead-letter. Throwing the right exception is part of your domain language, where a generic InvalidArgumentException leaks plumbing into it. Framework-agnostic, with zero runtime dependencies beyond the PHP standard library, on any PHP 8.1+ project.

Requirements

Dependency Version
PHP ^8.1

Installation

Usage

Every exception in this package extends AbstractBaseException, which itself extends PHP's native \DomainException. Each subclass ships with a sensible default message and an HTTP-aligned status code ($code).

Catching by intent

Authoring your own exceptions

Pick the closest leaf class and extend it — that way callers can still catch by the broader intent.

Available exceptions

Listed in HTTP-status order for orientation. Each class carries a docBlock with its semantic meaning, when to extend it, and (where relevant) the browser behaviour the analogous HTTP status triggers.

Client — caller-fault (4XX-aligned) BadRequestException (400), DeniedAccessException (401), PaymentRequiredException (402), ForbiddenException (403), NotFoundException (404), MethodNotAllowedException (405), NotAcceptableException (406), RequestTimeoutException (408), ConflictException (409), GoneException (410), PreconditionFailedException (412), UnsupportedMediaTypeException (415), RequestedRangeNotSatisfiableException (416), ExpectationFailedException (417), UnprocessableEntityException (422), LockedException (423), FailedDependencyException (424), TooEarlyException (425), PreconditionRequiredException (428), TooManyRequestsException (429), UnavailableForLegalReasonsException (451), plus Request\RequestFailureException for structured per-field validation failures.

Server — system-fault (5XX-aligned) InternalServerErrorException (500), ServerNotImplementedException (501), BadGatewayException (502), ServerUnavailableException (503), GatewayTimeoutException (504), InsufficientStorageException (507), LoopDetectedException (508).

Transport-only HTTP statuses (407, 411, 413, 414, 421, 426, 431, 505, 506, 510, 511) are intentionally not represented — they have no platform-agnostic domain meaning.

Testing

Continuous Integration

GitHub Actions runs PHPUnit on every push and pull request, across PHP 8.1 / 8.2 / 8.3 / 8.4 / 8.5.

Versioning

This package follows Semantic Versioning 2.0.0. Breaking changes only ship in major releases.

Contributing

Pull requests are welcome. For substantial changes, please open an issue first to discuss what you'd like to change. Add tests for any new behaviour or bug fix.

Security

If you discover a security vulnerability, please email [email protected] instead of opening a public issue.

License

This package is open-sourced software licensed under the Mozilla Public License 2.0.

You may use this package in closed-source and commercial products. If you modify and distribute the package's own files, those files must remain under the MPL-2.0.

The HRADigital name and package names are not covered by that licence - see TRADEMARK.md.


All versions of php-exceptions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hradigital/php-exceptions contains the following files

Loading the files please wait ...