@@ -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 | } |
@@ -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 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | if(!$strtoupper){ |
113 | 113 | print trim($string) . PHP_EOL; |
114 | - }else{ |
|
114 | + } else{ |
|
115 | 115 | print strtoupper(trim($string) . PHP_EOL); |
116 | 116 | } |
117 | 117 | |
@@ -125,8 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | if (substr(php_uname(), 0, 7) === 'Windows'){ |
127 | 127 | pclose(popen('start /B '. $cmd, 'r')); |
128 | - } |
|
129 | - else { |
|
128 | + } else { |
|
130 | 129 | exec($cmd . ' > /dev/null &'); |
131 | 130 | } |
132 | 131 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } else { |
165 | 165 | $item->setHit(true); |
166 | 166 | } |
167 | - }else{ |
|
167 | + } else{ |
|
168 | 168 | $item->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ])); |
169 | 169 | } |
170 | 170 | } |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | { |
360 | 360 | if (!array_key_exists($item->getKey(), $this->itemInstances)) { |
361 | 361 | $this->itemInstances[ $item->getKey() ] = $item; |
362 | - }else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
362 | + } else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
363 | 363 | throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.'); |
364 | 364 | } |
365 | 365 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | if(is_string($itemKey)){ |
43 | 43 | $this->itemKey = $itemKey; |
44 | 44 | $this->itemDate = $itemDate; |
45 | - }else{ |
|
45 | + } else{ |
|
46 | 46 | throw new phpFastCacheInvalidArgumentException(sprintf('$itemKey must be a string, got "%s" instead', gettype($itemKey))); |
47 | 47 | } |
48 | 48 | } |