Completed
Push — final ( ab27cf...b90978 )
by Georges
02:36 queued 02:33
created
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/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/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/Leveldb/Driver.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -176,9 +176,9 @@
 block discarded – undo
176 176
     public function getStats()
177 177
     {
178 178
         return (new driverStatistic())
179
-          ->setData(implode(', ', array_keys($this->itemInstances)))
180
-          ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($this->getLeveldbFile()))
181
-          ->setSize(Directory::dirSize($this->getLeveldbFile()));
179
+            ->setData(implode(', ', array_keys($this->itemInstances)))
180
+            ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($this->getLeveldbFile()))
181
+            ->setSize(Directory::dirSize($this->getLeveldbFile()));
182 182
     }
183 183
 
184 184
     /**
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Files/Driver.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -254,9 +254,9 @@
 block discarded – undo
254 254
         }
255 255
 
256 256
         $stat->setData(implode(', ', array_keys($this->itemInstances)))
257
-          ->setRawData([])
258
-          ->setSize(Directory::dirSize($path))
259
-          ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path));
257
+            ->setRawData([])
258
+            ->setSize(Directory::dirSize($path))
259
+            ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path));
260 260
 
261 261
         return $stat;
262 262
     }
Please login to merge, or discard this patch.
src/phpFastCache/Util/Directory.php 1 patch
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.
src/phpFastCache/Drivers/Redis/Driver.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -159,9 +159,9 @@
 block discarded – undo
159 159
         $date = (new \DateTime())->setTimestamp(time() - $info[ 'uptime_in_seconds' ]);
160 160
 
161 161
         return (new driverStatistic())
162
-          ->setData(implode(', ', array_keys($this->itemInstances)))
163
-          ->setRawData($info)
164
-          ->setSize($info[ 'used_memory' ])
165
-          ->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)));
162
+            ->setData(implode(', ', array_keys($this->itemInstances)))
163
+            ->setRawData($info)
164
+            ->setSize($info[ 'used_memory' ])
165
+            ->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)));
166 166
     }
167 167
 }
168 168
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Mongodb/Driver.php 1 patch
Indentation   +26 added lines, -26 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;
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
     protected function driverRead(CacheItemInterface $item)
106 106
     {
107 107
         $document = $this->getCollection()
108
-          ->findOne(['_id' => $item->getKey()],
108
+            ->findOne(['_id' => $item->getKey()],
109 109
             [self::DRIVER_DATA_WRAPPER_INDEX, self::DRIVER_TIME_WRAPPER_INDEX, self::DRIVER_TAGS_WRAPPER_INDEX  /*'d', 'e'*/]);
110 110
 
111 111
         if ($document) {
112 112
             return [
113
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
114
-              self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
115
-              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->bin),
113
+                self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
114
+                self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
115
+                self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->bin),
116 116
             ];
117 117
         } else {
118 118
             return null;
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
              * @todo make an url builder
168 168
              */
169 169
             $this->instance = $this->instance ?: (new MongodbClient('mongodb://' .
170
-              ($username ?: '') .
171
-              ($password ? ":{$password}" : '') .
172
-              ($username ? '@' : '') . "{$host}" .
173
-              ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]))->phpFastCache;
170
+                ($username ?: '') .
171
+                ($password ? ":{$password}" : '') .
172
+                ($username ? '@' : '') . "{$host}" .
173
+                ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]))->phpFastCache;
174 174
             // $this->instance->Cache->createIndex([self::DRIVER_TIME_WRAPPER_INDEX => 1], ['expireAfterSeconds' => 0]);
175 175
         }
176 176
     }
@@ -196,25 +196,25 @@  discard block
 block discarded – undo
196 196
     public function getStats()
197 197
     {
198 198
         $serverStatus = $this->getCollection()->db->command([
199
-          'serverStatus' => 1,
200
-          'recordStats' => 0,
201
-          'repl' => 0,
202
-          'metrics' => 0,
199
+            'serverStatus' => 1,
200
+            'recordStats' => 0,
201
+            'repl' => 0,
202
+            'metrics' => 0,
203 203
         ]);
204 204
 
205 205
         $collStats = $this->getCollection()->db->command([
206
-          'collStats' => 'Cache',
207
-          'verbose' => true,
206
+            'collStats' => 'Cache',
207
+            'verbose' => true,
208 208
         ]);
209 209
 
210 210
         $stats = (new driverStatistic())
211
-          ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1) . "\n For more information see RawData.")
212
-          ->setSize((int) @$collStats[ 'size' ])
213
-          ->setData(implode(', ', array_keys($this->itemInstances)))
214
-          ->setRawData([
211
+            ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1) . "\n For more information see RawData.")
212
+            ->setSize((int) @$collStats[ 'size' ])
213
+            ->setData(implode(', ', array_keys($this->itemInstances)))
214
+            ->setRawData([
215 215
             'serverStatus' => $serverStatus,
216 216
             'collStats' => $collStats,
217
-          ]);
217
+            ]);
218 218
 
219 219
         return $stats;
220 220
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Apcu/Driver.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -136,9 +136,9 @@
 block discarded – undo
136 136
         $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]);
137 137
 
138 138
         return (new driverStatistic())
139
-          ->setData(implode(', ', array_keys($this->itemInstances)))
140
-          ->setInfo(sprintf("The APCU cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), $stats[ 'num_entries' ]))
141
-          ->setRawData($stats)
142
-          ->setSize($stats[ 'mem_size' ]);
139
+            ->setData(implode(', ', array_keys($this->itemInstances)))
140
+            ->setInfo(sprintf("The APCU cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), $stats[ 'num_entries' ]))
141
+            ->setRawData($stats)
142
+            ->setSize($stats[ 'mem_size' ]);
143 143
     }
144 144
 }
145 145
\ No newline at end of file
Please login to merge, or discard this patch.