| Conditions | 5 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | public function handle() |
||
| 45 | { |
||
| 46 | try { |
||
| 47 | Event::create([ |
||
| 48 | 'name' => $this->argument('name') ? $this->argument('name') : $this->ask('Event name?'), |
||
| 49 | 'user_id' => $this->argument('user_id') ? $this->argument('user_id') : $this->ask('User id?'), |
||
| 50 | 'description' => $this->argument('description') ? $this->argument('description') : $this->ask('Event description?') |
||
| 51 | ]); |
||
| 52 | } catch ( Exception $e) { |
||
| 53 | $this->error('Error'); |
||
| 54 | } |
||
| 55 | $this->info('Event has been added to database succesfully'); |
||
| 56 | } |
||
| 57 | } |
||
| 58 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.