PHPackages                             atyagi/specifier - 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. atyagi/specifier

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

atyagi/specifier
================

A library to help implement the specification design pattern

v1.0.0(10y ago)021MITPHP

Since Jun 28Pushed 10y agoCompare

[ Source](https://github.com/atyagi/specifier)[ Packagist](https://packagist.org/packages/atyagi/specifier)[ RSS](/packages/atyagi-specifier/feed)WikiDiscussions master Synced 1w ago

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

Specifier
=========

[](#specifier)

[![Build Status](https://camo.githubusercontent.com/d0a36189663f431ac6dddd8bad88032856662a6efeb63738d0f62b0f7f0e30da/68747470733a2f2f7472617669732d63692e6f72672f6174796167692f7370656369666965722e737667)](https://travis-ci.org/atyagi/specifier)[![Coverage Status](https://camo.githubusercontent.com/8658c306365a63f53a6f99a0426f46124484f0e30802321dd23162a127a0b80f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6174796167692f7370656369666965722f62616467652e737667)](https://coveralls.io/r/atyagi/specifier)[![Latest Version](https://camo.githubusercontent.com/16e52ef33e5038406ef75c536843f12ed45739522fbeeb5637dd8a25ac02a1df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6174796167692f7370656369666965722e737667)](https://packagist.org/packages/atyagi/specifier)

Provides a basic set of classes to utilize the specification design pattern.

Usage
=====

[](#usage)

The included tests provide common usage of the classes.

Basic Usage
-----------

[](#basic-usage)

Upon creating your specification classes, simply extend the `AbstractSpecification` class and implement the `isSatisfiedBy` method.

Any specifications that you create are flexible enough to take in any arguments in the constructor, such as repositories or services.

In addition, an `isNotSatisfiedBy` method is provided to provide a logical not if needed.

Composite Usage
---------------

[](#composite-usage)

When you need to chain multiple specifications on the same object, you can leverage the `AbstractSpecification` chain methods `plus` and `either`.

For example:

```
(new CustomerIsPremium())
    ->either(new CustomerRegisteredBeforeLastWeek())
    ->isSatisfiedBy($customer);
```

or

```
(new CustomerIsPremium())
    ->plus(new CustomerRegisteredBeforeLastWeek())
    ->isSatisfiedBy($customer);
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3999d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50353d5f0b551fd129fc17b72ab2ee993ed528736b31fc52a526acd5553d43ba?d=identicon)[atyagi](/maintainers/atyagi)

---

Top Contributors

[![atyagi](https://avatars.githubusercontent.com/u/1316495?v=4)](https://github.com/atyagi "atyagi (6 commits)")

---

Tags

specificationDomain Driven Designdesign patterns

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/atyagi-specifier/health.svg)

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

###  Alternatives

[phpmentors/domain-kata

Kata for domain models

73441.4k9](/packages/phpmentors-domain-kata)[thejano/laravel-domain-driven-design

Helps to use domain driven design within laravel

15424.8k](/packages/thejano-laravel-domain-driven-design)[imanghafoori/laravel-decorator

A package to easily decorate your function calls.

13913.5k](/packages/imanghafoori-laravel-decorator)[rikbruil/specification

A PHP implementation of the Specification-pattern

18289.8k1](/packages/rikbruil-specification)[phpmentors/domain-commons

Commons for domain models

11298.7k](/packages/phpmentors-domain-commons)[maximecolin/satisfaction

A PHP implementation of the specification pattern for DDD

3530.5k](/packages/maximecolin-satisfaction)

PHPackages © 2026

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