mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-09 08:26:44 +02:00
PHP7 Specification
This commit is contained in:
21
Behavioral/Specification/NotSpecification.php
Normal file
21
Behavioral/Specification/NotSpecification.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user