PHPackages                             bytehello/condition-builder - 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. bytehello/condition-builder

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

bytehello/condition-builder
===========================

Build PHP Condition Code Snippet With AST

0.1.4(5y ago)39MITPHP

Since Nov 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bytehello/condition-builder)[ Packagist](https://packagist.org/packages/bytehello/condition-builder)[ RSS](/packages/bytehello-condition-builder/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Introduction
============

[](#introduction)

condition-builder is a library help you build condition code snippet like

```
(new Test())->check1() && (new Test())->check2()

```

Install
=======

[](#install)

```

composer require bytehello/condition-builder

```

Usage
=====

[](#usage)

```
use ByteHello\ConditionBuilder\Builder;
use ByteHello\ConditionBuilder\Condition\AndConditionGroup;
use ByteHello\ConditionBuilder\Condition\OrConditionGroup;
use ByteHello\ConditionBuilder\ConditionConfig\ConfigData;

require 'vendor/autoload.php';

$andConditionG1 = new AndConditionGroup();
$andConditionG1->addMultiple(
    [
        new ConfigData('Test', 'check1'),
        new ConfigData('Test', 'check2'),
    ]
);

$orConditionG1 = new OrConditionGroup();
$orConditionG1->addMultiple(
    [
        new ConfigData('Test', 'check3'),
        $andConditionG1
    ]
);

$andConditionG2 = new AndConditionGroup();
$andConditionG2->addMultiple([
    new ConfigData('Test', 'check4'),
    new ConfigData('Test', 'check5'),
    $orConditionG1
]);

$node = Builder::generateCode($andConditionG2);
echo Builder::getPrintedStatements($node);
echo PHP_EOL;

```

output is

```

(new Test())->check4() && ((new Test())->check5() && ((new Test())->check3() || (new Test())->check1() && (new Test())->check2()))

```

License
=======

[](#license)

The bytehello/condition-builder is open-source software licensed under the MIT license.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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

Every ~0 days

Total

5

Last Release

2060d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bytehello-condition-builder/health.svg)

```
[![Health](https://phpackages.com/badges/bytehello-condition-builder/health.svg)](https://phpackages.com/packages/bytehello-condition-builder)
```

PHPackages © 2026

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