PHPackages                             movisio/condition-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. movisio/condition-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

movisio/condition-parser
========================

Movisio Condition parser

1.0.2(6y ago)213.7k↑15.5%BSD-3-ClausePHPPHP &gt;=7.0

Since Jun 4Pushed 3y ago2 watchersCompare

[ Source](https://github.com/movisio/condition-parser)[ Packagist](https://packagist.org/packages/movisio/condition-parser)[ Docs](https://movisio.com)[ RSS](/packages/movisio-condition-parser/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Condition Parser [![Tests](https://github.com/movisio/condition-parser/workflows/Tests/badge.svg?branch=master)](https://github.com/movisio/condition-parser/actions) [![Coverage Status](https://camo.githubusercontent.com/c9655600d1a2bbb67127053fa2e8792c2dfc35c1974685480145627d41a6bae2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6f766973696f2f636f6e646974696f6e2d7061727365722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/movisio/condition-parser?branch=master)
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#condition-parser--)

A simple condition parsing and evaluation library. Shunting-yard algorithm for parsing strings to expression trees that can ben evaluated later. Supports variables that can be set for each evaluation.

Installation:

```
composer require movisio/condition-parser

```

Example usage:

```
$expression = ConditionParser::parse('$deleted == 0 && $id > 1');
$conditionObject = new ArrayObject($userEntityData);
$can_be_deleted = $expression->evaluate($conditionObject)

```

Once parsed $expression object can be evaluated multiple times with different data. The `parse()` method requires an object implementing the \\ArrayAccess interface currently because we use it mostly with ORM entities that can implement it and because at the moment it is not possible to type-hint to `array` and `\ArrayAccess` at the same time.

v1.0.2

- tests for invalid inputs
- remove forbidden throw from \_\_toString()
- add parsing of null

v1.0.1

- more unit tests
- fixes
    - better handling of int and float constants including toString() not quoting numbers
    - fix exception on empty($x) and toString() on UnaryOperator

v1.0.0 - initial release

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

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 ~107 days

Total

3

Last Release

2360d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b17d4000958913c3b2c477a979832a974da7264194a29da6e4ce127802f9049?d=identicon)[Kocicak](/maintainers/Kocicak)

![](https://www.gravatar.com/avatar/aa0bdd25a28532af1e28abfd77e8bc58ac8cc575232471b6cd8e6a08bc8e7397?d=identicon)[2DDTMovisio](/maintainers/2DDTMovisio)

![](https://www.gravatar.com/avatar/71a63f5186648b402215d2f79a0a93b59bb607cbfd5be892de54ff1f08cf0354?d=identicon)[jkavalik](/maintainers/jkavalik)

---

Top Contributors

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

---

Tags

netteparsingconditionmovisio

### Embed Badge

![Health badge](/badges/movisio-condition-parser/health.svg)

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

###  Alternatives

[nette/neon

🍸 Nette NEON: encodes and decodes NEON file format.

93564.8M381](/packages/nette-neon)[jakubledl/dissect

Lexing and parsing in pure PHP

2234.7M11](/packages/jakubledl-dissect)[parsica-php/parsica

The easiest way to build robust parsers in PHP.

412171.6k4](/packages/parsica-php-parsica)[jejik/mt940

An MT940 bank statement parser for PHP

881.2M2](/packages/jejik-mt940)[kingsquare/php-mt940

Simple MT940 parser in PHP

106827.7k3](/packages/kingsquare-php-mt940)[denissimon/formula-parser

Parsing and evaluating mathematical formulas given as strings.

80326.3k3](/packages/denissimon-formula-parser)

PHPackages © 2026

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