Completed
Push — v5 ( a234cb...4f37c0 )
by Georges
02:54
created
src/autoload.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         return;
28 28
     } else if (strpos($entity, 'Psr\Cache') === 0) {
29 29
         trigger_error('If you cannot use <b>composer</b>, you have to include manually the Psr\\Cache interfaces.<br />See: https://github.com/php-fig/cache/tree/master/src<br /> Called ' . $entity,
30
-          E_USER_ERROR);
30
+            E_USER_ERROR);
31 31
 
32 32
         return;
33 33
     }
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
 
43 43
 if (class_exists('Composer\Autoload\ClassLoader')) {
44 44
     trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.',
45
-      E_USER_WARNING);
45
+        E_USER_WARNING);
46 46
 }
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Core/MemcacheDriverCollisionDetectorTrait.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
                 return true;
28 28
             } else if (constant($CONSTANT_NAME) !== $driverName) {
29 29
                 trigger_error('Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours',
30
-                  E_USER_WARNING);
30
+                    E_USER_WARNING);
31 31
 
32 32
                 return false;
33 33
             }
Please login to merge, or discard this patch.
src/phpFastCache/Core/PathSeekerTrait.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
     protected static function cleanFileName($filename)
161 161
     {
162 162
         $regex = [
163
-          '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/',
164
-          '/\.$/',
165
-          '/^\./',
163
+            '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/',
164
+            '/\.$/',
165
+            '/^\./',
166 166
         ];
167 167
         $replace = ['-', '', ''];
168 168
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                     chmod($path, 0777);
183 183
                 } catch (phpFastCacheDriverException $e) {
184 184
                     throw new phpFastCacheDriverException('PLEASE CHMOD ' . $path . ' - 0777 OR ANY WRITABLE PERMISSION!',
185
-                      92);
185
+                        92);
186 186
                 }
187 187
             }
188 188
 
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Cookie/Item.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             $this->driver->setItem($this);
43 43
         } else {
44 44
             throw new \InvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.',
45
-              gettype($key)));
45
+                gettype($key)));
46 46
         }
47 47
     }
48 48
 
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Ssdb/Driver.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,10 +147,10 @@
 block discarded – undo
147 147
     {
148 148
         try{
149 149
             $server = isset($this->config[ 'ssdb' ]) ? $this->config[ 'ssdb' ] : [
150
-              'host' => "127.0.0.1",
151
-              'port' => 8888,
152
-              'password' => '',
153
-              'timeout' => 2000,
150
+                'host' => "127.0.0.1",
151
+                'port' => 8888,
152
+                'password' => '',
153
+                'timeout' => 2000,
154 154
             ];
155 155
 
156 156
             $host = $server[ 'host' ];
Please login to merge, or discard this patch.
src/phpFastCache/Cache/DriverBaseTrait.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -214,9 +214,9 @@
 block discarded – undo
214 214
     public function driverPreWrap(ExtendedCacheItemInterface $item)
215 215
     {
216 216
         return [
217
-          self::DRIVER_DATA_WRAPPER_INDEX => $item->get(),
218
-          self::DRIVER_TIME_WRAPPER_INDEX => $item->getExpirationDate(),
219
-          self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(),
217
+            self::DRIVER_DATA_WRAPPER_INDEX => $item->get(),
218
+            self::DRIVER_TIME_WRAPPER_INDEX => $item->getExpirationDate(),
219
+            self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(),
220 220
         ];
221 221
     }
222 222
 
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Redis/Driver.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -175,9 +175,9 @@
 block discarded – undo
175 175
         $info = $this->instance->info();
176 176
         $date = (new \DateTime())->setTimestamp(time() - $info['uptime_in_seconds']);
177 177
         return (new driverStatistic())
178
-          ->setData(implode(', ', array_keys($this->itemInstances)))
179
-          ->setRawData($info)
180
-          ->setSize($info['used_memory'])
181
-          ->setInfo(sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", $info['redis_version'], $date->format(DATE_RFC2822)));
178
+            ->setData(implode(', ', array_keys($this->itemInstances)))
179
+            ->setRawData($info)
180
+            ->setSize($info['used_memory'])
181
+            ->setInfo(sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", $info['redis_version'], $date->format(DATE_RFC2822)));
182 182
     }
183 183
 }
184 184
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Mongodb/Driver.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
         if ($item instanceof Item) {
79 79
             try {
80 80
                 $result = (array) $this->getCollection()->update(
81
-                  ['_id' => $item->getKey()],
82
-                  [
81
+                    ['_id' => $item->getKey()],
82
+                    [
83 83
                     '$set' => [
84
-                      self::DRIVER_TIME_WRAPPER_INDEX => ($item->getTtl() > 0 ? new MongoDate(time() + $item->getTtl()) : new MongoDate(time())),
85
-                      self::DRIVER_DATA_WRAPPER_INDEX => new MongoBinData($this->encode($item->get()), MongoBinData::BYTE_ARRAY),
86
-                      self::DRIVER_TAGS_WRAPPER_INDEX => new MongoBinData($this->encode($item->getTags()), MongoBinData::BYTE_ARRAY),
84
+                        self::DRIVER_TIME_WRAPPER_INDEX => ($item->getTtl() > 0 ? new MongoDate(time() + $item->getTtl()) : new MongoDate(time())),
85
+                        self::DRIVER_DATA_WRAPPER_INDEX => new MongoBinData($this->encode($item->get()), MongoBinData::BYTE_ARRAY),
86
+                        self::DRIVER_TAGS_WRAPPER_INDEX => new MongoBinData($this->encode($item->getTags()), MongoBinData::BYTE_ARRAY),
87 87
                     ],
88
-                  ],
89
-                  ['upsert' => true, 'multiple' => false]
88
+                    ],
89
+                    ['upsert' => true, 'multiple' => false]
90 90
                 );
91 91
             } catch (MongoCursorException $e) {
92 92
                 return false;
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 
109 109
         if ($document) {
110 110
             return [
111
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
112
-              self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
113
-              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->bin),
111
+                self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
112
+                self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
113
+                self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->bin),
114 114
             ];
115 115
         } else {
116 116
             return null;
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
              * @todo make an url builder
166 166
              */
167 167
             $this->instance = $this->instance ?: (new MongodbClient('mongodb://' .
168
-              ($username ?: '') .
169
-              ($password ? ":{$password}" : '') .
170
-              ($username ? '@' : '') . "{$host}" .
171
-              ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]))->phpFastCache;
168
+                ($username ?: '') .
169
+                ($password ? ":{$password}" : '') .
170
+                ($username ? '@' : '') . "{$host}" .
171
+                ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]))->phpFastCache;
172 172
             // $this->instance->Cache->createIndex([self::DRIVER_TIME_WRAPPER_INDEX => 1], ['expireAfterSeconds' => 0]);
