@@ -23,10 +23,10 @@ |
||
23 | 23 | if (!is_object($driverInstance)) { |
24 | 24 | echo '[FAIL] CacheManager::getInstance() returned an invalid variable type:' . gettype($driverInstance) . "\n"; |
25 | 25 | $status = 1; |
26 | -}else if(!($driverInstance instanceof CacheItemPoolInterface)){ |
|
26 | +} else if(!($driverInstance instanceof CacheItemPoolInterface)){ |
|
27 | 27 | echo '[FAIL] CacheManager::getInstance() returned an invalid class:' . get_class($driverInstance) . "\n"; |
28 | 28 | $status = 1; |
29 | -}else{ |
|
29 | +} else{ |
|
30 | 30 | echo '[PASS] CacheManager::getInstance() returned a valid CacheItemPoolInterface object: ' . get_class($driverInstance) . "\n"; |
31 | 31 | } |
32 | 32 |
@@ -273,7 +273,7 @@ |
||
273 | 273 | |
274 | 274 | if (!is_dir($path)) { |
275 | 275 | throw new phpFastCacheDriverException("Can't read PATH:" . $path, 94); |
276 | - }else{ |
|
276 | + } else{ |
|
277 | 277 | $size = Directory::dirSize($path); |
278 | 278 | } |
279 | 279 |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | $class = self::getNamespacePath() . $driver . '\Driver'; |
96 | 96 | try{ |
97 | 97 | self::$instances[ $instance ] = new $class($config); |
98 | - }catch(phpFastCacheDriverCheckException $e){ |
|
98 | + } catch(phpFastCacheDriverCheckException $e){ |
|
99 | 99 | $fallback = self::standardizeDriverName($config['fallback']); |
100 | 100 | if($fallback && $fallback !== $driver){ |
101 | 101 | $class = self::getNamespacePath() . $fallback . '\Driver'; |
102 | 102 | self::$instances[ $instance ] = new $class($config); |
103 | 103 | trigger_error(sprintf('The "%s" driver is unavailable at the moment, the fallback driver "%s" has been used instead.', $driver, $fallback), E_USER_WARNING); |
104 | - }else{ |
|
104 | + } else{ |
|
105 | 105 | throw new phpFastCacheDriverCheckException($e->getMessage(), $e->getCode(), $e); |
106 | 106 | } |
107 | 107 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | self::$config = array_merge(self::$config, $name); |
199 | 199 | } else if (is_string($name)){ |
200 | 200 | self::$config[ $name ] = $value; |
201 | - }else{ |
|
201 | + } else{ |
|
202 | 202 | throw new \InvalidArgumentException('Invalid variable type: $name'); |
203 | 203 | } |
204 | 204 | } |
@@ -273,7 +273,7 @@ |
||
273 | 273 | |
274 | 274 | if (!is_dir($path)) { |
275 | 275 | throw new phpFastCacheDriverException("Can't read PATH:" . $path, 94); |
276 | - }else{ |
|
276 | + } else{ |
|
277 | 277 | $size = Directory::dirSize($path); |
278 | 278 | } |
279 | 279 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | if (!class_exists('phpFastCache\CacheManager')) { |
19 | 19 | echo "[FAIL] Autoload failed to find the CacheManager\n"; |
20 | 20 | $status = 255; |
21 | -}else{ |
|
21 | +} else{ |
|
22 | 22 | echo "[PASS] Autoload successfully found the CacheManager\n"; |
23 | 23 | } |
24 | 24 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | if (!interface_exists('Psr\Cache\CacheItemInterface')) { |
29 | 29 | echo "[FAIL] Autoload failed to find the Psr CacheItemInterface\n"; |
30 | 30 | $status = 255; |
31 | -}else{ |
|
31 | +} else{ |
|
32 | 32 | echo "[PASS] Autoload successfully found the Psr CacheItemInterface\n"; |
33 | 33 | } |
34 | 34 |
@@ -42,10 +42,10 @@ |
||
42 | 42 | if (!is_object($driverInstance->getItem('test'))) { |
43 | 43 | echo '[FAIL] $driverInstance->getItem() returned an invalid var type:' . gettype($driverInstance) . "\n"; |
44 | 44 | $status = 1; |
45 | -}else if(!($driverInstance->getItem('test') instanceof ExtendedCacheItemInterface)){ |
|
45 | +} else if(!($driverInstance->getItem('test') instanceof ExtendedCacheItemInterface)){ |
|
46 | 46 | echo '[FAIL] $driverInstance->getItem() returned an invalid class that does not implements ExtendedCacheItemInterface: ' . get_class($driverInstance) . "\n"; |
47 | 47 | $status = 1; |
48 | -}else{ |
|
48 | +} else{ |
|
49 | 49 | echo '[PASS] $driverInstance->getItem() returned a valid class that implements ExtendedCacheItemInterface: ' . get_class($driverInstance) . "\n"; |
50 | 50 | } |
51 | 51 |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | if (!is_object($driverInstance)) { |
25 | 25 | echo '[FAIL] CacheManager::getInstance() returned an invalid variable type:' . gettype($driverInstance) . "\n"; |
26 | 26 | $status = 1; |
27 | -}else if(!($driverInstance instanceof CacheItemPoolInterface)){ |
|
27 | +} else if(!($driverInstance instanceof CacheItemPoolInterface)){ |
|
28 | 28 | echo '[FAIL] CacheManager::getInstance() returned an invalid class:' . get_class($driverInstance) . "\n"; |
29 | 29 | $status = 1; |
30 | -}else{ |
|
30 | +} else{ |
|
31 | 31 | $key = 'test_attaching_detaching'; |
32 | 32 | |
33 | 33 | $itemDetached = $driverInstance->getItem($key); |
@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | if(!$driverInstance->isAttached($itemDetached)) |
38 | 38 | { |
39 | 39 | echo '[PASS] ExtendedCacheItemPoolInterface::isAttached() identified $itemDetached as being detached.' . "\n"; |
40 | - } |
|
41 | - else |
|
40 | + } else |
|
42 | 41 | { |
43 | 42 | echo '[FAIL] ExtendedCacheItemPoolInterface::isAttached() failed to identify $itemDetached as to be detached.' . "\n"; |
44 | 43 | $status = 1; |
@@ -48,7 +47,7 @@ discard block |
||
48 | 47 | $driverInstance->attachItem($itemDetached); |
49 | 48 | echo '[FAIL] ExtendedCacheItemPoolInterface::attachItem() attached $itemDetached without trowing an error.' . "\n"; |
50 | 49 | $status = 1; |
51 | - }catch(\LogicException $e){ |
|
50 | + } catch(\LogicException $e){ |
|
52 | 51 | echo '[PASS] ExtendedCacheItemPoolInterface::attachItem() failed to attach $itemDetached by trowing a LogicException exception.' . "\n"; |
53 | 52 | } |
54 | 53 |
@@ -215,7 +215,7 @@ |
||
215 | 215 | { |
216 | 216 | if (!array_key_exists($item->getKey(), $this->itemInstances)) { |
217 | 217 | $this->itemInstances[ $item->getKey() ] = $item; |
218 | - }else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
218 | + } else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
219 | 219 | throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.'); |
220 | 220 | } |
221 | 221 |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | { |
327 | 327 | if(isset($this->itemInstances[$item->getKey()]) && spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
328 | 328 | throw new \LogicException('The item already exists and cannot be overwritten because the Spl object hash mismatches ! You probably tried to re-attach a detached item which has been already retrieved from cache.'); |
329 | - }else{ |
|
329 | + } else{ |
|
330 | 330 | $this->itemInstances[$item->getKey()] = $item; |
331 | 331 | } |
332 | 332 | } |
@@ -342,9 +342,9 @@ discard block |
||
342 | 342 | if($item instanceof CacheItemInterface){ |
343 | 343 | unset($this->itemInstances[ $item->getKey() ]); |
344 | 344 | |
345 | - }else if(is_string($item)){ |
|
345 | + } else if(is_string($item)){ |
|
346 | 346 | unset($this->itemInstances[ $item ]); |
347 | - }else{ |
|
347 | + } else{ |
|
348 | 348 | throw new \InvalidArgumentException('Invalid type for $item variable'); |
349 | 349 | } |
350 | 350 | if(gc_enabled()){ |