@@ -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 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | if($this->driver->getConfig()['itemDetailedDate']){ |
71 | 71 | return $this->creationDate; |
72 | - }else{ |
|
72 | + } else{ |
|
73 | 73 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
74 | 74 | } |
75 | 75 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | if($this->driver->getConfig()['itemDetailedDate']){ |
85 | 85 | $this->creationDate = $date; |
86 | 86 | return $this; |
87 | - }else{ |
|
87 | + } else{ |
|
88 | 88 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
89 | 89 | } |
90 | 90 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | if($this->driver->getConfig()['itemDetailedDate']){ |
99 | 99 | return $this->modificationDate; |
100 | - }else{ |
|
100 | + } else{ |
|
101 | 101 | throw new \LogicException('Cannot access to the modification date when the "itemDetailedDate" configuration is disabled.'); |
102 | 102 | } |
103 | 103 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if($this->driver->getConfig()['itemDetailedDate']){ |
113 | 113 | $this->modificationDate = $date; |
114 | 114 | return $this; |
115 | - }else{ |
|
115 | + } else{ |
|
116 | 116 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
117 | 117 | } |
118 | 118 | } |
@@ -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 |
@@ -83,7 +83,7 @@ |
||
83 | 83 | } else { |
84 | 84 | $item->setHit(true); |
85 | 85 | } |
86 | - }else{ |
|
86 | + } else{ |
|
87 | 87 | $item->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ])); |
88 | 88 | } |
89 | 89 |