Passed
Push — v7 ( 2da68a...ef6b54 )
by Georges
01:58
created
lib/Phpfastcache/Entities/DriverStatistic.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -135,10 +135,10 @@
 block discarded – undo
135 135
     public function getPublicDesc(): array
136 136
     {
137 137
         return [
138
-          'Info' => 'Cache Information',
139
-          'Size' => 'Cache Size',
140
-          'Data' => 'Cache items keys',
141
-          'RawData' => 'Cache raw data',
138
+            'Info' => 'Cache Information',
139
+            'Size' => 'Cache Size',
140
+            'Data' => 'Cache items keys',
141
+            'RawData' => 'Cache raw data',
142 142
         ];
143 143
     }
144 144
 }
145 145
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memcache/Config.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
16 16
      * @var array
17 17
      */
18 18
     protected $servers = [
19
-      [
19
+        [
20 20
         'host' => '127.0.0.1',
21 21
         'port' => 11211,
22 22
         'saslUser' => false,
23 23
         'saslPassword' => false,
24
-      ],
24
+        ],
25 25
     ];
26 26
 
27 27
     /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memcache/Driver.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
                  */
153 153
                 if(!empty($server[ 'path' ]) && !$this->instance->addServer($server[ 'path' ], 0)){
154 154
                     $this->fallback = true;
155
-                }else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
155
+                } else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
156 156
                     $this->fallback = true;
157 157
                 }
158 158
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface};
21 21
 use Phpfastcache\Entities\DriverStatistic;
22 22
 use Phpfastcache\Exceptions\{
23
-  PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException
23
+    PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException
24 24
 };
25 25
 use Phpfastcache\Util\{ArrayObject, MemcacheDriverCollisionDetectorTrait};
26 26
 use Psr\Cache\CacheItemInterface;
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 
75 75
         if (\count($servers) < 1) {
76 76
             $servers = [
77
-              [
77
+                [
78 78
                 'host' => $this->getConfig()->getHost(),
79 79
                 'path' => $this->getConfig()->getPath(),
80 80
                 'port' => $this->getConfig()->getPort(),
81 81
                 'saslUser' => $this->getConfig()->getSaslUser() ?: false,
82 82
                 'saslPassword' => $this->getConfig()->getSaslPassword() ?: false,
83
-              ],
83
+                ],
84 84
             ];
85 85
         }
86 86
 
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
         $date = (new \DateTime())->setTimestamp(\time() - $stats[ 'uptime' ]);
198 198
 
199 199
         return (new DriverStatistic())
200
-          ->setData(\implode(', ', \array_keys($this->itemInstances)))
201
-          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
202
-          ->setRawData($stats)
203
-          ->setSize((int)$stats[ 'bytes' ]);
200
+            ->setData(\implode(', ', \array_keys($this->itemInstances)))
201
+            ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
202
+            ->setRawData($stats)
203
+            ->setSize((int)$stats[ 'bytes' ]);
204 204
     }
205 205
 }
206 206
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
                 /**
90 90
                  * If path is provided we consider it as an UNIX Socket
91 91
                  */
92
-                if(!empty($server[ 'path' ]) && !$this->instance->addServer($server[ 'path' ], 0)){
92
+                if (!empty($server['path']) && !$this->instance->addServer($server['path'], 0)) {
93 93
                     $this->fallback = true;
94
-                }else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
94
+                } else if (!empty($server['host']) && !$this->instance->addServer($server['host'], $server['port'])) {
95 95
                     $this->fallback = true;
96 96
                 }
97 97
 
98
-                if (!empty($server[ 'saslUser' ]) && !empty($server[ 'saslPassword' ])) {
98
+                if (!empty($server['saslUser']) && !empty($server['saslPassword'])) {
99 99
                     throw new PhpfastcacheDriverException('Unlike Memcached, Memcache does not support SASL authentication');
100 100
                 }
101 101
             } catch (\Exception $e) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
              * Since Memcached does not throw
107 107
              * any error if not connected ...
108 108
              */
