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 | * Initialize a new localcache. |
||
19 | * |
||
20 | * @param string $filepath |
||
21 | */ |
||
22 | 6 | public function __construct($filepath) |
|
29 | |||
30 | /** |
||
31 | * Must implement a set method. |
||
32 | * |
||
33 | * @param string $key key to set as the cache value. |
||
34 | * @param mixed $value returns the value of the cached item. |
||
35 | * @return $this |
||
36 | */ |
||
37 | 4 | public function set($key, $value, $expiration = false) |
|
43 | |||
44 | /** |
||
45 | * Must implement a get method. |
||
46 | * |
||
47 | * @param string $key Get a cached item by key. |
||
48 | * @return mixed Returns cached item or false. |
||
49 | */ |
||
50 | 4 | public function get($key) |
|
64 | |||
65 | /** |
||
66 | * Must implement a delete method. |
||
67 | * |
||
68 | * @param string $key delete a specific cached item by key. |
||
69 | * @return $this |
||
70 | */ |
||
71 | 1 | public function delete($key) |
|
77 | |||
78 | /** |
||
79 | * Clear all of the values set by this cache instance. |
||
80 | * |
||
81 | * @return $this |
||
82 | */ |
||
83 | 1 | public function clear() |
|
94 | |||
95 | /** |
||
96 | * Returns the filename of a key. |
||
97 | * |
||
98 | * @param string $key name of the key |
||
99 | * @return void |
||
100 | */ |
||
101 | 4 | public function filename($key) |
|
105 | |||
106 | /** |
||
107 | * Create a parsable value from the data and expiration date. |
||
108 | * |
||
109 | * @param string $value value of the store |
||
110 | * @param integer $expiration integer value of the expiration (unix timestamp) |
||
111 | * @return void |
||
112 | */ |
||
113 | 4 | public function createValue($value, $expiration) |
|
118 | |||
119 | /** |
||
120 | * Gets the current cache namespace key. |
||
121 | * |
||
122 | * Note: to save on time spent reading/writing to disk, this method uses |
||
123 | * static caching. Its important that when a cache key gets reset this |
||
124 | * method has it's local cache reset by passing `true`. |
||
125 | * |
||
126 | * @param boolean $reset resets the static cache. |
||
127 | * @return void |
||
128 | */ |
||
129 | 4 | public function key($reset = false) |
|
143 | |||
144 | /** |
||
145 | * Set the current cache key. |
||
146 | */ |
||
147 | 2 | public function setKey() |
|
154 | } |
||
155 |
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: