Total Complexity | 4 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | trait FileModificationTimeCacheValidatorTrait |
||
12 | { |
||
13 | /** |
||
14 | * An array mapping the file name to its latest modification date. |
||
15 | * |
||
16 | * @var array<string, int> |
||
17 | */ |
||
18 | protected $trackedFiles = []; |
||
19 | |||
20 | /** |
||
21 | * Adds a file to track. |
||
22 | * All files must not have changed for the cache to be valid. |
||
23 | * |
||
24 | * @param string $fileName |
||
25 | */ |
||
26 | public function addTrackedFile(string $fileName): void |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Returns true if this item is valid (coming out of cache), false otherwise. |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | public function isValid(): bool |
||
46 |