1 | <?php |
||
22 | class LocationAwareStore extends Store implements ContentPurger |
||
23 | { |
||
24 | const LOCATION_CACHE_DIR = 'ezlocation', |
||
25 | LOCATION_STALE_CACHE_DIR = 'ezlocation_stale'; |
||
26 | |||
27 | /** |
||
28 | * @var \Symfony\Component\Filesystem\Filesystem |
||
29 | */ |
||
30 | private $fs; |
||
31 | |||
32 | /** |
||
33 | * Injects a Filesystem instance |
||
34 | * For unit tests only. |
||
35 | * |
||
36 | * @internal |
||
37 | * |
||
38 | * @param \Symfony\Component\Filesystem\Filesystem $fs |
||
39 | */ |
||
40 | public function setFilesystem(Filesystem $fs) |
||
44 | |||
45 | /** |
||
46 | * @return \Symfony\Component\Filesystem\Filesystem |
||
47 | */ |
||
48 | public function getFilesystem() |
||
56 | |||
57 | /** |
||
58 | * Injects eZ Publish specific information in the content digest if needed. |
||
59 | * X-Location-Id response header is set in the ViewController. |
||
60 | * |
||
61 | * @see \eZ\Publish\Core\MVC\Symfony\Controller\Content\ViewController::viewLocation() |
||
62 | * |
||
63 | * @param \Symfony\Component\HttpFoundation\Response $response |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | protected function generateContentDigest(Response $response) |
||
76 | |||
77 | /** |
||
78 | * Returns the right path where cache is being stored. |
||
79 | * Will detect if $key is eZ Publish specific. |
||
80 | * |
||
81 | * @param string $key |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getPath($key) |
||
123 | |||
124 | /** |
||
125 | * Purges data from $request. |
||
126 | * If X-Location-Id or X-Group-Location-Id header is present, the store will purge cache for given locationId or group of locationIds. |
||
127 | * If not, regular purge by URI will occur. |
||
128 | * |
||
129 | * @param \Symfony\Component\HttpFoundation\Request $request |
||
130 | * |
||
131 | * @return bool True if purge was successful. False otherwise |
||
132 | */ |
||
133 | public function purgeByRequest(Request $request) |
||
166 | |||
167 | /** |
||
168 | * Purges all cached content. |
||
169 | * |
||
170 | * @return bool |
||
171 | */ |
||
172 | public function purgeAllContent() |
||
176 | |||
177 | /** |
||
178 | * Purges cache for $locationId. |
||
179 | * |
||
180 | * @param int|null $locationId. If null, all locations will be purged. |
||
|
|||
181 | * |
||
182 | * @return bool |
||
183 | */ |
||
184 | private function purgeLocation($locationId) |
||
216 | |||
217 | /** |
||
218 | * Returns cache lock name for $locationId. |
||
219 | * |
||
220 | * This method is public only for unit tests. |
||
221 | * Use it only if you know what you are doing. |
||
222 | * |
||
223 | * @internal |
||
224 | * |
||
225 | * @param int $locationId. If null, will return a global cache lock name (purging all content) |
||
226 | * |
||
227 | * @return string |
||
228 | */ |
||
229 | public function getLocationCacheLockName($locationId = null) |
||
235 | |||
236 | /** |
||
237 | * Returns cache dir for $locationId. |
||
238 | * |
||
239 | * This method is public only for unit tests. |
||
240 | * Use it only if you know what you are doing. |
||
241 | * |
||
242 | * @internal |
||
243 | * |
||
244 | * @param int $locationId |
||
245 | * |
||
246 | * @return string |
||
247 | */ |
||
248 | public function getLocationCacheDir($locationId = null) |
||
257 | } |
||
258 |
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.