PHP7 Specification

This commit is contained in:
Dominik Liebler
2016-09-22 12:54:03 +02:00
parent 09797dd553
commit ce1b53847d
12 changed files with 134 additions and 324 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace DesignPatterns\Behavioral\Specification;
class NotSpecification implements SpecificationInterface
{
/**
* @var SpecificationInterface
*/
private $specification;
public function __construct(SpecificationInterface $specification)
{
$this->specification = $specification;
}
public function isSatisfiedBy(Item $item): bool
{
return !$this->specification->isSatisfiedBy($item);
}
}