@@ -28,7 +28,7 @@ |
||
28 | 28 | /** |
29 | 29 | * @var int |
30 | 30 | */ |
31 | - protected $port = 8091;// SSL: 18091 |
|
31 | + protected $port = 8091; // SSL: 18091 |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @var string |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $fallback = $config->getFallback(); |
166 | 166 | $config->setFallback(''); |
167 | 167 | \trigger_error(\sprintf('The "%s" driver is unavailable at the moment, the fallback driver "%s" has been used instead.', $driver, |
168 | - $fallback), \E_USER_WARNING); |
|
168 | + $fallback), \E_USER_WARNING); |
|
169 | 169 | return self::getInstance($fallback, $config->getFallbackConfig()); |
170 | 170 | } catch (PhpfastcacheInvalidArgumentException $e) { |
171 | 171 | throw new PhpfastcacheInvalidConfigurationException('Invalid fallback driver configuration', 0, $e); |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | public static function clearInstance(ExtendedCacheItemPoolInterface $cachePoolInstance): bool |
284 | 284 | { |
285 | 285 | $found = false; |
286 | - self::$instances = \array_filter(\array_map(function (ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found){ |
|
287 | - if(\spl_object_hash($cachePool) === \spl_object_hash($cachePoolInstance)){ |
|
286 | + self::$instances = \array_filter(\array_map(function(ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found){ |
|
287 | + if (\spl_object_hash($cachePool) === \spl_object_hash($cachePoolInstance)) { |
|
288 | 288 | $found = true; |
289 | 289 | return null; |
290 | 290 | } |
@@ -108,16 +108,16 @@ |
||
108 | 108 | public function setServers(array $servers): self |
109 | 109 | { |
110 | 110 | foreach ($servers as $server) { |
111 | - if($diff = \array_diff(['host', 'port', 'saslUser', 'saslPassword'], \array_keys($server))){ |
|
112 | - throw new PhpfastcacheInvalidConfigurationException('Missing keys for memcached server: '. \implode(', ', $diff)); |
|
111 | + if ($diff = \array_diff(['host', 'port', 'saslUser', 'saslPassword'], \array_keys($server))) { |
|
112 | + throw new PhpfastcacheInvalidConfigurationException('Missing keys for memcached server: ' . \implode(', ', $diff)); |
|
113 | 113 | } |
114 | - if($diff = \array_diff( \array_keys($server), ['host', 'port', 'saslUser', 'saslPassword'])){ |
|
115 | - throw new PhpfastcacheInvalidConfigurationException('Unknown keys for memcached server: '. \implode(', ', $diff)); |
|
114 | + if ($diff = \array_diff(\array_keys($server), ['host', 'port', 'saslUser', 'saslPassword'])) { |
|
115 | + throw new PhpfastcacheInvalidConfigurationException('Unknown keys for memcached server: ' . \implode(', ', $diff)); |
|
116 | 116 | } |
117 | - if(!\is_string($server['host'])){ |
|
117 | + if (!\is_string($server['host'])) { |
|
118 | 118 | throw new PhpfastcacheInvalidConfigurationException('Host must be a valid string in "$server" configuration array'); |
119 | 119 | } |
120 | - if(!\is_int($server['port'])){ |
|
120 | + if (!\is_int($server['port'])) { |
|
121 | 121 | throw new PhpfastcacheInvalidConfigurationException('Port must be a valid integer in "$server" configuration array'); |
122 | 122 | } |
123 | 123 | } |
@@ -108,16 +108,16 @@ |
||
108 | 108 | public function setServers(array $servers): self |
109 | 109 | { |
110 | 110 | foreach ($servers as $server) { |
111 | - if($diff = \array_diff(['host', 'port', 'saslUser', 'saslPassword'], \array_keys($server))){ |
|
112 | - throw new PhpfastcacheInvalidConfigurationException('Missing keys for memcached server: '. \implode(', ', $diff)); |
|
111 | + if ($diff = \array_diff(['host', 'port', 'saslUser', 'saslPassword'], \array_keys($server))) { |
|
112 | + throw new PhpfastcacheInvalidConfigurationException('Missing keys for memcached server: ' . \implode(', ', $diff)); |
|
113 | 113 | } |
114 | - if($diff = \array_diff( \array_keys($server), ['host', 'port', 'saslUser', 'saslPassword'])){ |
|
115 | - throw new PhpfastcacheInvalidConfigurationException('Unknown keys for memcached server: '. \implode(', ', $diff)); |
|
114 | + if ($diff = \array_diff(\array_keys($server), ['host', 'port', 'saslUser', 'saslPassword'])) { |
|
115 | + throw new PhpfastcacheInvalidConfigurationException('Unknown keys for memcached server: ' . \implode(', ', $diff)); |
|
116 | 116 | } |
117 | - if(!\is_string($server['host'])){ |
|
117 | + if (!\is_string($server['host'])) { |
|
118 | 118 | throw new PhpfastcacheInvalidConfigurationException('Host must be a valid string in "$server" configuration array'); |
119 | 119 | } |
120 | - if(!\is_int($server['port'])){ |
|
120 | + if (!\is_int($server['port'])) { |
|
121 | 121 | throw new PhpfastcacheInvalidConfigurationException('Port must be a valid integer in "$server" configuration array'); |
122 | 122 | } |
123 | 123 | } |
@@ -136,7 +136,7 @@ |
||
136 | 136 | $keys = \iterator_to_array($keys); |
137 | 137 | } |
138 | 138 | try { |
139 | - return array_map(function (ExtendedCacheItemInterface $item) { |
|
139 | + return array_map(function(ExtendedCacheItemInterface $item) { |
|
140 | 140 | return $item->get(); |
141 | 141 | }, $this->internalCacheInstance->getItems($keys)); |
142 | 142 | } catch (PhpfastcacheInvalidArgumentException $e) { |