| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | public function handle(): int |
||
| 45 | { |
||
| 46 | $data = [ |
||
| 47 | 'event' => $this->argument('event'), |
||
| 48 | 'url' => $this->argument('url'), |
||
| 49 | 'enabled' => !(bool)$this->option('disabled') |
||
| 50 | ]; |
||
| 51 | |||
| 52 | try { |
||
| 53 | $this->subscriberRepository->create($data); |
||
| 54 | } catch (ValidationException $e) { |
||
| 55 | foreach ($e->errors() as $message) { |
||
| 56 | $this->output->error($message); |
||
| 57 | } |
||
| 58 | |||
| 59 | return 1; |
||
| 60 | } |
||
| 61 | |||
| 62 | return 0; |
||
| 63 | } |
||
| 65 |