@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. |
26 | 26 | * |
27 | 27 | * @param string $key The key of the item to store. |
28 | - * @param mixed $value The value of the item to store, must be serializable. |
|
28 | + * @param string $value The value of the item to store, must be serializable. |
|
29 | 29 | * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and |
30 | 30 | * the driver supports TTL then the library may set a default value |
31 | 31 | * for it or let the driver take care of that. |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * Fetches a value from the cache. |
77 | 77 | * |
78 | 78 | * @param string $key The unique key of this item in the cache. |
79 | - * @param mixed $default Default value to return if the key does not exist. |
|
79 | + * @param string $default Default value to return if the key does not exist. |
|
80 | 80 | * |
81 | 81 | * @return mixed The value of the item from the cache, or $default in case of cache miss. |
82 | 82 | * |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | /** |
115 | 115 | * Obtains multiple cache items by their unique keys. |
116 | 116 | * |
117 | - * @param iterable $keys A list of keys that can obtained in a single operation. |
|
117 | + * @param string[] $keys A list of keys that can obtained in a single operation. |
|
118 | 118 | * @param mixed $default Default value to return for keys that do not exist. |
119 | 119 | * |
120 | 120 | * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * Persists a set of key => value pairs in the cache, with an optional TTL. |
141 | 141 | * |
142 | 142 | * @param iterable $values A list of key => value pairs for a multiple-set operation. |
143 | - * @param null|int|DateInterval $ttl Optional. The TTL value of this item. If no value is sent and |
|
143 | + * @param integer $ttl Optional. The TTL value of this item. If no value is sent and |
|
144 | 144 | * the driver supports TTL then the library may set a default value |
145 | 145 | * for it or let the driver take care of that. |
146 | 146 | * |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | /** |
170 | 170 | * Deletes multiple cache items in a single operation. |
171 | 171 | * |
172 | - * @param iterable $keys A list of string-based keys to be deleted. |
|
172 | + * @param string[] $keys A list of string-based keys to be deleted. |
|
173 | 173 | * |
174 | 174 | * @return bool True if the items were successfully removed. False if there was an error. |
175 | 175 | * |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | /** |
207 | 207 | * Check that provided key is valid. |
208 | 208 | * |
209 | - * @param $key |
|
209 | + * @param string $key |
|
210 | 210 | * @throws InvalidArgumentException |
211 | 211 | */ |
212 | 212 | private function _isValidKey($key){ |
@@ -75,7 +75,7 @@ |
||
75 | 75 | * |
76 | 76 | */ |
77 | 77 | public function testClear(){ |
78 | - $this->assertEquals($this->cacheStorage->clear(), true); |
|
78 | + $this->assertEquals($this->cacheStorage->clear(), true); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -95,23 +95,23 @@ |
||
95 | 95 | */ |
96 | 96 | public function has($key){ |
97 | 97 | |
98 | - $cacheFile = implode('.',[$key,$this->ext]); |
|
99 | - $cacheLocation = $this->fs . DIRECTORY_SEPARATOR . $cacheFile; |
|
98 | + $cacheFile = implode('.',[$key,$this->ext]); |
|
99 | + $cacheLocation = $this->fs . DIRECTORY_SEPARATOR . $cacheFile; |
|
100 | 100 | |
101 | - if (!file_exists($cacheLocation)){ |
|
102 | - return false; |
|
103 | - } |
|
101 | + if (!file_exists($cacheLocation)){ |
|
102 | + return false; |
|
103 | + } |
|
104 | 104 | |
105 | - $data = \file_get_contents($cacheLocation); |
|
106 | - $cacheData = json_decode($data, TRUE); |
|
105 | + $data = \file_get_contents($cacheLocation); |
|
106 | + $cacheData = json_decode($data, TRUE); |
|
107 | 107 | |
108 | - //cache has expired |
|
109 | - if ($cacheData[0] < time() ){ |
|
110 | - \unlink($cacheLocation); |
|
111 | - return false; |
|
112 | - } |
|
108 | + //cache has expired |
|
109 | + if ($cacheData[0] < time() ){ |
|
110 | + \unlink($cacheLocation); |
|
111 | + return false; |
|
112 | + } |
|
113 | 113 | |
114 | - return true; |
|
114 | + return true; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -28,16 +28,16 @@ |
||
28 | 28 | * @param DateInterval $ttl |
29 | 29 | * @throws CacheException |
30 | 30 | */ |
31 | - public function __construct(DateInterval $ttl) |
|
32 | - { |
|
33 | - $foundApc = \extension_loaded('apc'); |
|
31 | + public function __construct(DateInterval $ttl) |
|
32 | + { |
|
33 | + $foundApc = \extension_loaded('apc'); |
|
34 | 34 | |
35 | - if (!$foundApc){ |
|
36 | - throw new CacheException('APC Extension not found.'); |
|
37 | - } |
|
35 | + if (!$foundApc){ |
|
36 | + throw new CacheException('APC Extension not found.'); |
|
37 | + } |
|
38 | 38 | |
39 | - parent::__construct($ttl); |
|
40 | - } |
|
39 | + parent::__construct($ttl); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Determines whether an item is present in the cache. |