mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-07 15:05:38 +02:00
22 lines
455 B
PHP
22 lines
455 B
PHP
<?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);
|
|
}
|
|
}
|