voku/error-handler-lib

Portable PHP error-handler library with integration hooks for application-specific logging and rendering.

Maintainers

Package info

github.com/voku/error-handler-lib

pkg:composer/voku/error-handler-lib

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.0.1 2026-06-09 22:38 UTC

This package is auto-updated.

Last update: 2026-06-09 22:42:52 UTC


README

A small, portable PHP error-handler library with application integration hooks for logging, rendering, filtering, and object descriptions.

The package is designed to be installed through Composer and then adapted by the host application through ErrorHandlerIntegrationInterface.

Installation

composer require voku/error-handler-lib

Usage

<?php

declare(strict_types=1);

use voku\ErrorHandlerLib\ErrorHandlerLib;

(new ErrorHandlerLib())->register();

ErrorHandlerLib::reportWarning('Deprecated path used.');
ErrorHandlerLib::reportError('Unexpected state detected.');

For application-specific behavior, provide an integration:

<?php

declare(strict_types=1);

use voku\ErrorHandlerLib\ErrorHandlerLib;
use voku\ErrorHandlerLib\ErrorHandlerIntegrationInterface;

final class ApplicationErrorIntegration implements ErrorHandlerIntegrationInterface
{
    // Implement logging, sanitizing, rendering, and environment decisions here.
}

ErrorHandlerLib::useIntegration(new ApplicationErrorIntegration());
(new ErrorHandlerLib())->register();

Development

composer install
composer test
composer phpstan
composer ci