mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-03 21:18:11 +02:00
23 lines
453 B
PHP
23 lines
453 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Behavioral\Specification;
|
|
|
|
class NotSpecification implements Specification
|
|
{
|
|
/**
|
|
* @var Specification
|
|
*/
|
|
private $specification;
|
|
|
|
public function __construct(Specification $specification)
|
|
{
|
|
$this->specification = $specification;
|
|
}
|
|
|
|
public function isSatisfiedBy(Item $item): bool
|
|
{
|
|
return !$this->specification->isSatisfiedBy($item);
|
|
}
|
|
}
|