PHPackages                             rikbruil/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rikbruil/specification

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

rikbruil/specification
======================

A PHP implementation of the Specification-pattern

0.9.4(11y ago)18284.8k—2.5%31MITPHPPHP &gt;=5.3.3

Since Mar 8Pushed 11y ago3 watchersCompare

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

READMEChangelogDependencies (4)Versions (6)Used By (1)

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

[](#specification)

[![Build Status](https://camo.githubusercontent.com/39255f9a759b2d8690988c77ecc6cf70b0a8d273d570402002fd266a42e01366/68747470733a2f2f7472617669732d63692e6f72672f72696b627275696c2f73706563696669636174696f6e2e737667)](https://travis-ci.org/rikbruil/specification)[![Coverage Status](https://camo.githubusercontent.com/fc46b5699c27ffe19a563a80adcebe486fb8c0496028d0286954e139a5cccf1c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f72696b627275696c2f73706563696669636174696f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/rikbruil/specification?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/5110ba992022386e7255282314416c1e69e00d8dd6e047210215ad3ab5fa4913/68747470733a2f2f706f7365722e707567782e6f72672f72696b627275696c2f73706563696669636174696f6e2f762f737461626c652e737667)](https://packagist.org/packages/rikbruil/specification)[![License](https://camo.githubusercontent.com/114eaf2059b713f25e16ecb2994078aa46c8b63cadcdc2d4c80d98636522d465/68747470733a2f2f706f7365722e707567782e6f72672f72696b627275696c2f73706563696669636174696f6e2f6c6963656e73652e737667)](https://packagist.org/packages/rikbruil/specification)[![SensioLabsInsight](https://camo.githubusercontent.com/a1e34ee182487901ed3ae1e224180ab18a5edf00eb7ba408e3ea504f800cfe40/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31623234353462652d383332652d343038362d396636342d3735396631666635613038392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/1b2454be-832e-4086-9f64-759f1ff5a089)

PHP implementation of the [Specification pattern](http://en.wikipedia.org/wiki/Specification_pattern)

Usage
-----

[](#usage)

```
$overDue        = new OverDueSpecification();
$noticeSent     = new NoticeSentSpecification();
$inCollection   = new InCollectionSpecification();

// example of specification pattern logic chaining
$sendToCollection = $overDue->andX($noticeSent)
                            ->not($inCollection);

foreach ($service->getInvoices() as $currentInvoice) {
    if (! $sendToCollection->isSatisfiedBy($currentInvoice)) {
        continue;
    }

    $currentInvoice->sendToCollection();
}
```

Requirements
------------

[](#requirements)

- PHP 5.3+

License
-------

[](#license)

Specification is licensed under the MIT License - see the `LICENSE` file for details

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity52

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

Total

5

Last Release

4085d ago

PHP version history (2 changes)0.9PHP &gt;=5.5

0.9.1PHP &gt;=5.3.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e62694a3877b86ed64be69e7e8f332f3bfd6850bf2efe97ab254966b4f41fb2c?d=identicon)[rikbruil](/maintainers/rikbruil)

---

Top Contributors

[![rikbruil](https://avatars.githubusercontent.com/u/154175?v=4)](https://github.com/rikbruil "rikbruil (25 commits)")

---

Tags

specificationpattern

### Embed Badge

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

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

###  Alternatives

[league/pipeline

A plug and play pipeline implementation.

1.0k16.0M74](/packages/league-pipeline)[maximecolin/satisfaction

A PHP implementation of the specification pattern for DDD

3630.2k](/packages/maximecolin-satisfaction)[getsolaris/laravel-make-service

A MVCS pattern create a service command for Laravel 5+

81161.3k](/packages/getsolaris-laravel-make-service)[redeyeventures/geopattern

Generate beautiful SVG patterns.

11140.8k2](/packages/redeyeventures-geopattern)[functional-php/pattern-matching

Pattern matching for PHP with automatic destructuring.

8261.5k](/packages/functional-php-pattern-matching)[lezhnev74/pasvl

Array Validator (regular expressions for nested array, sort of)

5253.7k3](/packages/lezhnev74-pasvl)

PHPackages © 2026

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