1 | <?php |
||
25 | class Capacity extends Abstraction implements Simulator |
||
26 | { |
||
27 | /** |
||
28 | * Original XML value |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $capacityRaw; |
||
33 | |||
34 | /** |
||
35 | * Capacity in bytes. |
||
36 | * |
||
37 | * @var int|float |
||
38 | */ |
||
39 | protected $capacityBytes; |
||
40 | |||
41 | /** |
||
42 | * Setup the the Cleaner. |
||
43 | * |
||
44 | * @see \phpbu\App\Backup\Cleanup::setup() |
||
45 | * @param array $options |
||
46 | * @throws \phpbu\App\Backup\Cleaner\Exception |
||
47 | */ |
||
48 | 9 | public function setup(array $options) |
|
61 | |||
62 | /** |
||
63 | * Return list of files to delete. |
||
64 | * |
||
65 | * @param \phpbu\App\Backup\Target $target |
||
66 | * @param \phpbu\App\Backup\Collector $collector |
||
67 | * @return \phpbu\App\Backup\File[] |
||
68 | * @throws \phpbu\App\Exception |
||
69 | */ |
||
70 | 6 | protected function getFilesToDelete(Target $target, Collector $collector) |
|
102 | |||
103 | /** |
||
104 | * Is a given size bigger than the configured capacity limit. |
||
105 | * |
||
106 | * @param int|double $currentCapacity |
||
107 | * @return bool |
||
108 | */ |
||
109 | 6 | protected function isCapacityExceeded($currentCapacity): bool |
|
113 | } |
||
114 |