PHPackages                             fragoe/php-specifications - 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. fragoe/php-specifications

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

fragoe/php-specifications
=========================

Specification pattern by Eric Evans and Martin Fowler (2002, "Specifications", martinfowler.com/apsupp/spec.pdf).

v0.1.0(1mo ago)00MITPHPPHP ^8.1CI passing

Since Apr 12Pushed 1mo agoCompare

[ Source](https://github.com/fragoe/php-specifications)[ Packagist](https://packagist.org/packages/fragoe/php-specifications)[ RSS](/packages/fragoe-php-specifications/feed)WikiDiscussions main Synced 1w ago

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

php-specifications
==================

[](#php-specifications)

[![Tests](https://github.com/fragoe/php-specifications/actions/workflows/tests.yml/badge.svg)](https://github.com/fragoe/php-specifications/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/33b9fdfebe6b57b01dd2311f9725b9904c09b756e2acb06c4f075dc18cfbcfd7/68747470733a2f2f636f6465636f762e696f2f67682f667261676f652f7068702d73706563696669636174696f6e732f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/fragoe/php-specifications)[![PHP Version](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)](https://www.php.net/)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

A PHP implementation of the [Specification pattern](https://martinfowler.com/apsupp/spec.pdf) by Eric Evans and Martin Fowler (2002).

Specifications are business rules represented as predicates. Composable specifications can be combined using logical operators (`and`, `or`, `xor`, `not`).

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

[](#requirements)

- PHP ^8.1

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

[](#installation)

```
composer require fragoe/php-specifications
```

Usage
-----

[](#usage)

Use `Specification` when you only need a simple predicate with one method (`isSatisfiedBy()`).

Use `ComposableSpecification` for fluent composition methods (`and()`, `or()`, `xor()`, `not()`). In most cases, extend `AbstractComposableSpecification` to get those methods by default.

See the [tests](tests/) for practical examples.

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

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for compatibility policy details.

License
-------

[](#license)

MIT

###  Health Score

33

—

LowBetter than 73% of packages

Maintenance89

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

58d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61689501?v=4)[Frank Göldner](/maintainers/fragoe)[@fragoe](https://github.com/fragoe)

---

Top Contributors

[![fragoe](https://avatars.githubusercontent.com/u/61689501?v=4)](https://github.com/fragoe "fragoe (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fragoe-php-specifications/health.svg)

```
[![Health](https://phpackages.com/badges/fragoe-php-specifications/health.svg)](https://phpackages.com/packages/fragoe-php-specifications)
```

###  Alternatives

[yieldstudio/tailwind-merge-php

Merge Tailwind CSS classes without style conflicts

4974.6k1](/packages/yieldstudio-tailwind-merge-php)[access-manager/access-manager

The Hotspot Management System

605.2k](/packages/access-manager-access-manager)

PHPackages © 2026

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