1 | <?php |
||
20 | class LocationAwareStore extends Store implements ContentPurger |
||
21 | { |
||
22 | const LOCATION_CACHE_DIR = 'ezlocation'; |
||
23 | const LOCATION_STALE_CACHE_DIR = 'ezlocation_stale'; |
||
24 | |||
25 | /** |
||
26 | * @var \Symfony\Component\Filesystem\Filesystem |
||
27 | */ |
||
28 | private $fs; |
||
29 | |||
30 | /** |
||
31 | * Injects a Filesystem instance |
||
32 | * For unit tests only. |
||
33 | * |
||
34 | * @internal |
||
35 | * |
||
36 | * @param \Symfony\Component\Filesystem\Filesystem $fs |
||
37 | */ |
||
38 | public function setFilesystem(Filesystem $fs) |
||
42 | |||
43 | /** |
||
44 | * @return \Symfony\Component\Filesystem\Filesystem |
||
45 | */ |
||
46 | public function getFilesystem() |
||
54 | |||
55 | /** |
||
56 | * Injects eZ Publish specific information in the content digest if needed. |
||
57 | * X-Location-Id response header is set in the ViewController. |
||
58 | * |
||
59 | * @see \eZ\Publish\Core\MVC\Symfony\Controller\Content\ViewController::viewLocation() |
||
60 | * |
||
61 | * @param \Symfony\Component\HttpFoundation\Response $response |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | protected function generateContentDigest(Response $response) |
||
74 | |||
75 | /** |
||
76 | * Returns the right path where cache is being stored. |
||
77 | * Will detect if $key is eZ Publish specific. |
||
78 | * |
||
79 | * @param string $key |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getPath($key) |
||
121 | |||
122 | /** |
||
123 | * Purges data from $request. |
||
124 | * If X-Location-Id or X-Group-Location-Id header is present, the store will purge cache for given locationId or group of locationIds. |
||
125 | * If not, regular purge by URI will occur. |
||
126 | * |
||
127 | * @param \Symfony\Component\HttpFoundation\Request $request |
||
128 | * |
||
129 | * @return bool True if purge was successful. False otherwise |
||
130 | */ |
||
131 | public function purgeByRequest(Request $request) |
||
164 | |||
165 | /** |
||
166 | * Purges all cached content. |
||
167 | * |
||
168 | * @return bool |
||
169 | */ |
||
170 | public function purgeAllContent() |
||
174 | |||
175 | /** |
||
176 | * Purges cache for $locationId. |
||
177 | * |
||
178 | * @param int|null $locationId. If null, all locations will be purged. |
||
|
|||
179 | * |
||
180 | * @return bool |
||
181 | */ |
||
182 | private function purgeLocation($locationId) |
||
214 | |||
215 | /** |
||
216 | * Returns cache lock name for $locationId. |
||
217 | * |
||
218 | * This method is public only for unit tests. |
||
219 | * Use it only if you know what you are doing. |
||
220 | * |
||
221 | * @internal |
||
222 | * |
||
223 | * @param int $locationId. If null, will return a global cache lock name (purging all content) |
||
224 | * |
||
225 | * @return string |
||
226 | */ |
||
227 | public function getLocationCacheLockName($locationId = null) |
||
233 | |||
234 | /** |
||
235 | * Returns cache dir for $locationId. |
||
236 | * |
||
237 | * This method is public only for unit tests. |
||
238 | * Use it only if you know what you are doing. |
||
239 | * |
||
240 | * @internal |
||
241 | * |
||
242 | * @param int $locationId |
||
243 | * |
||
244 | * @return string |
||
245 | */ |
||
246 | public function getLocationCacheDir($locationId = null) |
||
255 | } |
||
256 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.