| Conditions | 4 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function has(string $a, string $b, bool $areMutuallyExclusive): bool |
||
| 23 | { |
||
| 24 | $first = $this->data[$a] ?? null; |
||
| 25 | $result = null !== $first && ($first[$b] ?? null); |
||
| 26 | |||
| 27 | if (null === $result) { |
||
|
|
|||
| 28 | return false; |
||
| 29 | } |
||
| 30 | |||
| 31 | // areMutuallyExclusive being false is a superset of being true, |
||
| 32 | // hence if we want to know if this PairSet "has" these two with no |
||
| 33 | // exclusivity, we have to ensure it was added as such. |
||
| 34 | if ($areMutuallyExclusive === false) { |
||
| 35 | return $result === false; |
||
| 36 | } |
||
| 37 | |||
| 38 | return true; |
||
| 39 | } |
||
| 69 |