@@ -84,7 +84,7 @@ |
||
| 84 | 84 | foreach (array_unique($tagNames) as $tagName) { |
| 85 | 85 | if(is_string($tagName)){ |
| 86 | 86 | $items = array_merge($items, $this->getItemsByTag($tagName)); |
| 87 | - }else{ |
|
| 87 | + } else{ |
|
| 88 | 88 | throw new InvalidArgumentException('$tagName must be a a string'); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | if($results instanceof Cassandra\Rows && $results->count() === 1){ |
| 132 | 132 | return $this->decode($results->first()['cache_data']); |
| 133 | - }else{ |
|
| 133 | + } else{ |
|
| 134 | 134 | return null; |
| 135 | 135 | } |
| 136 | 136 | } catch (Cassandra\Exception $e) { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | if(!empty($this->config['ssl']['enabled'])){ |
| 218 | 218 | if(!empty($this->config['ssl']['verify'])){ |
| 219 | 219 | $sslBuilder = Cassandra::ssl()->withVerifyFlags(Cassandra::VERIFY_PEER_CERT); |
| 220 | - }else{ |
|
| 220 | + } else{ |
|
| 221 | 221 | $sslBuilder = Cassandra::ssl()->withVerifyFlags(Cassandra::VERIFY_NONE); |
| 222 | 222 | } |
| 223 | 223 | |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | { |
| 77 | 77 | if(method_exists($this->instance, $name)){ |
| 78 | 78 | return call_user_func_array([$this->instance, $name], $args); |
| 79 | - }else{ |
|
| 79 | + } else{ |
|
| 80 | 80 | throw new \BadMethodCallException(sprintf('Method %s does not exists', $name)); |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -109,14 +109,14 @@ discard block |
||
| 109 | 109 | try{ |
| 110 | 110 | self::$instances[ $instance ] = new $class($config); |
| 111 | 111 | self::$instances[ $instance ]->setEventManager(EventManager::getInstance()); |
| 112 | - }catch(phpFastCacheDriverCheckException $e){ |
|
| 112 | + } catch(phpFastCacheDriverCheckException $e){ |
|
| 113 | 113 | $fallback = self::standardizeDriverName($config['fallback']); |
| 114 | 114 | if($fallback && $fallback !== $driver){ |
| 115 | 115 | $class = self::getNamespacePath() . $fallback . '\Driver'; |
| 116 | 116 | self::$instances[ $instance ] = new $class($config); |
| 117 | 117 | self::$instances[ $instance ]->setEventManager(EventManager::getInstance()); |
| 118 | 118 | trigger_error(sprintf('The "%s" driver is unavailable at the moment, the fallback driver "%s" has been used instead.', $driver, $fallback), E_USER_WARNING); |
| 119 | - }else{ |
|
| 119 | + } else{ |
|
| 120 | 120 | throw new phpFastCacheDriverCheckException($e->getMessage(), $e->getCode(), $e); |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | self::$config = array_merge(self::$config, $name); |
| 230 | 230 | } else if (is_string($name)){ |
| 231 | 231 | self::$config[ $name ] = $value; |
| 232 | - }else{ |
|
| 232 | + } else{ |
|
| 233 | 233 | throw new phpFastCacheInvalidArgumentException('Invalid variable type: $name'); |
| 234 | 234 | } |
| 235 | 235 | } |
@@ -88,13 +88,13 @@ |
||
| 88 | 88 | if(is_callable($arguments[0])){ |
| 89 | 89 | if(isset($arguments[1]) && is_string($arguments[0])){ |
| 90 | 90 | $this->events[$name][$arguments[1]] = $arguments[0]; |
| 91 | - }else { |
|
| 91 | + } else { |
|
| 92 | 92 | $this->events[$name][] = $arguments[0]; |
| 93 | 93 | } |
| 94 | - }else{ |
|
| 94 | + } else{ |
|
| 95 | 95 | throw new phpFastCacheInvalidArgumentException(sprintf('Expected Callable, got "%s"', gettype($arguments[0]))); |
| 96 | 96 | } |
| 97 | - }else{ |
|
| 97 | + } else{ |
|
| 98 | 98 | throw new \BadMethodCallException('An event must start with "on" such as "onCacheGetItem"'); |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | return $full_path_tmp; |
| 96 | 96 | } |
| 97 | 97 | return $full_path; |
| 98 | - }else{ |
|
| 98 | + } else{ |
|
| 99 | 99 | if (!isset($this->tmp[ $full_path_hash ]) || (!@file_exists($full_path) || !@is_writable($full_path))) { |
| 100 | 100 | if (!@file_exists($full_path)) { |
| 101 | 101 | @mkdir($full_path, $this->getDefaultChmod(), true); |
| 102 | - }else if (!@is_writable($full_path)) { |
|
| 102 | + } else if (!@is_writable($full_path)) { |
|
| 103 | 103 | if (!@chmod($full_path, $this->getDefaultChmod()) && $this->config[ 'autoTmpFallback' ]) |
| 104 | 104 | { |
| 105 | 105 | /** |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | if(!rename($tmpFilename, $file)){ |
| 300 | 300 | throw new phpFastCacheIOException(sprintf('Failed to rename %s to %s', $tmpFilename, $file)); |
| 301 | 301 | } |
| 302 | - }else{ |
|
| 302 | + } else{ |
|
| 303 | 303 | $f = fopen($file, 'w+'); |
| 304 | 304 | $octetWritten = fwrite($f, $data); |
| 305 | 305 | fclose($f); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | $reflectionMethod = new \ReflectionMethod(get_class($instance), $method); |
| 57 | 57 | if($getterMethod){ |
| 58 | 58 | $return[ $instance->getDriverName() ] = $reflectionMethod->invokeArgs($instance, $args); |
| 59 | - }else{ |
|
| 59 | + } else{ |
|
| 60 | 60 | $result = $reflectionMethod->invokeArgs($instance, $args); |
| 61 | 61 | if($result !== false){ |
| 62 | 62 | $return = $result; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | if (is_readable($path)) { |
| 33 | 33 | require_once $path; |
| 34 | - }else{ |
|
| 34 | + } else{ |
|
| 35 | 35 | trigger_error('Cannot locate the Psr/Cache files', E_USER_ERROR); |
| 36 | 36 | } |
| 37 | 37 | return; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | if (is_readable($path)) { |
| 42 | 42 | require_once $path; |
| 43 | - }else{ |
|
| 43 | + } else{ |
|
| 44 | 44 | trigger_error('Cannot locate the Psr/SimpleCache files', E_USER_ERROR); |
| 45 | 45 | } |
| 46 | 46 | return; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | if(isset($this->config[$optionName])){ |
| 74 | 74 | return $this->config[$optionName]; |
| 75 | - }else{ |
|
| 75 | + } else{ |
|
| 76 | 76 | return null; |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * reuse it else set a new Date |
| 150 | 150 | */ |
| 151 | 151 | $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = $item->getCreationDate() ?: new \DateTime(); |
| 152 | - }else{ |
|
| 152 | + } else{ |
|
| 153 | 153 | $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = null; |
| 154 | 154 | $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = null; |
| 155 | 155 | } |