109
-            if(!$this->instance->getServerStatus(!empty($server[ 'path' ]) ? $server[ 'path' ] : $server[ 'host' ], !empty($server[ 'port' ]) ? $server[ 'port' ] : 0)){
109
+            if (!$this->instance->getServerStatus(!empty($server['path']) ? $server['path'] : $server['host'], !empty($server['port']) ? $server['port'] : 0)) {
110 110
                 throw new PhpfastcacheDriverException('Memcache seems to not be connected');
111 111
             }
112 112
         }
@@ -189,17 +189,17 @@  discard block
 block discarded – undo
189 189
      */
190 190
     public function getStats(): DriverStatistic
191 191
     {
192
-        $stats = (array)$this->instance->getstats();
193
-        $stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0);
194
-        $stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : 'UnknownVersion');
195
-        $stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0);
192
+        $stats = (array) $this->instance->getstats();
193
+        $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0);
194
+        $stats['version'] = (isset($stats['version']) ? $stats['version'] : 'UnknownVersion');
195
+        $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0);
196 196
 
197
-        $date = (new \DateTime())->setTimestamp(\time() - $stats[ 'uptime' ]);
197
+        $date = (new \DateTime())->setTimestamp(\time() - $stats['uptime']);
198 198
 
199 199
         return (new DriverStatistic())
200 200
           ->setData(\implode(', ', \array_keys($this->itemInstances)))
201
-          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
201
+          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822)))
202 202
           ->setRawData($stats)
203
-          ->setSize((int)$stats[ 'bytes' ]);
203
+          ->setSize((int) $stats['bytes']);
204 204
     }
205 205
 }
206 206
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Couchbase/Driver.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
         if ($item instanceof Item) {
135 135
             try{
136 136
                 return (bool)$this->getBucket()->remove($item->getEncodedKey());
137
-            }catch (\Couchbase\Exception $e){
137
+            } catch (\Couchbase\Exception $e){
138 138
                 return $e->getCode() === COUCHBASE_KEY_ENOENT;
139 139
             }
140 140
         }
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 
18 18
 use CouchbaseCluster as CouchbaseClient;
19 19
 use Phpfastcache\Core\Pool\{
20
-  DriverBaseTrait, ExtendedCacheItemPoolInterface
20
+    DriverBaseTrait, ExtendedCacheItemPoolInterface
21 21
 };
22 22
 use Phpfastcache\Entities\DriverStatistic;
23 23
 use Phpfastcache\Exceptions\{
24
-  PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException
24
+    PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException
25 25
 };
26 26
 use Phpfastcache\Util\ArrayObject;
27 27
 use Psr\Cache\CacheItemInterface;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 
75 75
         $this->instance = new CouchbaseClient(
76
-          'couchbase://' . $clientConfig->getHost() . ($clientConfig->getPort() ? ":{$clientConfig->getPort()}" : '')
76
+            'couchbase://' . $clientConfig->getHost() . ($clientConfig->getPort() ? ":{$clientConfig->getPort()}" : '')
77 77
         );
78 78
 
79 79
         $this->instance->authenticate($authenticator);
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
         $info = $this->getBucket()->manager()->info();
190 190
 
191 191
         return (new DriverStatistic())
192
-          ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
193
-          ->setRawData($info)
194
-          ->setData(\implode(', ', \array_keys($this->itemInstances)))
195
-          ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400,
196
-              1) . "\n For more information see RawData.");
192
+            ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
193
+            ->setRawData($info)
194
+            ->setData(\implode(', ', \array_keys($this->itemInstances)))
195
+            ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400,
196
+                1) . "\n For more information see RawData.");
197 197
     }
198 198
 }
199 199
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
         $this->instance->authenticate($authenticator);
80 80
 
81 81
         foreach ($clientConfig->getBuckets() as $bucket) {
82
-            $this->currentBucket = $this->currentBucket ?: $bucket[ 'bucket' ];
83
-            $this->setBucket($bucket[ 'bucket' ], $this->instance->openBucket($bucket[ 'bucket' ]));
82
+            $this->currentBucket = $this->currentBucket ?: $bucket['bucket'];
83
+            $this->setBucket($bucket['bucket'], $this->instance->openBucket($bucket['bucket']));
84 84
         }
85 85
 
86 86
         return true;
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
          */
115 115
         if ($item instanceof Item) {
116 116
             try {
117
-                return (bool)$this->getBucket()->upsert($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), ['expiry' => $item->getTtl()]);
117
+                return (bool) $this->getBucket()->upsert($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), ['expiry' => $item->getTtl()]);
118 118
             } catch (\CouchbaseException $e) {
119 119
                 return false;
120 120
             }
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
          * Check for Cross-Driver type confusion
135 135
          */
136 136
         if ($item instanceof Item) {
137
-            try{
138
-                return (bool)$this->getBucket()->remove($item->getEncodedKey());
139
-            }catch (\Couchbase\Exception $e){
137
+            try {
138
+                return (bool) $this->getBucket()->remove($item->getEncodedKey());
139
+            } catch (\Couchbase\Exception $e) {
140 140
                 return $e->getCode() === COUCHBASE_KEY_ENOENT;
141 141
             }
142 142
         }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     protected function getBucket(): \CouchbaseBucket
160 160
     {
161
-        return $this->bucketInstances[ $this->currentBucket ];
161
+        return $this->bucketInstances[$this->currentBucket];
162 162
     }
163 163
 
164 164
     /**
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     protected function setBucket($bucketName, \CouchbaseBucket $CouchbaseBucket)
170 170
     {
171 171
         if (!\array_key_exists($bucketName, $this->bucketInstances)) {
172
-            $this->bucketInstances[ $bucketName ] = $CouchbaseBucket;
172
+            $this->bucketInstances[$bucketName] = $CouchbaseBucket;
173 173
         } else {
174 174
             throw new PhpfastcacheLogicException('A bucket instance with this name already exists.');
175 175
         }
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
         $info = $this->getBucket()->manager()->info();
190 190
 
191 191
         return (new DriverStatistic())
192
-          ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
192
+          ->setSize($info['basicStats']['diskUsed'])
193 193
           ->setRawData($info)
194 194
           ->setData(\implode(', ', \array_keys($this->itemInstances)))
195
-          ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400,
195
+          ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400,
196 196
               1) . "\n For more information see RawData.");
197 197
     }
198 198
 }
199 199
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memcached/Driver.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
                  */
153 153
                 if(!empty($server[ 'path' ]) && !$this->instance->addServer($server[ 'path' ], 0)){
154 154
                     $this->fallback = true;
155
-                }else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
155
+                } else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
156 156
                     $this->fallback = true;
157 157
                 }
158 158
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface};
21 21
 use Phpfastcache\Entities\DriverStatistic;
22 22
 use Phpfastcache\Exceptions\{
23
-  PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException
23
+    PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException
24 24
 };
25 25
 use Phpfastcache\Util\{ArrayObject, MemcacheDriverCollisionDetectorTrait};
26 26
 use Psr\Cache\CacheItemInterface;
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 
75 75
         if (\count($servers) < 1) {
76 76
             $servers = [
77
-              [
77
+                [
78 78
                 'host' => $this->getConfig()->getHost(),
79 79
                 'path' => $this->getConfig()->getPath(),
80 80
                 'port' => $this->getConfig()->getPort(),
81 81
                 'saslUser' => $this->getConfig()->getSaslUser() ?: false,
82 82
                 'saslPassword' => $this->getConfig()->getSaslPassword() ?: false,
83
-              ],
83
+                ],
84 84
             ];
85 85
         }
86 86
 
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
         $date = (new \DateTime())->setTimestamp(\time() - $stats[ 'uptime' ]);
198 198
 
199 199
         return (new DriverStatistic())
200
-          ->setData(\implode(', ', \array_keys($this->itemInstances)))
201
-          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
202
-          ->setRawData($stats)
203
-          ->setSize((int)$stats[ 'bytes' ]);
200
+            ->setData(\implode(', ', \array_keys($this->itemInstances)))
201
+            ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
202
+            ->setRawData($stats)
203
+            ->setSize((int)$stats[ 'bytes' ]);
204 204
     }
205 205
 }
206 206
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
                 /**
86 86
                  * If path is provided we consider it as an UNIX Socket
87 87
                  */
88
-                if(!empty($server[ 'path' ]) && !$this->instance->addServer($server[ 'path' ], 0)){
88
+                if (!empty($server['path']) && !$this->instance->addServer($server['path'], 0)) {
89 89
                     $this->fallback = true;
90
-                }else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
90
+                } else if (!empty($server['host']) && !$this->instance->addServer($server['host'], $server['port'])) {
91 91
                     $this->fallback = true;
92 92
                 }
93 93
 
94
-                if (!empty($server[ 'saslUser' ]) && !empty($server[ 'saslPassword' ])) {
95
-                    $this->instance->setSaslAuthData($server[ 'saslUser' ], $server[ 'saslPassword' ]);
94
+                if (!empty($server['saslUser']) && !empty($server['saslPassword'])) {
95
+                    $this->instance->setSaslAuthData($server['saslUser'], $server['saslPassword']);
96 96
                 }
97 97
 
98 98
             } catch (\Exception $e) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
          * any error if not connected ...
106 106
          */
107 107
         $version = $this->instance->getVersion();
108
-        if(!$version || $this->instance->getResultCode() !== MemcachedSoftware::RES_SUCCESS){
108
+        if (!$version || $this->instance->getResultCode() !== MemcachedSoftware::RES_SUCCESS) {
109 109
             throw new PhpfastcacheDriverException('Memcached seems to not be connected');
110 110
         }
111 111
         return true;
@@ -188,16 +188,16 @@  discard block
 block discarded – undo
188 188
     public function getStats(): DriverStatistic
189 189
     {
190 190
         $stats = current($this->instance->getStats());
191
-        $stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0);
192
-        $stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : $this->instance->getVersion());
193
-        $stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0);
191
+        $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0);
192
+        $stats['version'] = (isset($stats['version']) ? $stats['version'] : $this->instance->getVersion());
193
+        $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0);
194 194
 
195
-        $date = (new \DateTime())->setTimestamp(\time() - $stats[ 'uptime' ]);
195
+        $date = (new \DateTime())->setTimestamp(\time() - $stats['uptime']);
196 196
 
197 197
         return (new DriverStatistic())
198 198
           ->setData(\implode(', ', \array_keys($this->itemInstances)))
199
-          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
199
+          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822)))
200 200
           ->setRawData($stats)
201
-          ->setSize((int)$stats[ 'bytes' ]);
201
+          ->setSize((int) $stats['bytes']);
202 202
     }
203 203
 }
204 204
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Phpfastcache/Config/Config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,4 +14,4 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
lib/Phpfastcache/Config/ConfigurationOption.php 3 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
             if(array_key_exists($property, $array)){
106 106
                 $this->$property = &$array[ $property ];
107
-            }else{
107
+            } else{
108 108
                 $array[ $property ] = &$this->$property;
109 109
             }
110 110
         }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                      */
122 122
                     $value = $this->{lcfirst(substr($method, 3))};
123 123
                     $this->{$method}($value);
124
-                }catch(\TypeError $e){
124
+                } catch(\TypeError $e){
125 125
                     $typeHintGot = \is_object($value) ? \get_class($value) : \gettype($value);
126 126
                     $reflectionMethod = new \ReflectionMethod($this, $method);
127 127
                     $parameter = $reflectionMethod->getParameters()[0] ?? null;
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -92,33 +92,33 @@  discard block
 block discarded – undo
92 92
     public function __construct(...$args)
93 93
     {
94 94
         parent::__construct(...$args);
95
-        $array =& $this->getArray();
95
+        $array = & $this->getArray();
96 96
 
97 97
         /**
98 98
          * Detect unwanted keys and throw an exception.
99 99
          * No more kidding now, it's 21th century.
100 100
          */
101
-        if(array_diff_key($array, get_object_vars($this))){
101
+        if (array_diff_key($array, get_object_vars($this))) {
102 102
             throw new PhpfastcacheInvalidConfigurationException(\sprintf(
103 103
               'Invalid option(s) for the config %s: %s',
104 104
               static::class,
105
-              implode(', ',  array_keys(array_diff_key($array, get_object_vars($this))))
105
+              implode(', ', array_keys(array_diff_key($array, get_object_vars($this))))
106 106
             ));
107 107
         }
108 108
 
109 109
         foreach (get_object_vars($this) as $property => $value) {
110 110
 
111
-            if(array_key_exists($property, $array)){
112
-                $this->$property = &$array[ $property ];
113
-            }else{
114
-                $array[ $property ] = &$this->$property;
111
+            if (array_key_exists($property, $array)) {
112
+                $this->$property = &$array[$property];
113
+            } else {
114
+                $array[$property] = &$this->$property;
115 115
             }
116 116
         }
117 117
 
118 118
         foreach (get_class_methods($this) as $method) {
119
-            if(strpos($method, 'set') === 0){
119
+            if (strpos($method, 'set') === 0) {
120 120
                 $value = null;
121
-                try{
121
+                try {
122 122
                     /**
123 123
                      * We use property instead of getter
124 124
                      * because of is/get conditions and
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                      */
128 128
                     $value = $this->{lcfirst(substr($method, 3))};
129 129
                     $this->{$method}($value);
130
-                }catch(\TypeError $e){
130
+                } catch (\TypeError $e) {
131 131
                     $typeHintGot = \is_object($value) ? \get_class($value) : \gettype($value);
132 132
                     $reflectionMethod = new \ReflectionMethod($this, $method);
133 133
                     $parameter = $reflectionMethod->getParameters()[0] ?? null;
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      */
217 217
     public function setIgnoreSymfonyNotice(bool $ignoreSymfonyNotice): self
218 218
     {
219
-        if($ignoreSymfonyNotice){
219
+        if ($ignoreSymfonyNotice) {
220 220
             \trigger_error('Configuration option "ignoreSymfonyNotice" is deprecated as of the V7', E_USER_DEPRECATED);
221 221
         }
222 222
         $this->ignoreSymfonyNotice = $ignoreSymfonyNotice;
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
      */
332 332
     public function setFallbackConfig($fallbackConfig): self
333 333
     {
334
-        if($fallbackConfig !== null && !($fallbackConfig instanceof self)){
334
+        if ($fallbackConfig !== null && !($fallbackConfig instanceof self)) {
335 335
             throw new PhpfastcacheInvalidArgumentException(\sprintf(
336 336
               'Invalid argument "%s" for %s',
337 337
               gettype($fallbackConfig) === 'object' ? get_class($fallbackConfig) : gettype($fallbackConfig),
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
          */
106 106
         if(array_diff_key($array, get_object_vars($this))){
107 107
             throw new PhpfastcacheInvalidConfigurationException(\sprintf(
108
-              'Invalid option(s) for the config %s: %s',
109
-              static::class,
110
-              implode(', ',  array_keys(array_diff_key($array, get_object_vars($this))))
108
+                'Invalid option(s) for the config %s: %s',
109
+                static::class,
110
+                implode(', ',  array_keys(array_diff_key($array, get_object_vars($this))))
111 111
             ));
112 112
         }
113 113
 
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
                     $typeHintExpected = ($parameter instanceof \ReflectionParameter ? ($parameter->getType() === 'object' ? $parameter->getClass() : $parameter->getType()) : 'Unknown type');
140 140
 
141 141
                     throw new PhpfastcacheInvalidConfigurationException(\sprintf(
142
-                      'Invalid type hint found for "%s", expected "%s" got "%s"',
143
-                      lcfirst(substr($method, 3)),
144
-                      $typeHintExpected,
145
-                      $typeHintGot
142
+                        'Invalid type hint found for "%s", expected "%s" got "%s"',
143
+                        lcfirst(substr($method, 3)),
144
+                        $typeHintExpected,
145
+                        $typeHintGot
146 146
                     ));
147 147
                 }
148 148
             }
@@ -360,9 +360,9 @@  discard block
 block discarded – undo
360 360
     {
361 361
         if($fallbackConfig !== null && !($fallbackConfig instanceof self)){
362 362
             throw new PhpfastcacheInvalidArgumentException(\sprintf(
363
-              'Invalid argument "%s" for %s',
364
-              gettype($fallbackConfig) === 'object' ? get_class($fallbackConfig) : gettype($fallbackConfig),
365
-              __METHOD__
363
+                'Invalid argument "%s" for %s',
364
+                gettype($fallbackConfig) === 'object' ? get_class($fallbackConfig) : gettype($fallbackConfig),
365
+                __METHOD__
366 366
             ));
367 367
         }
368 368
         $this->fallbackConfig = $fallbackConfig;
@@ -461,10 +461,10 @@  discard block
 block discarded – undo
461 461
          * by opening a pull request :)
462 462
          */
463 463
         static $safeFileExtensions = [
464
-          'txt',
465
-          'cache',
466
-          'db',
467
-          'pfc',
464
+            'txt',
465
+            'cache',
466
+            'db',
467
+            'pfc',
468 468
         ];
469 469
 
470 470
         if (\strpos($cacheFileExtension, '.') !== false) {
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
         }
473 473
         if (!\in_array($cacheFileExtension, $safeFileExtensions, true)) {
474 474
             throw new PhpfastcacheInvalidConfigurationException(
475
-              "Extension \"{$cacheFileExtension}\" is not safe, currently allowed extension names: " . \implode(', ', $safeFileExtensions)
475
+                "Extension \"{$cacheFileExtension}\" is not safe, currently allowed extension names: " . \implode(', ', $safeFileExtensions)
476 476
             );
477 477
         }
478 478
 
Please login to merge, or discard this patch.
lib/Phpfastcache/Util/Directory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,8 +83,8 @@
 block discarded – undo
83 83
 
84 84
         $files = new RecursiveIteratorIterator
85 85
         (
86
-          new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
87
-          RecursiveIteratorIterator::CHILD_FIRST
86
+            new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
87
+            RecursiveIteratorIterator::CHILD_FIRST
88 88
         );
89 89
         
90 90
         foreach ($files as $fileinfo) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,8 +87,7 @@  discard block
 block discarded – undo
87 87
             return \unlink($source);
88 88
         }
89 89
 
90
-        $files = new RecursiveIteratorIterator
91
-        (
90
+        $files = new RecursiveIteratorIterator(
92 91
           new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
93 92
           RecursiveIteratorIterator::CHILD_FIRST
94 93
         );
@@ -138,8 +137,8 @@  discard block
 block discarded – undo
138 137
         /**
139 138
          * Allows to dereference char
140 139
          */
141
-        $__FILE__ = \preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc.
142
-        $prefix = $__FILE__[ 0 ] === \DIRECTORY_SEPARATOR ? \DIRECTORY_SEPARATOR : '';
140
+        $__FILE__ = \preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__); // remove file protocols such as "phar://" etc.
141
+        $prefix = $__FILE__[0] === \DIRECTORY_SEPARATOR ? \DIRECTORY_SEPARATOR : '';
143 142
         return $prefix . \implode(\DIRECTORY_SEPARATOR, $absolutes);
144 143
     }
145 144
 }
146 145
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memcached/Config.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
16 16
      * @var array
17 17
      */
18 18
     protected $servers = [
19
-      [
19
+        [
20 20
         'host' => '127.0.0.1',
21 21
         'port' => 11211,
22 22
         'saslUser' => false,
23 23
         'saslPassword' => false,
24
-      ],
24
+        ],
25 25
     ];
26 26
 
27 27
     /**
Please login to merge, or discard this patch.