Conditions | 4 |
Paths | 20 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 8 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
22 | public function handle() |
||
23 | { |
||
24 | consoleOutput()->comment('Starting backup.'); |
||
|
|||
25 | |||
26 | try { |
||
27 | $this->guardAgainstInvalidOptions(); |
||
28 | |||
29 | $backupJob = BackupJobFactory::createFromArray(config('laravel-backup')); |
||
30 | |||
31 | if ($this->option('only-db')) { |
||
32 | $backupJob->doNotBackupFilesystem(); |
||
33 | } |
||
34 | |||
35 | if ($this->option('only-files')) { |
||
36 | $backupJob->doNotBackupDatabases(); |
||
37 | } |
||
38 | |||
39 | $backupJob->run(); |
||
40 | |||
41 | consoleOutput()->comment('Backup completed!'); |
||
42 | } catch (Exception $exception) { |
||
43 | event(new BackupHasFailed($exception)); |
||
44 | |||
45 | throw $exception; |
||
46 | } |
||
47 | } |
||
48 | |||
56 |
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: