Conditions | 6 |
Paths | 9 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function addRange($fromValue = null, $toValue = null, ?string $key = null): self |
||
28 | { |
||
29 | if (null === $fromValue && null === $toValue) { |
||
30 | throw new InvalidException('Either fromValue or toValue must be set. Both cannot be null.'); |
||
31 | } |
||
32 | |||
33 | $range = []; |
||
34 | |||
35 | if (null !== $fromValue) { |
||
36 | $range['from'] = $fromValue; |
||
37 | } |
||
38 | |||
39 | if (null !== $toValue) { |
||
40 | $range['to'] = $toValue; |
||
41 | } |
||
42 | |||
43 | if (null !== $key) { |
||
44 | $range['key'] = $key; |
||
45 | } |
||
46 | |||
47 | return $this->addParam('ranges', $range); |
||
48 | } |
||
49 | |||
62 |