@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Entities; |
| 17 | 17 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace phpFastCache; |
| 17 | 17 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | * due to performance issue on huge |
| 77 | 77 | * loop dispatching operations |
| 78 | 78 | */ |
| 79 | - if (isset($this->events[ $eventName ])) { |
|
| 80 | - foreach ($this->events[ $eventName ] as $event) { |
|
| 79 | + if (isset($this->events[$eventName])) { |
|
| 80 | + foreach ($this->events[$eventName] as $event) { |
|
| 81 | 81 | call_user_func_array($event, $args); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | if (\strpos($name, 'on') === 0) { |
| 95 | 95 | $name = \substr($name, 2); |
| 96 | - if (\is_callable($arguments[ 0 ])) { |
|
| 97 | - if (isset($arguments[ 1 ]) && \is_string($arguments[ 0 ])) { |
|
| 98 | - $this->events[ $name ][ $arguments[ 1 ] ] = $arguments[ 0 ]; |
|
| 96 | + if (\is_callable($arguments[0])) { |
|
| 97 | + if (isset($arguments[1]) && \is_string($arguments[0])) { |
|
| 98 | + $this->events[$name][$arguments[1]] = $arguments[0]; |
|
| 99 | 99 | } else { |
| 100 | - $this->events[ $name ][] = $arguments[ 0 ]; |
|
| 100 | + $this->events[$name][] = $arguments[0]; |
|
| 101 | 101 | } |
| 102 | 102 | } else { |
| 103 | - throw new phpFastCacheInvalidArgumentException(sprintf('Expected Callable, got "%s"', \gettype($arguments[ 0 ]))); |
|
| 103 | + throw new phpFastCacheInvalidArgumentException(sprintf('Expected Callable, got "%s"', \gettype($arguments[0]))); |
|
| 104 | 104 | } |
| 105 | 105 | } else { |
| 106 | 106 | throw new \BadMethodCallException('An event must start with "on" such as "onCacheGetItem"'); |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function unbindEventCallback($eventName, $callbackName): bool |
| 116 | 116 | { |
| 117 | - $return = isset($this->events[ $eventName ][ $callbackName ]); |
|
| 118 | - unset($this->events[ $eventName ][ $callbackName ]); |
|
| 117 | + $return = isset($this->events[$eventName][$callbackName]); |
|
| 118 | + unset($this->events[$eventName][$callbackName]); |
|
| 119 | 119 | |
| 120 | 120 | return $return; |
| 121 | 121 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Devtrue; |
| 17 | 17 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Riak; |
| 17 | 17 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Sqlite; |
| 17 | 17 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Sqlite; |
| 17 | 17 | |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - if (isset($row[ 'object' ])) { |
|
| 131 | - return $this->decode($row[ 'object' ]); |
|
| 130 | + if (isset($row['object'])) { |
|
| 131 | + return $this->decode($row['object']); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | return null; |
@@ -300,12 +300,12 @@ discard block |
||
| 300 | 300 | $stm = $this->indexing->prepare("SELECT MAX(`db`) as `db` FROM `balancing`"); |
| 301 | 301 | $stm->execute(); |
| 302 | 302 | $row = $stm->fetch(PDO::FETCH_ASSOC); |
| 303 | - if (!isset($row[ 'db' ])) { |
|
| 303 | + if (!isset($row['db'])) { |
|
| 304 | 304 | $db = 1; |
| 305 | - } elseif ($row[ 'db' ] <= 1) { |
|
| 305 | + } elseif ($row['db'] <= 1) { |
|
| 306 | 306 | $db = 1; |
| 307 | 307 | } else { |
| 308 | - $db = $row[ 'db' ]; |
|
| 308 | + $db = $row['db']; |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | // check file size |
@@ -327,8 +327,8 @@ discard block |
||
| 327 | 327 | ':keyword' => $keyword, |
| 328 | 328 | ]); |
| 329 | 329 | $row = $stm->fetch(PDO::FETCH_ASSOC); |
| 330 | - if (isset($row[ 'db' ]) && $row[ 'db' ] != '') { |
|
| 331 | - $db = $row[ 'db' ]; |
|
| 330 | + if (isset($row['db']) && $row['db'] != '') { |
|
| 331 | + $db = $row['db']; |
|
| 332 | 332 | } else { |
| 333 | 333 | /* |
| 334 | 334 | * Insert new to Indexing |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | /** |
| 360 | 360 | * init instant |
| 361 | 361 | */ |
| 362 | - if (!isset($this->instance[ $instant ])) { |
|
| 362 | + if (!isset($this->instance[$instant])) { |
|
| 363 | 363 | // check DB Files ready or not |
| 364 | 364 | $createTable = false; |
| 365 | 365 | if (!\file_exists($this->SqliteDir . '/db' . $instant) || $reset == true) { |
@@ -372,12 +372,12 @@ discard block |
||
| 372 | 372 | $this->initDB($PDO); |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | - $this->instance[ $instant ] = $PDO; |
|
| 375 | + $this->instance[$instant] = $PDO; |
|
| 376 | 376 | unset($PDO); |
| 377 | 377 | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - return $this->instance[ $instant ]; |
|
| 380 | + return $this->instance[$instant]; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | /** |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | * @author Lucas Brucksch <[email protected]> |
| 11 | 11 | * |
| 12 | 12 | */ |
| 13 | -declare(strict_types=1); |
|
| 13 | +declare(strict_types = 1); |
|
| 14 | 14 | |
| 15 | 15 | namespace Phpfastcache\Drivers\Zenddisk; |
| 16 | 16 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Redis; |
| 17 | 17 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Redis; |
| 17 | 17 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | if ($this->config->getOption('path')) { |
| 64 | 64 | $isConnected = $this->instance->connect($this->config->getOption('path')); |
| 65 | 65 | } else { |
| 66 | - $isConnected = $this->instance->connect($this->config->getOption('host'), $this->config->getOption('port'), (int)$this->config->getOption('timeout')); |
|
| 66 | + $isConnected = $this->instance->connect($this->config->getOption('host'), $this->config->getOption('port'), (int) $this->config->getOption('timeout')); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if (!$isConnected && $this->config->getOption('path')) { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * Check for Cross-Driver type confusion |
| 133 | 133 | */ |
| 134 | 134 | if ($item instanceof Item) { |
| 135 | - return (bool)$this->instance->del($item->getKey()); |
|
| 135 | + return (bool) $this->instance->del($item->getKey()); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | throw new phpFastCacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | { |
| 160 | 160 | // used_memory |
| 161 | 161 | $info = $this->instance->info(); |
| 162 | - $date = (new \DateTime())->setTimestamp(time() - $info[ 'uptime_in_seconds' ]); |
|
| 162 | + $date = (new \DateTime())->setTimestamp(time() - $info['uptime_in_seconds']); |
|
| 163 | 163 | |
| 164 | 164 | return (new DriverStatistic()) |
| 165 | 165 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 166 | 166 | ->setRawData($info) |
| 167 | - ->setSize((int)$info[ 'used_memory' ]) |
|
| 167 | + ->setSize((int) $info['used_memory']) |
|
| 168 | 168 | ->setInfo(\sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", |
| 169 | - $info[ 'redis_version' ], $date->format(DATE_RFC2822))); |
|
| 169 | + $info['redis_version'], $date->format(DATE_RFC2822))); |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | \ No newline at end of file |