SkillAgentSearch skills...

Specification

Implementation of the specification pattern in PHP

Install / Use

/learn @rikbruil/Specification
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Specification

Build Status Coverage Status Latest Stable Version License SensioLabsInsight

PHP implementation of the Specification pattern

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

  • PHP 5.3+

License

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

Related Skills

View on GitHub
GitHub Stars18
CategoryProduct
Updated2y ago
Forks3

Languages

PHP

Security Score

75/100

Audited on Sep 13, 2023

No findings