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

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

arete/specification
===================

PHP Specification library.

80PHP

Since Oct 21Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Arete\\Specification
====================

[](#aretespecification)

[![Build Status](https://camo.githubusercontent.com/dc722c2b2d78663a47a0d950e75526fbae3195dc5eda13854a1b4f87a1368a82/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6172657465636f64652f73706563696669636174696f6e2e737667)](https://travis-ci.org/aretecode/specification)[![HHVM Status](https://camo.githubusercontent.com/b43013bd89a6f905458cf33084b5360362a8bf3feedb82a4acdc56503afe594d/687474703a2f2f6868766d2e683463632e64652f62616467652f61726574652f73706563696669636174696f6e2e737667)](http://hhvm.h4cc.de/package/arete/specification)[![Author](https://camo.githubusercontent.com/3167ade4cb3531f4f057ab12d8ce359bb4507da73819d2d780cfcf216cbe7b63/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406172657465636f64652d626c75652e737667)](https://twitter.com/aretecode)[![Latest Unstable Version](https://camo.githubusercontent.com/5a088a79c7cf083fa9d5cfd61a6e2da9c45f3bd07333018fa28d5b34c86f9719/68747470733a2f2f706f7365722e707567782e6f72672f61726574652f73706563696669636174696f6e2f762f756e737461626c65)](https://packagist.org/packages/arete/specification)[![License](https://camo.githubusercontent.com/40792c432281a1714cd745f4aff91567275c98c1d6abbb91357f7d06a8108abf/68747470733a2f2f706f7365722e707567782e6f72672f61726574652f73706563696669636174696f6e2f6c6963656e7365)](http://packagist.org/packages/arete/specification)[![Codacy Badge](https://camo.githubusercontent.com/5322a10c746514ce57d7786c5a4bfcf2c5bfb9553abbdfc104934c9cedaa3891/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f3261303065356462386531343434666138346138313565383235303536303439)](https://www.codacy.com/app/aretecode/specification)

Specification library in PHP.

[Eric Evans &amp; Martin Fowlers paper on Specifications](http://martinfowler.com/apsupp/spec.pdf)

[Example](https://github.com/aretecode/specification/blob/master/examples)
==========================================================================

[](#example)

See my post on refactoring

A post detailing the usage in more detail will be available soon.

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

[](#installation)

It can be installed from [Packagist](https://packagist.org/arete/specification) using [Composer](https://getcomposer.org/).

In your project root just run:

`$ composer require arete/specification`

Make sure that you’ve set up your project to [autoload Composer-installed packages](https://getcomposer.org/doc/00-intro.md#autoloading).

Running tests
-------------

[](#running-tests)

Run via the command line by going to `arete/specification` directory and running `phpunit`

@TODO
-----

[](#todo)

- ::remainderUnsatisfiedBy()
- ::isGeneralizationOf()
- ::isSpecializationOf()
- ::asQuery() for use with db, whether it uses argument, or sep methods
- abstract part of the Collection Pipeline matching into default/premades

### P.S.

[](#ps)

(I have had this written since I read the DDD books, I updated it a little and just found an old one by [@mathiasverraes](https://github.com/mathiasverraes/DomainTools) which was interesting!)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![aretecode](https://avatars.githubusercontent.com/u/4022631?v=4)](https://github.com/aretecode "aretecode (11 commits)")

### Embed Badge

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

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

###  Alternatives

[roave/psalm-html-output

Psalm HTML Output

23312.0k1](/packages/roave-psalm-html-output)[flarum/nicknames

Allow users to set nicknames.

10288.4k9](/packages/flarum-nicknames)[cryde/json-text-extractor

Helper that will extract JSON from plain text

128.1k](/packages/cryde-json-text-extractor)

PHPackages © 2026

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