Conditions | 6 |
Paths | 8 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
48 | public function handle() |
||
49 | { |
||
50 | try { |
||
51 | $id = $this->argument('id') ? $this->argument('id') : $this->askForArticles(); |
||
52 | $article = Article::findOrFail($id); |
||
53 | $article->update([ |
||
54 | 'title' => $this->argument('title') ? $this->argument('title') : $this->ask('Article title?', $article->title), |
||
55 | 'description' => $this->argument('description') ? $this->argument('description') : $this->ask('Article description?', $article->description), |
||
56 | 'user_id' => $this->argument('user_id') ? $this->argument('user_id') : $this->askForUsers(), |
||
57 | ]); |
||
58 | } catch (Exception $e) { |
||
59 | $this->error('Error'); |
||
60 | } |
||
61 | $this->info('Article has been edited to database succesfully'); |
||
62 | } |
||
63 | } |
||
64 |
Adding a
@return
annotation 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.