Conditions | 2 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php namespace Arcanesoft\Backups\Services; |
||
73 | public static function clearBackups() |
||
74 | { |
||
75 | try { |
||
76 | $config = config('laravel-backup'); |
||
77 | |||
78 | $backupDestinations = BackupDestinationFactory::createFromArray($config['backup']); |
||
79 | |||
80 | $strategy = app($config['cleanup']['strategy']); |
||
81 | |||
82 | $disableNotification = false; // TODO: Create a config for this |
||
83 | |||
84 | (new CleanupJob($backupDestinations, $strategy, $disableNotification))->run(); |
||
85 | } |
||
86 | catch (\Exception $ex) { |
||
87 | return false; |
||
88 | } |
||
89 | |||
90 | return true; |
||
91 | } |
||
92 | } |
||
93 |