PHPackages                             sqrt-pro/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. [Framework](/categories/framework)
4. /
5. sqrt-pro/exception

ActiveLibrary[Framework](/categories/framework)

sqrt-pro/exception
==================

Basic Exception class is a part of SQRT Framework

0.1(11y ago)01.5k3MITPHPPHP &gt;=5.3.0

Since Sep 16Pushed 10y ago2 watchersCompare

[ Source](https://github.com/sqrt-pro/Exception)[ Packagist](https://packagist.org/packages/sqrt-pro/exception)[ Docs](http://fw.sqrt.pro)[ RSS](/packages/sqrt-pro-exception/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (3)

SQRT\\Exception
===============

[](#sqrtexception)

Класс **SQRT\\Exception** позволяет удобно работать с текстами ошибок в исключениях, используя подстановку по коду ошибки и функционал шаблонов sprintf.

Например, создадим класс-наследник содержащий тексты и шаблоны ошибок:

```
    class TestException extends \SQRT\Exception
    {
      const ERR_ONE = 1;
      const ERR_TWO = 2;

      protected static $errors_arr = array(
        self::ERR_ONE => 'Текст ошибки номер один',
        self::ERR_TWO => 'Текст ошибки %s с подстановкой %s',
      );
    }

```

Теперь можно формировать тексты ошибок по коду исключения:

```
    echo TestException::GetNameForCode(TestException::ERR_ONE);
    // Вывод: Текст ошибки номер один

    echo TestException::GetNameForCode(TestException::ERR_TWO, array('#2', 'значений');
    echo TestException::GetNameForCode(TestException::ERR_TWO, '#2', 'значений');
    // Оба вызова дадут вывод: Текст ошибки #2 с подстановкой значений

```

Или сразу выбрасывать Exception с нужными свойствами:

```
    try {
        TestException::ThrowError(TestException::ERR_TWO, '#2', 'значений');
    } catch (TestException $e) {
        echo $e->getMessage(); // Текст ошибки #2 с подстановкой значений
        echo $e->getCode(); // 2 (Значение TestException::ERR_TWO)
    }

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4262d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b13b6471e4cd370ac559ab9c2616d4518c1552d91aa7685cfceedae0e61396e1?d=identicon)[sqrt-pro](/maintainers/sqrt-pro)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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