Passed
Pull Request — master (#856)
by
unknown
10:26
created
lib/Phpfastcache/Core/Pool/DriverBaseTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     protected ConfigurationOptionInterface $config;
42 42
 
43
-    protected object|array|null $instance;
43
+    protected object | array | null $instance;
44 44
 
45 45
     protected string $driverName;
46 46
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         }
157 157
 
158 158
         if ($stringifyDate) {
159
-            $wrap = \array_map(static function ($value) {
159
+            $wrap = \array_map(static function($value) {
160 160
                 if ($value instanceof DateTimeInterface) {
161 161
                     return $value->format(DateTimeInterface::W3C);
162 162
                 }
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Mongodb/Driver.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $this->database->selectCollection($collectionName)
100 100
                 ->createIndex(
101 101
                     [self::DRIVER_EDATE_WRAPPER_INDEX => 1],
102
-                    ['expireAfterSeconds' => 0,  'name' => 'auto_expire_index']
102
+                    ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index']
103 103
                 );
104 104
         }
105 105
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                     self::DRIVER_CDATE_WRAPPER_INDEX =>  new UTCDateTime($item->getCreationDate()),
162 162
                 ];
163 163
             }
164
-            $result = (array)$this->getCollection()->updateOne(
164
+            $result = (array) $this->getCollection()->updateOne(
165 165
                 ['_id' => $this->getMongoDbItemKey($item)],
166 166
                 [
167 167
                     '$set' => $set,
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             )
231 231
         )->toArray()[0];
232 232
 
233
-        $arrayFilterRecursive = static function ($array, callable $callback = null) use (&$arrayFilterRecursive) {
233
+        $arrayFilterRecursive = static function($array, callable $callback = null) use (&$arrayFilterRecursive) {
234 234
             $array = $callback($array);
235 235
 
236 236
             if (\is_object($array) || \is_array($array)) {
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
             return $array;
243 243
         };
244 244
 
245
-        $callback = static function ($item) {
245
+        $callback = static function($item) {
246 246
             /**
247 247
              * Remove unserializable properties
248 248
              */
249 249
             if ($item instanceof UTCDateTime) {
250
-                return (string)$item;
250
+                return (string) $item;
251 251
             }
252 252
             return $item;
253 253
         };
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
         if (count($servers) > 0) {
302 302
             $host = array_reduce(
303 303
                 $servers,
304
-                static fn ($carry, $data) => $carry . ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port'],
304
+                static fn($carry, $data) => $carry . ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port'],
305 305
                 ''
306 306
             );
307 307
             $port = false;
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Apcu/Driver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function getStats(): DriverStatistic
49 49
     {
50
-        $stats = (array)apcu_cache_info();
50
+        $stats = (array) apcu_cache_info();
51 51
         $date = (new DateTime())->setTimestamp($stats['start_time']);
52 52
 
53 53
         return (new DriverStatistic())
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 )
61 61
             )
62 62
             ->setRawData($stats)
63
-            ->setSize((int)$stats['mem_size']);
63
+            ->setSize((int) $stats['mem_size']);
64 64
     }
65 65
 
66 66
     /**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $this->assertCacheItemType($item, Item::class);
82 82
 
83
-        return (bool)apcu_store($item->getKey(), $this->driverPreWrap($item), $item->getTtl());
83
+        return (bool) apcu_store($item->getKey(), $this->driverPreWrap($item), $item->getTtl());
84 84
     }
85 85
 
86 86
     /**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $this->assertCacheItemType($item, Item::class);
109 109
 
110
-        return (bool)apcu_delete($item->getKey());
110
+        return (bool) apcu_delete($item->getKey());
111 111
     }
112 112
 
113 113
     /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Firestore/Driver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 
137 137
     protected function decodeFirestoreDocument(array $snapshotData): array
138 138
     {
139
-        return \array_map(static function ($datum) {
139
+        return \array_map(static function($datum) {
140 140
             if ($datum instanceof GoogleTimestamp) {
141 141
                 $date = $datum->get();
142 142
                 if ($date instanceof \DateTimeImmutable) {
Please login to merge, or discard this patch.
lib/Phpfastcache/Helper/Psr16Adapter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @return bool
88 88
      * @throws PhpfastcacheSimpleCacheException
89 89
      */
90
-    public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool
90
+    public function set(string $key, mixed $value, null | int | \DateInterval $ttl = null): bool
91 91
     {
92 92
         try {
93 93
             $cacheItem = $this->internalCacheInstance
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         }
146 146
         try {
147 147
             return \array_map(
148
-                static fn (ExtendedCacheItemInterface $item) => $item->isHit() ? $item->get() : $default,
148
+                static fn(ExtendedCacheItemInterface $item) => $item->isHit() ? $item->get() : $default,
149 149
                 $this->internalCacheInstance->getItems($keys)
150 150
             );
151 151
         } catch (PhpfastcacheInvalidArgumentException $e) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      * @return bool
160 160
      * @throws PhpfastcacheSimpleCacheException
161 161
      */
162
-    public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool
162
+    public function setMultiple(iterable $values, null | int | \DateInterval $ttl = null): bool
163 163
     {
164 164
         try {
165 165
             foreach ($values as $key => $value) {
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Item/ExtendedCacheItemInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      * @return ExtendedCacheItemInterface
172 172
      * @throws PhpfastcacheInvalidTypeException
173 173
      */
174
-    public function append(array|string $data): ExtendedCacheItemInterface;
174
+    public function append(array | string $data): ExtendedCacheItemInterface;
175 175
 
176 176
     /**
177 177
      * @param array|string $data
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      * @return ExtendedCacheItemInterface
180 180
      * @throws PhpfastcacheInvalidTypeException
181 181
      */
182
-    public function prepend(array|string $data): ExtendedCacheItemInterface;
182
+    public function prepend(array | string $data): ExtendedCacheItemInterface;
183 183
 
184 184
     /**
185 185
      * Return the data as a well-formatted string.
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     /**
246 246
      * @throws PhpfastcacheInvalidTypeException
247 247
      */
248
-    public function append(array|string $data): ExtendedCacheItemInterface
248
+    public function append(array | string $data): ExtendedCacheItemInterface
249 249
     {
250 250
         if ($this->data !== null && !\is_string($this->data) && !\is_array($this->data)) {
251 251
             throw new PhpfastcacheInvalidTypeException(\sprintf('Cannot append on a "%s" type.', \gettype($this->data)));
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     /**
264 264
      * @throws PhpfastcacheInvalidTypeException
265 265
      */
266
-    public function prepend(array|string $data): ExtendedCacheItemInterface
266
+    public function prepend(array | string $data): ExtendedCacheItemInterface
267 267
     {
268 268
         if ($this->data !== null && !\is_string($this->data) && !\is_array($this->data)) {
269 269
             throw new PhpfastcacheInvalidTypeException(\sprintf('Cannot prepend on a "%s" type.', \gettype($this->data)));
Please login to merge, or discard this patch.
lib/Phpfastcache/Config/ConfigurationOption.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     /**
157 157
      * @return callable|string
158 158
      */
159
-    public function getDefaultKeyHashFunction(): callable|string
159
+    public function getDefaultKeyHashFunction(): callable | string
160 160
     {
161 161
         return $this->defaultKeyHashFunction;
162 162
     }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      * @throws  PhpfastcacheInvalidConfigurationException
168 168
      * @throws PhpfastcacheLogicException
169 169
      */
170
-    public function setDefaultKeyHashFunction(callable|string $defaultKeyHashFunction): static
170
+    public function setDefaultKeyHashFunction(callable | string $defaultKeyHashFunction): static
171 171
     {
172 172
         $this->enforceLockedProperty(__FUNCTION__);
173 173
         if ($defaultKeyHashFunction && !\is_callable($defaultKeyHashFunction) && (\is_string($defaultKeyHashFunction) && !\function_exists($defaultKeyHashFunction))) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
     /**
181 181
      * @return callable|string
182 182
      */
183
-    public function getDefaultFileNameHashFunction(): callable|string
183
+    public function getDefaultFileNameHashFunction(): callable | string
184 184
     {
185 185
         return $this->defaultFileNameHashFunction;
186 186
     }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      * @throws  PhpfastcacheInvalidConfigurationException
192 192
      * @throws PhpfastcacheLogicException
193 193
      */
194
-    public function setDefaultFileNameHashFunction(callable|string $defaultFileNameHashFunction): static
194
+    public function setDefaultFileNameHashFunction(callable | string $defaultFileNameHashFunction): static
195 195
     {
196 196
         $this->enforceLockedProperty(__FUNCTION__);
197 197
         if (!\is_callable($defaultFileNameHashFunction) && (\is_string($defaultFileNameHashFunction) && !\function_exists($defaultFileNameHashFunction))) {
@@ -332,8 +332,8 @@  discard block
 block discarded – undo
332 332
      */
333 333
     protected function getDefaultSuperGlobalAccessor(): \Closure
334 334
     {
335
-        return \Closure::fromCallable(static function (string $superGlobalName, ?string $keyName = null): string|int|float|array|bool|null {
336
-            return match ($superGlobalName) {
335
+        return \Closure::fromCallable(static function(string $superGlobalName, ?string $keyName = null): string | int | float | array | bool | null {
336
+            return match($superGlobalName) {
337 337
                 'SERVER' => $keyName !== null ? $_SERVER[$keyName] ?? null : $_SERVER,
338 338
                 'REQUEST' => $keyName !== null ? $_REQUEST[$keyName] ?? null : $_REQUEST,
339 339
                 'COOKIE' => $keyName !== null ? $_COOKIE[$keyName] ?? null : $_COOKIE,
Please login to merge, or discard this patch.
lib/Phpfastcache/Util/Directory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
         /**
141 141
          * Allows dereferencing char
142 142
          */
143
-        $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc.
143
+        $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__); // remove file protocols such as "phar://" etc.
144 144
         $prefix = $file[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '';
145 145
         return $prefix . implode(DIRECTORY_SEPARATOR, $absolutes);
146 146
     }
Please login to merge, or discard this patch.