1 | <?php |
||
10 | class BackupDestinationStatus |
||
11 | { |
||
12 | /** @var \Spatie\Backup\BackupDestination\BackupDestination */ |
||
13 | protected $backupDestination; |
||
14 | |||
15 | /** @var int */ |
||
16 | protected $maximumAgeOfNewestBackupInDays = 1; |
||
17 | |||
18 | /** @var int */ |
||
19 | protected $maximumStorageUsageInMegabytes = 5000; |
||
20 | |||
21 | /** @var string */ |
||
22 | protected $diskName; |
||
23 | |||
24 | /** @var bool */ |
||
25 | protected $reachable; |
||
26 | |||
27 | /** @var array */ |
||
28 | protected $inspections; |
||
29 | |||
30 | /** @var HealthInspectionFailure|null */ |
||
31 | protected $failedInspection; |
||
32 | |||
33 | public function __construct(BackupDestination $backupDestination, string $diskName, array $inspections = []) |
||
41 | |||
42 | public function setMaximumAgeOfNewestBackupInDays(int $days): self |
||
48 | |||
49 | public function maximumAgeOfNewestBackupInDays(): int |
||
53 | |||
54 | public function setMaximumStorageUsageInMegabytes(float $megabytes): self |
||
60 | |||
61 | public function backupName(): string |
||
65 | |||
66 | public function diskName(): string |
||
70 | |||
71 | public function amountOfBackups(): int |
||
75 | |||
76 | public function dateOfNewestBackup(): ?Carbon |
||
86 | |||
87 | public function newestBackupIsTooOld(): bool |
||
97 | |||
98 | public function usedStorage(): int |
||
102 | |||
103 | public function connectionError(): Exception |
||
107 | |||
108 | public function isReachable(): bool |
||
112 | |||
113 | public function maximumAllowedUsageInBytes(): int |
||
117 | |||
118 | public function usesTooMuchStorage(): bool |
||
128 | |||
129 | public function isHealthy(): bool |
||
149 | |||
150 | public function humanReadableAllowedStorage(): string |
||
160 | |||
161 | public function humanReadableUsedStorage(): string |
||
165 | |||
166 | public function backupDestination(): BackupDestination |
||
170 | |||
171 | public function getFailedInspection() |
||
175 | |||
176 | protected function failsInspections() |
||
182 | |||
183 | protected function runInspections() |
||
199 | } |
||
200 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.