| Conditions | 2 |
| Paths | 3 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | protected function initializeDataArgument(InputInterface $input): void |
||
| 34 | { |
||
| 35 | try { |
||
| 36 | $json = (string) $input->getArgument('data'); |
||
| 37 | $data = \json_decode($json, true, 512, \JSON_THROW_ON_ERROR); |
||
| 38 | $this->data = $data; |
||
| 39 | } catch (\Exception $e) { |
||
| 40 | throw new InvalidArgumentException('Data is not a valid JSON.'); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 |