Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.3332 |
Changes | 0 |
1 | <?php |
||
37 | 2 | public function handle() |
|
38 | { |
||
39 | 2 | $id = $this->option('id'); |
|
40 | 2 | $log = ModelLog::find($id); |
|
41 | 2 | if (! $id) { |
|
42 | $this->error('Log not found!'); |
||
43 | |||
44 | return; |
||
45 | } |
||
46 | |||
47 | 2 | $revert = model_event_revert($log); |
|
48 | 2 | if (! $revert['status']) { |
|
49 | $this->error($revert['message']); |
||
50 | |||
51 | return; |
||
52 | } |
||
53 | 2 | $this->info("Model Event #$log->id has been reverted successfully"); |
|
54 | 2 | } |
|
55 | } |
||
56 |
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.