PHPackages                             stratadox/specification - 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. stratadox/specification

ActiveLibrary[Search &amp; Filtering](/categories/search)

stratadox/specification
=======================

An implementation of the Specification Pattern for Php7

v1.0.2(8y ago)13434MITPHPPHP &gt;=7.0

Since Sep 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Stratadox/Specification)[ Packagist](https://packagist.org/packages/stratadox/specification)[ RSS](/packages/stratadox-specification/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (4)Used By (4)

Specification
=============

[](#specification)

[![Build Status](https://camo.githubusercontent.com/9ded4431e62b56f5c5b7a7776bc83da6bcde4d21b6833fe1e74397302b9b4c25/68747470733a2f2f7472617669732d63692e6f72672f537472617461646f782f53706563696669636174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Stratadox/Specification)[![Coverage Status](https://camo.githubusercontent.com/b25cb489ca1de36458878aca48759e813f63953b80312a619ee382c357c87173/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f537472617461646f782f53706563696669636174696f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Stratadox/Specification?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e3611d582495ca6ebdcfea0c39210614d95eea0624e95295a4144125cc7b0cd3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f537472617461646f782f53706563696669636174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Stratadox/Specification/?branch=master)

An implementation of the Specification pattern for Php7

Installation
------------

[](#installation)

Install using composer:

```
composer require stratadox/specification

```

Usage Sample
------------

[](#usage-sample)

```
// The business logic
$allBoxes = CollectionOfBoxes::containing(
    Box::ofWeight(1),
    Box::ofWeight(2),
    Box::ofWeight(3),
    Box::ofWeight(5),
    Box::ofWeight(12),
    Box::ofWeight(26)
);
$weighBetween2and10 = AreHeavier::than(2)->and(AreLighter::than(10));
$this->assertEquals(
    CollectionOfBoxes::containing(
        Box::ofWeight(3),
        Box::ofWeight(5),
        Box::ofWeight(26)
    ),
    $allBoxes->that($weighBetween2and10->or(AreHeavier::than(20)))
);
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3063d ago

### Community

Maintainers

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

---

Top Contributors

[![Stratadox](https://avatars.githubusercontent.com/u/5333260?v=4)](https://github.com/Stratadox "Stratadox (28 commits)")

---

Tags

specificationfilterdddselectpatternfiltersselectorPHP7conditionSpecificationssatisfiedstratadoxsatisfiablesatisfyingsatisfiedByisSatisfiedByspecifierspecifying

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stratadox-specification/health.svg)

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

###  Alternatives

[clue/stream-filter

A simple and modern approach to stream filtering in PHP

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

Programmatically filter and normalize data and files

9428.0M148](/packages/laminas-laminas-filter)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)[optimistdigital/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45305.4k](/packages/optimistdigital-nova-multiselect-filter)[millat/laravel-hooks

The WordPress filter, action system in Laravel

5715.1k](/packages/millat-laravel-hooks)[maximecolin/satisfaction

A PHP implementation of the specification pattern for DDD

3630.2k](/packages/maximecolin-satisfaction)

PHPackages © 2026

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