arete/specification

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

PHP Specification library.

dev-master / 0.3.4.x-dev 2015-10-21 19:27 UTC

This package is not auto-updated.

Last update: 2021-09-08 03:39:52 UTC


README

Build Status HHVM Status Author Latest Unstable Version License Codacy Badge

Specification library in PHP.

Eric Evans & Martin Fowlers paper on Specifications

Example

See my post on refactoring

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

Installation

It can be installed from Packagist using Composer.

In your project root just run:

$ composer require arete/specification

Make sure that you’ve set up your project to autoload Composer-installed packages.

Running tests

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

@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.

(I have had this written since I read the DDD books, I updated it a little and just found an old one by @mathiasverraes which was interesting!)