@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | use Phpfastcache\Config\ConfigurationOption; |
19 | 19 | use Phpfastcache\Core\Item\ExtendedCacheItemInterface; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheDriverCheckException, PhpfastcacheLogicException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheDriverCheckException, PhpfastcacheLogicException |
|
22 | 22 | }; |
23 | 23 | use Phpfastcache\Util\ArrayObject; |
24 | 24 | |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | public function driverPreWrap(ExtendedCacheItemInterface $item): array |
162 | 162 | { |
163 | 163 | $wrap = [ |
164 | - self::DRIVER_DATA_WRAPPER_INDEX => $item->get(), |
|
165 | - self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(), |
|
166 | - self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(), |
|
164 | + self::DRIVER_DATA_WRAPPER_INDEX => $item->get(), |
|
165 | + self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(), |
|
166 | + self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(), |
|
167 | 167 | ]; |
168 | 168 | |
169 | 169 | if ($this->config->getOption('itemDetailedDate')) { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
19 | 19 | use Phpfastcache\EventManager; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
22 | 22 | }; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
24 | 24 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
19 | 19 | use Phpfastcache\EventManager; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException, PhpfastcacheLogicException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException, PhpfastcacheLogicException |
|
22 | 22 | }; |
23 | 23 | |
24 | 24 | /** |
@@ -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\Core\Item; |
17 | 17 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $this->driver = $driver; |
71 | 71 | $this->driver->setItem($this); |
72 | 72 | $this->expirationDate = new \DateTime(); |
73 | - if($this->driver->getConfigOption('itemDetailedDate')){ |
|
73 | + if ($this->driver->getConfigOption('itemDetailedDate')) { |
|
74 | 74 | $this->creationDate = new \DateTime(); |
75 | 75 | $this->modificationDate = new \DateTime(); |
76 | 76 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | if (\is_array($this->data)) { |
247 | 247 | $this->data[] = $data; |
248 | 248 | } else if (\is_string($data)) { |
249 | - $this->data .= (string)$data; |
|
249 | + $this->data .= (string) $data; |
|
250 | 250 | } else { |
251 | 251 | throw new PhpfastcacheInvalidArgumentException('$data must be either array nor string.'); |
252 | 252 | } |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | if (\is_array($this->data)) { |
266 | 266 | \array_unshift($this->data, $data); |
267 | 267 | } else if (\is_string($data)) { |
268 | - $this->data = (string)$data . $this->data; |
|
268 | + $this->data = (string) $data . $this->data; |
|
269 | 269 | } else { |
270 | 270 | throw new PhpfastcacheInvalidArgumentException('$data must be either array nor string.'); |
271 | 271 | } |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | public function removeTag($tagName): ExtendedCacheItemInterface |
345 | 345 | { |
346 | 346 | if (($key = array_search($tagName, $this->tags)) !== false) { |
347 | - unset($this->tags[ $key ]); |
|
347 | + unset($this->tags[$key]); |
|
348 | 348 | $this->removedTags[] = $tagName; |
349 | 349 | } |
350 | 350 | |
@@ -423,8 +423,8 @@ discard block |
||
423 | 423 | final public function __debugInfo() |
424 | 424 | { |
425 | 425 | $info = \get_object_vars($this); |
426 | - $info[ 'driver' ] = 'object(' . \get_class($info[ 'driver' ]) . ')'; |
|
426 | + $info['driver'] = 'object(' . \get_class($info['driver']) . ')'; |
|
427 | 427 | |
428 | - return (array)$info; |
|
428 | + return (array) $info; |
|
429 | 429 | } |
430 | 430 | } |
431 | 431 | \ No newline at end of file |
@@ -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 | } |