1 | <?php |
||
28 | class Stepwise extends Abstraction implements Cleaner |
||
29 | { |
||
30 | /** |
||
31 | * Amount of days to keep all backups. |
||
32 | * |
||
33 | * @var int |
||
34 | */ |
||
35 | protected $daysToKeepAll; |
||
36 | |||
37 | /** |
||
38 | * Amount of days to keep at least one backup per day. |
||
39 | * |
||
40 | * @var int |
||
41 | */ |
||
42 | protected $daysToKeepDaily; |
||
43 | |||
44 | /** |
||
45 | * Amount of weeks to keep at least one backup per week. |
||
46 | * |
||
47 | * @var int |
||
48 | */ |
||
49 | protected $weeksToKeepWeekly; |
||
50 | |||
51 | /** |
||
52 | * Amount of month to keep at least one backup per month. |
||
53 | * |
||
54 | * @var int |
||
55 | */ |
||
56 | protected $monthToKeepMonthly; |
||
57 | |||
58 | /** |
||
59 | * Amount of years to keep at least one backup per year. |
||
60 | * |
||
61 | * @var int |
||
62 | */ |
||
63 | protected $yearsToKeepYearly; |
||
64 | |||
65 | /** |
||
66 | * List of ranges defined by the configured settings. |
||
67 | * |
||
68 | * @var \phpbu\App\Backup\Cleaner\Stepwise\Range[] |
||
69 | */ |
||
70 | protected $ranges; |
||
71 | |||
72 | /** |
||
73 | * Setup the Cleaner. |
||
74 | * |
||
75 | * @see \phpbu\App\Backup\Cleanup::setup() |
||
76 | * @param array $options |
||
77 | * @throws \phpbu\App\Backup\Cleaner\Exception |
||
78 | */ |
||
79 | public function setup(array $options) |
||
89 | |||
90 | /** |
||
91 | * Setup the date ranges. |
||
92 | */ |
||
93 | protected function setupRanges() |
||
121 | |||
122 | /** |
||
123 | * Return list of files to delete. |
||
124 | * |
||
125 | * @param \phpbu\App\Backup\Target $target |
||
126 | * @param \phpbu\App\Backup\Collector $collector |
||
127 | * @return \phpbu\App\Backup\File[] |
||
128 | * @throws \phpbu\App\Exception |
||
129 | */ |
||
130 | protected function getFilesToDelete(Target $target, Collector $collector) |
||
146 | |||
147 | /** |
||
148 | * Get matching range for given file. |
||
149 | * |
||
150 | * @param \phpbu\App\Backup\File $file |
||
151 | * @return \phpbu\App\Backup\Cleaner\Stepwise\Range |
||
152 | * @throws \phpbu\App\Backup\Cleaner\Exception |
||
153 | */ |
||
154 | protected function getRangeForFile(File $file) : Range |
||
163 | } |
||
164 |
It seems like you are relying on a variable being defined by an iteration: