| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 38 | public function execute(InputInterface $input, OutputInterface $output) |
||
| 39 | { |
||
| 40 | $type = $input->getArgument('type'); |
||
| 41 | $body = json_decode($input->getArgument('body'), true); |
||
| 42 | |||
| 43 | if (null === $body) { |
||
| 44 | throw new \InvalidArgumentException('Body does not contain valid json.'); |
||
| 45 | } |
||
| 46 | |||
| 47 | $this->getContainer() |
||
| 48 | ->get('sonata.notification.backend') |
||
| 49 | ->createAndPublish($type, $body) |
||
| 50 | ; |
||
| 51 | |||
| 52 | $output->writeln('<info>Done !</info>'); |
||
| 53 | } |
||
| 54 | } |
||
| 55 |