| Total Complexity | 4 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class Range |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Start timestamp. |
||
| 21 | * |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | private $start; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * End timestamp. |
||
| 28 | * |
||
| 29 | * @var int |
||
| 30 | */ |
||
| 31 | private $end; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Keeper decides if file should be deleted. |
||
| 35 | * |
||
| 36 | * @var \phpbu\App\Backup\Cleaner\Stepwise\Keeper |
||
| 37 | */ |
||
| 38 | private $keeper; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Range constructor. |
||
| 42 | * |
||
| 43 | * @param int $start |
||
| 44 | * @param int $end |
||
| 45 | * @param \phpbu\App\Backup\Cleaner\Stepwise\Keeper $keeper |
||
| 46 | */ |
||
| 47 | 6 | public function __construct(int $start, int $end, Keeper $keeper) |
|
| 48 | { |
||
| 49 | 6 | $this->start = $start; |
|
| 50 | 6 | $this->end = $end; |
|
| 51 | 6 | $this->keeper = $keeper; |
|
| 52 | 6 | } |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Start timestamp getter. |
||
| 56 | * |
||
| 57 | * @return int |
||
| 58 | */ |
||
| 59 | 1 | public function getStart() : int |
|
| 60 | { |
||
| 61 | 1 | return $this->start; |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * End timestamp getter. |
||
| 66 | * |
||
| 67 | * @return int |
||
| 68 | */ |
||
| 69 | 4 | public function getEnd() : int |
|
| 70 | { |
||
| 71 | 4 | return $this->end; |
|
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Should this file be deleted. |
||
| 76 | * |
||
| 77 | * @param \phpbu\App\Backup\File $file |
||
| 78 | * @return bool |
||
| 79 | */ |
||
| 80 | 3 | public function keep(File $file) : bool |
|
| 83 | } |
||
| 84 | } |
||
| 85 |