173 173
         }
174 174
     }
@@ -209,25 +209,25 @@  discard block
 block discarded – undo
209 209
     public function getStats()
210 210
     {
211 211
         $serverStatus = $this->getCollection()->db->command([
212
-          'serverStatus' => 1,
213
-          'recordStats' => 0,
214
-          'repl' => 0,
215
-          'metrics' => 0,
212
+            'serverStatus' => 1,
213
+            'recordStats' => 0,
214
+            'repl' => 0,
215
+            'metrics' => 0,
216 216
         ]);
217 217
 
218 218
         $collStats = $this->getCollection()->db->command([
219
-          'collStats' => 'Cache',
220
-          'verbose' => true,
219
+            'collStats' => 'Cache',
220
+            'verbose' => true,
221 221
         ]);
222 222
 
223 223
         $stats = (new driverStatistic())
224
-          ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1) . "\n For more information see RawData.")
225
-          ->setSize((int) $collStats[ 'size' ])
226
-          ->setData(implode(', ', array_keys($this->itemInstances)))
227
-          ->setRawData([
224
+            ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1) . "\n For more information see RawData.")
225
+            ->setSize((int) $collStats[ 'size' ])
226
+            ->setData(implode(', ', array_keys($this->itemInstances)))
227
+            ->setRawData([
228 228
             'serverStatus' => $serverStatus,
229 229
             'collStats' => $collStats,
230
-          ]);
230
+            ]);
231 231
 
232 232
         return $stats;
233 233
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Predis/Driver.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -127,14 +127,14 @@  discard block
 block discarded – undo
127 127
     public function driverConnect()
128 128
     {
129 129
         $server = isset($this->config[ 'redis' ]) ? $this->config[ 'redis' ] : [
130
-          'host' => '127.0.0.1',
131
-          'port' => '6379',
132
-          'password' => '',
133
-          'database' => '',
130
+            'host' => '127.0.0.1',
131
+            'port' => '6379',
132
+            'password' => '',
133
+            'database' => '',
134 134
         ];
135 135
 
136 136
         $config = [
137
-          'host' => $server[ 'host' ],
137
+            'host' => $server[ 'host' ],
138 138
         ];
139 139
 
140 140
         $port = isset($server[ 'port' ]) ? $server[ 'port' ] : '';
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
     public function getStats()
197 197
     {
198 198
         return (new driverStatistic())
199
-          ->setRawData($this->instance->info())
200
-          ->setSize(0)
201
-          ->setInfo('');
199
+            ->setRawData($this->instance->info())
200
+            ->setSize(0)
201
+            ->setInfo('');
202 202
     }
203 203
 }
204 204
\ No newline at end of file
Please login to merge, or discard this patch.