1 | <?php |
||
35 | class ConfigurableCacheAdapter implements CacheAdapterInterface |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * The cache adatper instance. |
||
40 | * |
||
41 | * @var \TechDivision\Import\Cache\CacheAdapterInterface |
||
42 | */ |
||
43 | protected $cacheAdapter; |
||
44 | |||
45 | /** |
||
46 | * The TTL used to cache items. |
||
47 | * |
||
48 | * @var integer |
||
49 | */ |
||
50 | protected $time = null; |
||
51 | |||
52 | /** |
||
53 | * The flag if the cache is anabled or not. |
||
54 | * |
||
55 | * @var boolean |
||
56 | */ |
||
57 | protected $enabled = true; |
||
58 | |||
59 | /** |
||
60 | * The array with the default tags. |
||
61 | * |
||
62 | * @var string |
||
63 | */ |
||
64 | protected $tags = array(); |
||
65 | |||
66 | /** |
||
67 | * Initialize the cache handler with the passed cache and configuration instances. |
||
68 | * . |
||
69 | * @param \TechDivision\Import\Cache\CacheAdapterInterface $cacheAdapter The cache instance |
||
70 | * @param \TechDivision\Import\Configuration\ConfigurationInterface $configuration The configuration instance |
||
71 | * @param string $type The cache type to use |
||
72 | */ |
||
73 | public function __construct( |
||
94 | |||
95 | /** |
||
96 | * Creates a unique cache key from the passed data. |
||
97 | * |
||
98 | * @param mixed $data The date to create the cache key from |
||
99 | * @param boolean $usePrefix Flag to signal using the prefix or not |
||
100 | * |
||
101 | * @return string The generated cache key |
||
102 | */ |
||
103 | public function cacheKey($data, $usePrefix = true) |
||
107 | |||
108 | /** |
||
109 | * Inversion of the isCached() method. |
||
110 | * |
||
111 | * @param string $key The cache key to query for |
||
112 | * |
||
113 | * @return boolean TRUE if the value is not available, else FALSE |
||
114 | */ |
||
115 | public function notCached($key) |
||
119 | |||
120 | /** |
||
121 | * Add's a cache reference from one key to another. |
||
122 | * |
||
123 | * @param string $from The key to reference from |
||
124 | * @param string $to The key to reference to |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | public function addReference($from, $to) |
||
132 | |||
133 | /** |
||
134 | * Returns a new cache item for the passed key |
||
135 | * |
||
136 | * @param string $key The cache key to return the item for |
||
137 | * |
||
138 | * @return mixed The value for the passed key |
||
139 | */ |
||
140 | public function fromCache($key) |
||
144 | |||
145 | /** |
||
146 | * Flush the cache and remove the references. |
||
147 | * |
||
148 | * @return void |
||
149 | */ |
||
150 | public function flushCache() |
||
154 | |||
155 | /** |
||
156 | * Invalidate the cache entries for the passed tags. |
||
157 | * |
||
158 | * @param array $tags The tags to invalidate the cache for |
||
159 | * |
||
160 | * @return void |
||
161 | */ |
||
162 | public function invalidateTags(array $tags) |
||
166 | |||
167 | /** |
||
168 | * Remove the item with the passed key and all its references from the cache. |
||
169 | * |
||
170 | * @param string $key The key of the cache item to Remove |
||
171 | * @param bool $cleanUpReferences TRUE if the references has to be cleaned-up, else FALSE (default) |
||
172 | * |
||
173 | * @return void |
||
174 | */ |
||
175 | public function removeCache($key, $cleanUpReferences = false) |
||
179 | |||
180 | /** |
||
181 | * Raises the value for the attribute with the passed key by one. |
||
182 | * |
||
183 | * @param mixed $key The key of the attribute to raise the value for |
||
184 | * @param mixed $counterName The name of the counter to raise |
||
185 | * |
||
186 | * @return integer The counter's new value |
||
187 | */ |
||
188 | public function raiseCounter($key, $counterName) |
||
192 | |||
193 | /** |
||
194 | * This method merges the passed attributes with an array that |
||
195 | * has already been added under the passed key. |
||
196 | * |
||
197 | * If no value will be found under the passed key, the attributes |
||
198 | * will simply be registered. |
||
199 | * |
||
200 | * @param mixed $key The key of the attributes that has to be merged with the passed ones |
||
201 | * @param array $attributes The attributes that has to be merged with the exising ones |
||
202 | * |
||
203 | * @return void |
||
204 | * @throws \Exception Is thrown, if the already registered value is no array |
||
205 | * @link http://php.net/array_replace_recursive |
||
206 | */ |
||
207 | public function mergeAttributesRecursive($key, array $attributes) |
||
211 | |||
212 | /** |
||
213 | * Query whether or not a cache value for the passed cache key is available. |
||
214 | * |
||
215 | * @param string $key The cache key to query for |
||
216 | * |
||
217 | * @return boolean TRUE if the a value is available, else FALSE |
||
218 | */ |
||
219 | public function isCached($key) |
||
230 | |||
231 | /** |
||
232 | * Add the passed item to the cache. |
||
233 | * |
||
234 | * @param string $key The cache key to use |
||
235 | * @param mixed $value The value that has to be cached |
||
236 | * @param array $references An array with references to add |
||
237 | * @param array $tags An array with tags to add |
||
238 | * @param boolean $override Flag that allows to override an exising cache entry |
||
239 | * @param integer $time The TTL in seconds for the passed item |
||
240 | * |
||
241 | * @return void |
||
242 | */ |
||
243 | public function toCache($key, $value, array $references = array(), array $tags = array(), $override = true, $time = null) |
||
251 | } |
||
252 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..