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