| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 13 | final class KeyMatches implements Satisfiable |
||
| 14 | { |
||
| 15 | private $key; |
||
| 16 | private $value; |
||
| 17 | |||
| 18 | private function __construct(string $key, $value) |
||
| 19 | { |
||
| 20 | $this->key = $key; |
||
| 21 | $this->value = $value; |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Produces a constraint that is satisfied with data that contains this |
||
| 26 | * particular key/value pair. |
||
| 27 | * |
||
| 28 | * @param string $key The key to look for. |
||
| 29 | * @param mixed $value The value that is expected. |
||
| 30 | * @return Satisfiable The constraint. |
||
| 31 | */ |
||
| 32 | public static function with(string $key, $value): Satisfiable |
||
| 33 | { |
||
| 34 | return new self($key, $value); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** @inheritdoc */ |
||
| 38 | public function isSatisfiedBy($knownData): bool |
||
| 41 | } |
||
| 42 | } |
||
| 43 |