Conditions | 2 |
Paths | 7 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 11 | ||
Bugs | 2 | Features | 2 |
1 | <?php |
||
21 | public function handle() |
||
22 | { |
||
23 | consoleOutput()->comment('Starting cleanup.'); |
||
|
|||
24 | |||
25 | try { |
||
26 | $config = config('laravel-backup'); |
||
27 | |||
28 | $backupDestinations = BackupDestinationFactory::createFromArray($config['backup']); |
||
29 | |||
30 | $strategy = app($config['cleanup']['strategy']); |
||
31 | |||
32 | $cleanupJob = new CleanupJob($backupDestinations, $strategy); |
||
33 | |||
34 | $cleanupJob->run(); |
||
35 | |||
36 | consoleOutput()->comment('Cleanup completed!'); |
||
37 | } catch (Exception $exception) { |
||
38 | event(new CleanupHasFailed($exception)); |
||
39 | } |
||
40 | } |
||
41 | } |
||
42 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: