| 1 | <?php | ||
| 7 | class UnmetSpecificationException extends \RuntimeException implements \Countable | ||
| 8 | { | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @var Specification[] | ||
| 12 | */ | ||
| 13 | private $specifications = []; | ||
| 14 | |||
| 15 | /** | ||
| 16 | * @inheritDoc | ||
| 17 | */ | ||
| 18 | public function __construct(Specification ...$specifications) | ||
| 23 | |||
| 24 | /** | ||
| 25 | * @param Specification[] ...$specifications | ||
| 26 | * @return UnmetSpecificationException | ||
| 27 | */ | ||
| 28 | public static function createFor(Specification ...$specifications): self | ||
| 32 | |||
| 33 | /** | ||
| 34 | * @param Specification[] ...$specifications | ||
| 35 | * @return UnmetSpecificationException | ||
| 36 | */ | ||
| 37 | public function withUnmetSpecifications(Specification ...$specifications): self | ||
| 47 | |||
| 48 | /** | ||
| 49 | * @return Specification[] | ||
| 50 | */ | ||
| 51 | public function getUnmetSpecifications(): array | ||
| 55 | |||
| 56 | /** | ||
| 57 | * @throws UnmetSpecificationException | ||
| 58 | */ | ||
| 59 | public function throwIfUnmet() | ||
| 65 | |||
| 66 | /** | ||
| 67 | * @inheritDoc | ||
| 68 | */ | ||
| 69 | public function count(): int | ||
| 73 | } | ||
| 74 |