1 | <?php |
||
10 | class CacheValidator |
||
11 | { |
||
12 | /** |
||
13 | * Where to store cache files |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | private $cacheDir; |
||
18 | |||
19 | private $translationRepository; |
||
20 | |||
21 | /** |
||
22 | * Checks the caching files of they are even with the stasher content |
||
23 | * |
||
24 | * @return bool |
||
25 | */ |
||
26 | 2 | public function isCacheFresh() |
|
37 | |||
38 | /** |
||
39 | * Get the last updated or inserted from all database translations |
||
40 | * |
||
41 | * @return DateTime last createdAt or updateAt date from the translations stash |
||
42 | */ |
||
43 | 2 | public function getLastTranslationChangeDate() |
|
47 | |||
48 | /** |
||
49 | * Retrieve a Datetime of the oldest cache file made |
||
50 | * |
||
51 | * @return DateTime mtime of oldest cache file |
||
52 | */ |
||
53 | 4 | public function getOldestCachefileDate() |
|
76 | |||
77 | 4 | public function setCacheDir($cacheDir) |
|
81 | |||
82 | public function setLogger($logger) |
||
86 | |||
87 | 4 | public function setTranslationRepository($translationRepository) |
|
91 | } |
||
92 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: