@@ -18,7 +18,7 @@ |
||
18 | 18 | use LevelDB as LeveldbClient; |
19 | 19 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface, IO\IOHelperTrait}; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - phpFastCacheInvalidArgumentException, phpFastCacheLogicException |
|
21 | + phpFastCacheInvalidArgumentException, phpFastCacheLogicException |
|
22 | 22 | }; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
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\Drivers\Leveldb; |
17 | 17 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * Check for Cross-Driver type confusion |
85 | 85 | */ |
86 | 86 | if ($item instanceof Item) { |
87 | - return (bool)$this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
87 | + return (bool) $this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | throw new phpFastCacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $this->instance->close(); |
117 | 117 | $this->instance = null; |
118 | 118 | } |
119 | - $result = (bool)LeveldbClient::destroy($this->getLeveldbFile()); |
|
119 | + $result = (bool) LeveldbClient::destroy($this->getLeveldbFile()); |
|
120 | 120 | $this->driverConnect(); |
121 | 121 | |
122 | 122 | return $result; |
@@ -14,4 +14,4 @@ |
||
14 | 14 | * @package phpFastCache\Config |
15 | 15 | * @see ConfigurationOption |
16 | 16 | */ |
17 | -class Config extends ConfigurationOption{} |
|
18 | 17 | \ No newline at end of file |
18 | +class Config extends ConfigurationOption {} |
|
19 | 19 | \ No newline at end of file |
@@ -188,11 +188,11 @@ |
||
188 | 188 | $this->printSkipText('A driver could not be initialized due to missing requirement: ' . $exception->getMessage()); |
189 | 189 | }else{ |
190 | 190 | $this->printFailText(sprintf( |
191 | - 'Uncaught exception "%s" in "%s" line %d with message: "%s"', |
|
192 | - \get_class($exception), |
|
193 | - $exception->getFile(), |
|
194 | - $exception->getLine(), |
|
195 | - $exception->getMessage() |
|
191 | + 'Uncaught exception "%s" in "%s" line %d with message: "%s"', |
|
192 | + \get_class($exception), |
|
193 | + $exception->getFile(), |
|
194 | + $exception->getLine(), |
|
195 | + $exception->getMessage() |
|
196 | 196 | )); |
197 | 197 | } |
198 | 198 | $this->terminateTest(); |
@@ -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\Helper; |
17 | 17 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function __construct($testName) |
37 | 37 | { |
38 | - $this->printText('[PhpFastCache CORE v' . Api::getPhpFastCacheVersion() . Api::getPhpFastCacheGitHeadHash() . ']', true); |
|
38 | + $this->printText('[PhpFastCache CORE v' . Api::getPhpFastCacheVersion() . Api::getPhpFastCacheGitHeadHash() . ']', true); |
|
39 | 39 | $this->printText('[PhpFastCache API v' . Api::getVersion() . ']', true); |
40 | 40 | $this->printText('[PHP v' . PHP_VERSION . ']', true); |
41 | 41 | $this->printText("[Begin Test: '{$testName}']"); |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | * @param \Throwable $exception |
185 | 185 | */ |
186 | 186 | public function exceptionHandler(\Throwable $exception) { |
187 | - if($exception instanceof phpFastCacheDriverCheckException){ |
|
187 | + if ($exception instanceof phpFastCacheDriverCheckException) { |
|
188 | 188 | $this->printSkipText('A driver could not be initialized due to missing requirement: ' . $exception->getMessage()); |
189 | - }else{ |
|
189 | + } else { |
|
190 | 190 | $this->printFailText(sprintf( |
191 | 191 | 'Uncaught exception "%s" in "%s" line %d with message: "%s"', |
192 | 192 | \get_class($exception), |
@@ -186,7 +186,7 @@ |
||
186 | 186 | public function exceptionHandler(\Throwable $exception) { |
187 | 187 | if($exception instanceof phpFastCacheDriverCheckException){ |
188 | 188 | $this->printSkipText('A driver could not be initialized due to missing requirement: ' . $exception->getMessage()); |
189 | - }else{ |
|
189 | + } else{ |
|
190 | 190 | $this->printFailText(sprintf( |
191 | 191 | 'Uncaught exception "%s" in "%s" line %d with message: "%s"', |
192 | 192 | \get_class($exception), |
@@ -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\Helper; |
17 | 17 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | if (!$cacheItem->isHit()) { |
51 | 51 | $cacheItem->set($callback()); |
52 | - if($expiresAfter){ |
|
52 | + if ($expiresAfter) { |
|
53 | 53 | $cacheItem->expiresAfter($expiresAfter); |
54 | 54 | } |
55 | 55 | $this->cacheInstance->save($cacheItem); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | use Phpfastcache\Core\Item\ExtendedCacheItemInterface; |
20 | 20 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - phpFastCacheDriverCheckException, phpFastCacheInvalidArgumentException, phpFastCacheRootException, phpFastCacheSimpleCacheException |
|
22 | + phpFastCacheDriverCheckException, phpFastCacheInvalidArgumentException, phpFastCacheRootException, phpFastCacheSimpleCacheException |
|
23 | 23 | }; |
24 | 24 | use Psr\SimpleCache\CacheInterface; |
25 | 25 | |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | { |
77 | 77 | try { |
78 | 78 | $cacheItem = $this->internalCacheInstance |
79 | - ->getItem($key) |
|
80 | - ->set($value); |
|
79 | + ->getItem($key) |
|
80 | + ->set($value); |
|
81 | 81 | if (\is_int($ttl) && $ttl <= 0) { |
82 | 82 | $cacheItem->expiresAt((new \DateTime('@0'))); |
83 | 83 | } elseif (\is_int($ttl) || $ttl instanceof \DateInterval) { |
@@ -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\Helper; |
17 | 17 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function getMultiple($keys, $default = null) |
126 | 126 | { |
127 | 127 | try { |
128 | - return array_map(function (ExtendedCacheItemInterface $item) { |
|
128 | + return array_map(function(ExtendedCacheItemInterface $item) { |
|
129 | 129 | return $item->get(); |
130 | 130 | }, $this->internalCacheInstance->getItems($keys)); |
131 | 131 | } catch (phpFastCacheInvalidArgumentException $e) { |
@@ -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\Helper; |
17 | 17 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function __construct() |
39 | 39 | { |
40 | - $this->instances =& CacheManager::getInternalInstances(); |
|
40 | + $this->instances = & CacheManager::getInternalInstances(); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | */ |
46 | 46 | protected function getGenericCallback(): \Closure |
47 | 47 | { |
48 | - return function ($method, $args) { |
|
48 | + return function($method, $args) { |
|
49 | 49 | $return = []; |
50 | 50 | foreach ($this->instances as $instance) { |
51 | 51 | $reflectionMethod = new \ReflectionMethod(\get_class($instance), $method); |
52 | - $return[ $instance->getDriverName() ] = $reflectionMethod->invokeArgs($instance, $args); |
|
52 | + $return[$instance->getDriverName()] = $reflectionMethod->invokeArgs($instance, $args); |
|
53 | 53 | } |
54 | 54 | return $return; |
55 | 55 | }; |
@@ -62,5 +62,5 @@ |
||
62 | 62 | |
63 | 63 | if ((!\defined('PFC_IGNORE_COMPOSER_WARNING') || !PFC_IGNORE_COMPOSER_WARNING) && \class_exists('Composer\Autoload\ClassLoader')) { |
64 | 64 | trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.', |
65 | - E_USER_WARNING); |
|
65 | + E_USER_WARNING); |
|
66 | 66 | } |
67 | 67 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Phpfastcache\Autoload; |
4 | 4 | |
5 | 5 | /** |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * |
16 | 16 | */ |
17 | 17 | |
18 | -class Autoload{} |
|
18 | +class Autoload {} |
|
19 | 19 | |
20 | 20 | \define('PFC_PHP_EXT', 'php'); |
21 | 21 | \define('PFC_BIN_DIR', __DIR__ . '/../../../bin/'); |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * Register Autoload |
26 | 26 | */ |
27 | -spl_autoload_register(function ($entity) { |
|
27 | +spl_autoload_register(function($entity) { |
|
28 | 28 | $module = \explode('\\', $entity, 2); |
29 | - if (!\in_array($module[ 0 ], ['Phpfastcache', 'Psr'])) { |
|
29 | + if (!\in_array($module[0], ['Phpfastcache', 'Psr'])) { |
|
30 | 30 | /** |
31 | 31 | * Not a part of phpFastCache file |
32 | 32 | * then we return here. |
@@ -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\Proxy; |
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\Core\Item; |
17 | 17 |