PHPackages                             webservco/error - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. webservco/error

ActiveLibrary

webservco/error
===============

A PHP component/library.

v1.0.0(1y ago)03841MITPHPPHP ^8.4

Since Jul 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/webservco/error)[ Packagist](https://packagist.org/packages/webservco/error)[ Docs](https://webserv.co)[ RSS](/packages/webservco-error/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (16)Versions (6)Used By (1)

webservco/error
===============

[](#webservcoerror)

A PHP component/library.

Custom application error handling.

---

Usage
-----

[](#usage)

Implement interfaces:

### `ErrorHandlerInterface`

[](#errorhandlerinterface)

```
interface ErrorHandlerInterface
{
    public function handle(
        // The first parameter, errno, will be passed the level of the error raised, as an integer.
        int $errno,
        // The second parameter, errstr, will be passed the error message, as a string.
        string $errstr,
        // If the callback accepts a third parameter, errfile,
        // it will be passed the filename that the error was raised in, as a string.
        string $errfile,
        // If the callback accepts a fourth parameter, errline,
        // it will be passed the line number where the error was raised, as an integer.
        int $errline,
        // $errcontext removed in PHP 8
    ): bool;
}
```

### `ErrorHandlingServiceFactoryInterface`

[](#errorhandlingservicefactoryinterface)

```
interface ErrorHandlingServiceFactoryInterface
{
    public function createErrorHandlingService(): ErrorHandlingServiceInterface;
}
```

### `ErrorHandlingServiceInterface`

[](#errorhandlingserviceinterface)

```
interface ErrorHandlingServiceInterface
{
    public function handlePreExecutionErrors(): bool;

    public function initialize(): bool;

    public function restore(): bool;
}
```

---

Example implementation
----------------------

[](#example-implementation)

A simple handling service using a strict error handler (throws exception for any error) is provided.

```
// Create service.
$errorHandlingServiceFactory = new DefaultErrorHandlingServiceFactory();
$errorHandlingService = $errorHandlingServiceFactory->createErrorHandlingService();

// In application bootstrap:
$errorHandlingService->initialize();
$errorHandlingService->handlePreExecutionErrors();

// Application run.

// In application shutdown:
$errorHandlingService->restore();
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance43

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~148 days

Total

5

Last Release

458d ago

Major Versions

v0.8.0 → v1.0.02025-02-15

PHP version history (3 changes)v0.0.1PHP ^8.2

v0.8.0PHP ^8.3

v1.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/d141a82e41201dab8f836df9f4c78ad56a131c100c1ff814515d0d6f011fdecd?d=identicon)[ariademur](/maintainers/ariademur)

---

Top Contributors

[![ariademur](https://avatars.githubusercontent.com/u/34913107?v=4)](https://github.com/ariademur "ariademur (32 commits)")

---

Tags

componentwebservco

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/webservco-error/health.svg)

```
[![Health](https://phpackages.com/badges/webservco-error/health.svg)](https://phpackages.com/packages/webservco-error)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
