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