PHPackages                             rinsvent/exception - 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. rinsvent/exception

ActiveLibrary

rinsvent/exception
==================

File system-oriented exception

v1.0.2(3y ago)01894MITPHPPHP ^8.1

Since Aug 31Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Rinsvent/exception)[ Packagist](https://packagist.org/packages/rinsvent/exception)[ RSS](/packages/rinsvent-exception/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (4)

Exception
=========

[](#exception)

- Это реализация хранения исключений ориентирована на файловую систему.
- Нужно класть файлы исключений в директорию Exception.
- И нужно регистрировать новые исключения в общем enum со списком всех возможных значений.
- Это позволит автоматически калькулировать строковый и числовой код ошибки.
- К тому же этот подход диктует правила работы с исключениями, что сделает их хранение и использование более чистым

```
// Текстовый код ошибки.
// Калькулируется по расположению в файловой системе.
// Нужен, чтобы завязать на него систему переводов
$e->getCodeText();

// Числовой код ошибки.
// Калькулируется по позиции в enum.
// Нужен чтобы клиенту было легче сообщить об ошибке
$e->getCode();

// Штатное поле. Не менялось
$e->getMessage();

// Здесь getMessage.
// Если он пустой, то текст будет на основе названия исключения.
$e->getSummary();
```

```
use \Rinsvent\Exception\AbstractException;
use \Rinsvent\Exception\CodeTrait;

class DefaultException extends AbstractException {} // psth: src/Exception/DefaultException.php
class AccessDenied extends AbstractException {} // psth: src/Exception/AccessDenied.php
class AlreadyCreated extends AbstractException {} // psth: src/Exception/User/AlreadyCreated.php

enum MyProjectEnum: string implements \Rinsvent\Exception\CodeInterface
{
    use CodeTrait;

    case Default = DefaultException::class;
    case AccessDenied = AccessDenied::class;
    case UserAlreadyCreated = AlreadyCreated::class;
}

// Регистрируем наше хранилище с ошибками
AbstractException::$exceptionEnum = MyProjectEnum::class;

$e = new AlreadyCreated('Your custom message');
$e->getCodeText(); // user.already_created
$e->getCode(); // 200
$e->getMessage(); // Your custom message
$e->getSummary(); // Your custom message

$e = new AccessDenied();
$e->getCodeText(); // access_denied
$e->getCode(); // 100
$e->getMessage(); // ''
$e->getSummary(); // Access denied
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

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 ~215 days

Total

3

Last Release

1291d ago

Major Versions

v0.0.1 → v1.0.12022-11-04

PHP version history (2 changes)v0.0.1PHP ^8.0

v1.0.1PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22261086?v=4)[rinsvent](/maintainers/rinsvent)[@Rinsvent](https://github.com/Rinsvent)

---

Top Contributors

[![rinsvent007](https://avatars.githubusercontent.com/u/183840611?v=4)](https://github.com/rinsvent007 "rinsvent007 (3 commits)")

### Embed Badge

![Health badge](/badges/rinsvent-exception/health.svg)

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

PHPackages © 2026

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