@@ -210,7 +210,7 @@ |
||
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
213 | - * @param $cacheFile |
|
213 | + * @param string $cacheFile |
|
214 | 214 | * |
215 | 215 | * @return bool |
216 | 216 | */ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $this->serializer = new SerializerIgbinary(); |
41 | 41 | |
42 | 42 | if (!$cacheDir) { |
43 | - $cacheDir = realpath(sys_get_temp_dir()) . '/simple_php_cache'; |
|
43 | + $cacheDir = realpath(sys_get_temp_dir()).'/simple_php_cache'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $this->cacheDir = (string)$cacheDir; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | protected function getFileName($key) |
225 | 225 | { |
226 | - return $this->cacheDir . DIRECTORY_SEPARATOR . self::CACHE_FILE_PREFIX . $key . self::CACHE_FILE_SUBFIX; |
|
226 | + return $this->cacheDir.DIRECTORY_SEPARATOR.self::CACHE_FILE_PREFIX.$key.self::CACHE_FILE_SUBFIX; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -215,10 +215,10 @@ |
||
215 | 215 | protected function getTheDefaultPrefix() |
216 | 216 | { |
217 | 217 | return (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '') . '_' . |
218 | - (isset($_SERVER['THEME']) ? $_SERVER['THEME'] : '') . '_' . |
|
219 | - (isset($_SERVER['STAGE']) ? $_SERVER['STAGE'] : '') . '_' . |
|
220 | - (isset($_SESSION['language']) ? $_SESSION['language'] : '') . '_' . |
|
221 | - (isset($_SESSION['language_extra']) ? $_SESSION['language_extra'] : ''); |
|
218 | + (isset($_SERVER['THEME']) ? $_SERVER['THEME'] : '') . '_' . |
|
219 | + (isset($_SERVER['STAGE']) ? $_SERVER['STAGE'] : '') . '_' . |
|
220 | + (isset($_SESSION['language']) ? $_SESSION['language'] : '') . '_' . |
|
221 | + (isset($_SESSION['language_extra']) ? $_SESSION['language_extra'] : ''); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -251,10 +251,10 @@ discard block |
||
251 | 251 | */ |
252 | 252 | protected function getTheDefaultPrefix() |
253 | 253 | { |
254 | - return (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '') . '_' . |
|
255 | - (isset($_SERVER['THEME']) ? $_SERVER['THEME'] : '') . '_' . |
|
256 | - (isset($_SERVER['STAGE']) ? $_SERVER['STAGE'] : '') . '_' . |
|
257 | - (isset($_SESSION['language']) ? $_SESSION['language'] : '') . '_' . |
|
254 | + return (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '').'_'. |
|
255 | + (isset($_SERVER['THEME']) ? $_SERVER['THEME'] : '').'_'. |
|
256 | + (isset($_SERVER['STAGE']) ? $_SERVER['STAGE'] : '').'_'. |
|
257 | + (isset($_SESSION['language']) ? $_SESSION['language'] : '').'_'. |
|
258 | 258 | (isset($_SESSION['language_extra']) ? $_SESSION['language_extra'] : ''); |
259 | 259 | } |
260 | 260 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | */ |
509 | 509 | protected function calculateStoreKey($rawKey) |
510 | 510 | { |
511 | - $str = $this->getPrefix() . $rawKey; |
|
511 | + $str = $this->getPrefix().$rawKey; |
|
512 | 512 | |
513 | 513 | if ($this->adapter instanceof AdapterFile) { |
514 | 514 | $str = $this->cleanStoreKey($str); |
@@ -5,7 +5,6 @@ |
||
5 | 5 | /** |
6 | 6 | * SerializerIgbinary: serialize / unserialize |
7 | 7 | * |
8 | - |
|
9 | 8 | * @package voku\cache |
10 | 9 | */ |
11 | 10 | class SerializerIgbinary implements iSerializer |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function delete($key) |
30 | 30 | { |
31 | 31 | if (!is_string($key)) { |
32 | - throw new InvalidArgumentException('$key is not a string:' . print_r($key, true)); |
|
32 | + throw new InvalidArgumentException('$key is not a string:'.print_r($key, true)); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | return $this->removeItem($key); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function deleteMultiple($keys) |
48 | 48 | { |
49 | 49 | if (!is_array($keys) && !($keys instanceof \Traversable)) { |
50 | - throw new InvalidArgumentException('$keys is not iterable:' . print_r($keys, true)); |
|
50 | + throw new InvalidArgumentException('$keys is not iterable:'.print_r($keys, true)); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $results = array(); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public function getMultiple($keys, $default = null) |
95 | 95 | { |
96 | 96 | if (!is_array($keys) && !($keys instanceof \Traversable)) { |
97 | - throw new InvalidArgumentException('$keys is not iterable:' . print_r($keys, true)); |
|
97 | + throw new InvalidArgumentException('$keys is not iterable:'.print_r($keys, true)); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $result = array(); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | public function has($key) |
123 | 123 | { |
124 | 124 | if (!is_string($key)) { |
125 | - throw new InvalidArgumentException('$key is not a string:' . print_r($key, true)); |
|
125 | + throw new InvalidArgumentException('$key is not a string:'.print_r($key, true)); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return $this->existsItem($key); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function set($key, $value, $ttl = null) |
145 | 145 | { |
146 | 146 | if (!is_string($key)) { |
147 | - throw new InvalidArgumentException('$key is not a string:' . print_r($key, true)); |
|
147 | + throw new InvalidArgumentException('$key is not a string:'.print_r($key, true)); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | return $this->setItem($key, $value, $ttl); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | public function setMultiple($values, $ttl = null) |
166 | 166 | { |
167 | 167 | if (!is_array($values) && !($values instanceof \Traversable)) { |
168 | - throw new InvalidArgumentException('$values is not iterable:' . print_r($values, true)); |
|
168 | + throw new InvalidArgumentException('$values is not iterable:'.print_r($values, true)); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | $results = array(); |
@@ -93,7 +93,7 @@ |
||
93 | 93 | { |
94 | 94 | // Make sure we are under the proper limit |
95 | 95 | if (strlen($key) > 250) { |
96 | - throw new InvalidArgumentException('The passed cache key is over 250 bytes:' . print_r($key, true)); |
|
96 | + throw new InvalidArgumentException('The passed cache key is over 250 bytes:'.print_r($key, true)); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $this->memcache->set($key, $value, $this->getCompressedFlag()); |
@@ -89,8 +89,8 @@ |
||
89 | 89 | public function set($key, $value) |
90 | 90 | { |
91 | 91 | // Make sure we are under the proper limit |
92 | - if (strlen($this->memcached->getOption(\Memcached::OPT_PREFIX_KEY) . $key) > 250) { |
|
93 | - throw new InvalidArgumentException('The passed cache key is over 250 bytes:' . print_r($key, true)); |
|
92 | + if (strlen($this->memcached->getOption(\Memcached::OPT_PREFIX_KEY).$key) > 250) { |
|
93 | + throw new InvalidArgumentException('The passed cache key is over 250 bytes:'.print_r($key, true)); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | return $this->memcached->set($key, $value); |