PHPackages                             spaceonfire/criteria - 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. [Search &amp; Filtering](/categories/search)
4. /
5. spaceonfire/criteria

Abandoned → [getwarp/criteria](/?search=getwarp%2Fcriteria)ArchivedLibrary[Search &amp; Filtering](/categories/search)

spaceonfire/criteria
====================

Criteria help you to declare rules to filter datasets

2.5.2(4y ago)12.5k↓87.5%4MITPHPPHP ^7.2|^8.0

Since May 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/spaceonfire/criteria)[ Packagist](https://packagist.org/packages/spaceonfire/criteria)[ Docs](https://github.com/spaceonfire/criteria)[ Fund](https://liberapay.com/hustlahusky)[ RSS](/packages/spaceonfire-criteria/feed)WikiDiscussions 2.5.x Synced 1w ago

READMEChangelog (4)Dependencies (6)Versions (9)Used By (4)

Criteria by spaceonfire
=======================

[](#criteria-by-spaceonfire)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cfca2ec0b9dbdc31e16be8f613a93fe32f8c4d55fb0faaeacbc8abe6ed055fd6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73706163656f6e666972652f63726974657269612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spaceonfire/criteria)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/62881e6d234feddfc948d53ee03ecdc3f0df65437cc808549551983abf97b70b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73706163656f6e666972652f63726974657269612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spaceonfire/criteria)[![Code Coverage](https://camo.githubusercontent.com/f3174bde75238d58487d852e053889a44d0ebd5f1de7c222c442c011bd58f294/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d6874747073253341253246253246676973742e67697468756275736572636f6e74656e742e636f6d253246687573746c616875736b79253246643632363037633161326534373037393539623031343265306561383736636425324672617725324663726974657269612e6a736f6e)](https://camo.githubusercontent.com/f3174bde75238d58487d852e053889a44d0ebd5f1de7c222c442c011bd58f294/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d6874747073253341253246253246676973742e67697468756275736572636f6e74656e742e636f6d253246687573746c616875736b79253246643632363037633161326534373037393539623031343265306561383736636425324672617725324663726974657269612e6a736f6e)

Criteria help you to declare rules to filter datasets.

Install
-------

[](#install)

Via Composer

```
$ composer require spaceonfire/criteria
```

Usage
-----

[](#usage)

```
use spaceonfire\Criteria\Criteria;
$criteria = new Criteria();
$criteria->where(Criteria::expr()->property('name', Criteria::expr()->equals('Ben')))
    ->orderBy(['lastName' => SORT_ASC])
    ->offset(50)
    ->limit(25);
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

[Report issues](https://github.com/spaceonfire/spaceonfire/issues) and [send Pull Requests](https://github.com/spaceonfire/spaceonfire/pulls) in the [main spaceonfire repository](https://github.com/spaceonfire/spaceonfire). Please see [CONTRIBUTING](https://github.com/spaceonfire/spaceonfire/blob/master/CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](https://github.com/spaceonfire/spaceonfire/blob/master/CODE_OF_CONDUCT.md) for details.

Credits
-------

[](#credits)

- [Constantine Karnaukhov](https://github.com/hustlahusky)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Total

9

Last Release

1540d ago

Major Versions

1.2.0 → 2.5.02021-04-21

2.5.x-dev → 3.0.x-dev2022-02-28

PHP version history (3 changes)1.0.0PHP ^7.2

1.1.1PHP ^7.2|^8.0

3.0.x-devPHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3947942?v=4)[Constantine Karnaukhov](/maintainers/tntrex)[@tntrex](https://github.com/tntrex)

---

Top Contributors

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

---

Tags

criteriaexpressionphpspecification-patternpaginationfilterMatchcriteria

### Embed Badge

![Health badge](/badges/spaceonfire-criteria/health.svg)

```
[![Health](https://phpackages.com/badges/spaceonfire-criteria/health.svg)](https://phpackages.com/packages/spaceonfire-criteria)
```

###  Alternatives

[clue/stream-filter

A simple and modern approach to stream filtering in PHP

1.7k261.7M7](/packages/clue-stream-filter)[webmozart/expression

Implementation of the Specification pattern and logical expressions for PHP.

214382.0k11](/packages/webmozart-expression)[laminas/laminas-filter

Programmatically filter and normalize data and files

9428.0M150](/packages/laminas-laminas-filter)[mongerinc/search-request

Represent complex search queries and convert them to and from JSON

252.1k](/packages/mongerinc-search-request)[rollerworks/search-bundle

RollerworksSearch Bundle

1015.8k1](/packages/rollerworks-search-bundle)

PHPackages © 2026

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