PHPackages                             theluk/php-condition-resolver - 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. theluk/php-condition-resolver

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

theluk/php-condition-resolver
=============================

A small helper for defining conditions and matching them against some data

v0.1.0(10y ago)121PHP &gt;=5.3.0

Since Jun 9Compare

[ Source](https://github.com/theluk/php-condition-resolver)[ Packagist](https://packagist.org/packages/theluk/php-condition-resolver)[ Docs](https://github.com/theluk/php-condition-resolver)[ RSS](/packages/theluk-php-condition-resolver/feed)WikiDiscussions Synced yesterday

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

php-condition-resolver
======================

[](#php-condition-resolver)

A small helper for defining conditions and matching them against some data

Use
===

[](#use)

A condition resolver, that can uses some data array and a condition array to determine, if the data array matches the conditions.

a typical single condition looks like

```
array(
    "cmp" => "==",
    "left" => "value1",
    "right" => "value2"
)

```

as "left" and "right" keys you can use a path syntax, which will try to fetch the data from the main data object.

```
"left" => "My.Object.some_value"
"right" => "something"

```

$this-&gt;setConditions() method expects an array of many conditions arrays

```
array(
    array( "cmp" => ... ),
    array( "cmp" => ... )
)

```

you can also use two operators "or" and "and".

```
array(
    array("or" => array(
        array( "cmp" => ... ),
        array( "cmp" => ... )
    ))
)

```

the operators can also be nested, the only important thing is that an operator syntax expects that the array must contain a single key, which is "or" or "and" and the value is again a list of conditions.

another example that should work

```
array(
    "or" => array(
        array(
            "and" => array(
                array( condition )
                array( condition )
                array(
                    "or" => array(
                     array ( ... )
                    )
                )
            )
        )
    )
)

```

Tests
=====

[](#tests)

run

```
phpunit ./src/ConditionResolverTest.php

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

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

3674d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/580946?v=4)[Lukas Klinzing](/maintainers/theluk)[@theluk](https://github.com/theluk)

---

Top Contributors

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

---

Tags

phpconditions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/theluk-php-condition-resolver/health.svg)

```
[![Health](https://phpackages.com/badges/theluk-php-condition-resolver/health.svg)](https://phpackages.com/packages/theluk-php-condition-resolver)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21422.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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