Conditions | 3 |
Paths | 8 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | public function handle() |
||
44 | { |
||
45 | try { |
||
46 | $id = $this->argument('id') ? $this->argument('id') : $this->askForArticles(); |
||
47 | $article = Article::findOrFail($id); |
||
48 | $article->delete(); |
||
49 | } catch (Exception $e) { |
||
50 | $this->error('Error'); |
||
51 | } |
||
52 | $this->info('Article has been deleted to database succesfully'); |
||
53 | } |
||
54 | } |
||
55 |
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.