shumik/bracket-checker

Check string for correct brackets opening/closing

Installs: 510

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/shumik/bracket-checker

v1.0.7 2018-02-09 13:36 UTC

This package is not auto-updated.

Last update: 2025-10-12 09:52:23 UTC


README

Install:

composer require shumik/bracket-checker

Example:

use \BracketChecker\BracketChecker;

require_once 'vendor/autoload.php';

$checker = new BracketChecker();
$checker->setString("()()(()(()())))");

try {
    echo $checker->check() ? 'valid string' : 'invalid string';
} catch (InvalidArgumentException $e) {
    echo 'Invalid string format';
}

Tests:

vendor/bin/phpunit --bootstrap vendor/autoload.php vendor/shumik/bracket-checker/tests/BracketCheckerTest.php