mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-30 11:40:13 +02:00
16 lines
343 B
PHP
16 lines
343 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);
|
|
}
|
|
}
|