mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 01:32:22 +01:00
19 lines
425 B
PHP
19 lines
425 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Behavioral\Specification;
|
|
|
|
class NotSpecification implements Specification
|
|
{
|
|
private Specification $specification;
|
|
|
|
public function __construct(Specification $specification)
|
|
{
|
|
$this->specification = $specification;
|
|
}
|
|
|
|
public function isSatisfiedBy(Item $item): bool
|
|
{
|
|
return !$this->specification->isSatisfiedBy($item);
|
|
}
|
|
}
|