| Conditions | 5 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | public function handle() |
||
| 44 | { |
||
| 45 | try { |
||
| 46 | Article::create([ |
||
| 47 | 'title' => $this->argument('title') ? $this->argument('title') : $this->ask('Article title?'), |
||
| 48 | 'user_id' => $this->argument('user_id') ? $this->argument('user_id') : $this->askForUsers(), |
||
| 49 | 'description' => $this->argument('description') ? $this->argument('description') : $this->ask('Article description?'), |
||
| 50 | 'read' => false, |
||
| 51 | ]); |
||
| 52 | } catch (Exception $e) { |
||
| 53 | $this->error('Error'); |
||
| 54 | } |
||
| 55 | $this->info('Article 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.