Conditions | 4 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
14 | public static function createForBackupDestinationStatus(BackupDestinationStatus $backupDestinationStatus) |
||
15 | { |
||
16 | if (!$backupDestinationStatus->isReachable()) { |
||
17 | return "Could not reach {$backupDestinationStatus->getFilesystemName()}-filesystem because: {$backupDestinationStatus->getConnectionError()}"; |
||
18 | } |
||
19 | |||
20 | $messages = []; |
||
21 | if ($backupDestinationStatus->backupUsesTooMuchStorage()) { |
||
22 | $messages[] = "The backup uses {$backupDestinationStatus->getHumanReadableUsedStorage()} which is more than the allowed {$backupDestinationStatus->getHumanReadableAllowedStorage()}."; |
||
23 | } |
||
24 | |||
25 | if ($backupDestinationStatus->newestBackupIsToolOld()) { |
||
26 | $messages[] = 'The newest backup is older than '.$backupDestinationStatus->getMaximumAgeOfNewestBackupInDays().'day(s).'; |
||
27 | } |
||
28 | |||
29 | return implode(' ', $messages); |
||
30 | } |
||
31 | } |
||
32 |