1 | <?php |
||
8 | class LocalAdapter implements CacheAdapterInterface |
||
9 | { |
||
10 | /** |
||
11 | * A filesystem path to store cache values. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $path; |
||
16 | |||
17 | /** |
||
18 | * umask value to set on cache files. |
||
19 | * |
||
20 | * @var integer |
||
21 | */ |
||
22 | protected $umask = 000; |
||
23 | |||
24 | /** |
||
25 | * Initialize a new localcache. |
||
26 | * |
||
27 | * @param string $filepath |
||
28 | */ |
||
29 | 8 | public function __construct($filepath) |
|
36 | |||
37 | /** |
||
38 | * Must implement a set method. |
||
39 | * |
||
40 | * @param string $key key to set as the cache value. |
||
41 | * @param mixed $value returns the value of the cached item. |
||
42 | * @return $this |
||
43 | */ |
||
44 | 6 | public function set($key, $value, $expiration = false) |
|
52 | |||
53 | /** |
||
54 | * Must implement a get method. |
||
55 | * |
||
56 | * @param string $key Get a cached item by key. |
||
57 | * @return mixed Returns cached item or false. |
||
58 | */ |
||
59 | 5 | public function get($key) |
|
73 | |||
74 | /** |
||
75 | * Must implement a delete method. |
||
76 | * |
||
77 | * @param string $key delete a specific cached item by key. |
||
78 | * @return $this |
||
79 | */ |
||
80 | 1 | public function delete($key) |
|
86 | |||
87 | /** |
||
88 | * Clear all of the values set by this cache instance. |
||
89 | * |
||
90 | * @return $this |
||
91 | */ |
||
92 | 3 | public function clear() |
|
103 | |||
104 | /** |
||
105 | * Returns the filename of a key. |
||
106 | * |
||
107 | * @param string $key name of the key |
||
108 | * @return void |
||
109 | */ |
||
110 | 6 | public function filename($key) |
|
114 | |||
115 | /** |
||
116 | * Create a parsable value from the data and expiration date. |
||
117 | * |
||
118 | * @param string $value value of the store |
||
119 | * @param integer $expiration integer value of the expiration (unix timestamp) |
||
120 | * @return void |
||
121 | */ |
||
122 | 6 | public function createValue($value, $expiration) |
|
127 | |||
128 | /** |
||
129 | * Gets the current cache namespace key. |
||
130 | * |
||
131 | * Note: to save on time spent reading/writing to disk, this method uses |
||
132 | * static caching. Its important that when a cache key gets reset this |
||
133 | * method has it's local cache reset by passing `true`. |
||
134 | * |
||
135 | * @param boolean $reset resets the static cache. |
||
136 | * @return void |
||
137 | */ |
||
138 | 6 | public function key($reset = false) |
|
152 | |||
153 | /** |
||
154 | * Set the current cache key. |
||
155 | */ |
||
156 | 4 | public function setKey() |
|
165 | } |
||
166 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: