Conditions | 3 |
Paths | 11 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function handle() |
||
30 | { |
||
31 | consoleOutput()->comment('Starting cleanup...'); |
||
|
|||
32 | |||
33 | $disableNotifications = $this->option('disable-notifications'); |
||
34 | |||
35 | try { |
||
36 | $config = config('backup'); |
||
37 | |||
38 | $backupDestinations = BackupDestinationFactory::createFromArray($config['backup']); |
||
39 | |||
40 | $cleanupJob = new CleanupJob($backupDestinations, $this->strategy, $disableNotifications); |
||
41 | |||
42 | $cleanupJob->run(); |
||
43 | |||
44 | consoleOutput()->comment('Cleanup completed!'); |
||
45 | } catch (Exception $exception) { |
||
46 | if (! $disableNotifications) { |
||
47 | event(new CleanupHasFailed($exception)); |
||
48 | } |
||
49 | |||
50 | return 1; |
||
51 | } |
||
52 | } |
||
53 | } |
||
54 |
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: