PHPackages                             onilopic/parenthesis-checker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. onilopic/parenthesis-checker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

onilopic/parenthesis-checker
============================

Checking the string for closing brackets

1.0.0(3y ago)05MITPHP

Since Sep 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/onilopic/parenthesis-checker)[ Packagist](https://packagist.org/packages/onilopic/parenthesis-checker)[ RSS](/packages/onilopic-parenthesis-checker/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

Проверка что все открытые скобки корректно открыты и закрыты.
=============================================================

[](#проверка-что-все-открытые-скобки-корректно-открыты-и-закрыты)

Условия
-------

[](#условия)

И возвращать true, если строка корректна – все открытые скобки корректно открыты и закрыты, или же false в противном случае. Строка может включать символы “(“, “)”, “ ” (пробел), “\\n” (перенос строки), “\\t” (символ табуляции), “\\r” (перенос каретки). Если же строка содержит что-то кроме перечисленных символов, то ваша библиотека должна выбрасывать исключение InvalidArgumentException.

Алгоритм (общий)
----------------

[](#алгоритм-общий)

Не должно быть закрывающихся скобок больше чем открывающихся в любой момент времени.

Для каждого символа в тексте проверить является ли он открывающей скобкой если является, то добавить в стэк тип этой скобки (угловая/круглая/итд) если нет, то проверить является ли символ закрывающей скобкой если является и последняя добавленная открывающая скобка совпадает, то убрать её из стэка (найдена совпавшая пара скобок) иначе завершить алгоритм—найдена неправильно вложенная скобка.

Продолжать до конца текста и если стэк пустой, то текст содержит только правильно вложенные скобки.

### Php - Docker

[](#php---docker)

```
docker build -t php-composer:1.0 .
// нужно указать права пользотвателя, чтобы файлы создались не от root
docker run --user 1000:1000 -ti --volume $(pwd)/:/app php-composer:1.0 composer install
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

1399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e87db26cc0af5bf6720dfe786fd03026569532d79a32738b9d1ac42c3dab182?d=identicon)[onilopic](/maintainers/onilopic)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/onilopic-parenthesis-checker/health.svg)

```
[![Health](https://phpackages.com/badges/onilopic-parenthesis-checker/health.svg)](https://phpackages.com/packages/onilopic-parenthesis-checker)
```

###  Alternatives

[sroze/tolerance

Fault tolerance library and micro-services helpers

2002.5k](/packages/sroze-tolerance)

PHPackages © 2026

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