| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 33 | 4 | protected function validateArguments(Node ...$arguments): void |
|
| 34 | { |
||
| 35 | 4 | $argumentCount = \count($arguments); |
|
| 36 | 4 | if ($argumentCount < 2 || $argumentCount > 3) { |
|
| 37 | 2 | throw InvalidArgumentForVariadicFunctionException::between('date_subtract', 2, 3); |
|
| 38 | } |
||
| 39 | |||
| 40 | // Validate that the third parameter is a valid timezone if provided |
||
| 41 | 2 | if ($argumentCount === 3) { |
|
| 42 | 2 | $this->validateTimezone($arguments[2], 'DATE_SUBTRACT'); |
|
| 43 | } |
||
| 46 |