Completed
Pull Request — master (#617)
by Nicolas
03:29
created
src/Gaufrette/Adapter/Apc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use Gaufrette\Adapter;
6 6
 use Gaufrette\Util;
7 7
 
8
-@trigger_error('The ' . __NAMESPACE__ . '\Apc adapter is deprecated since version 0.4 and will be removed in 1.0.', E_USER_DEPRECATED);
8
+@trigger_error('The '.__NAMESPACE__.'\Apc adapter is deprecated since version 0.4 and will be removed in 1.0.', E_USER_DEPRECATED);
9 9
 
10 10
 /**
11 11
  * Apc adapter, a non-persistent adapter for when this sort of thing is appropriate.
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function computePath($key)
137 137
     {
138
-        return $this->prefix . $key;
138
+        return $this->prefix.$key;
139 139
     }
140 140
 
141 141
     /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     protected function getCachedKeysIterator($key = '', $format = APC_ITER_NONE)
148 148
     {
149
-        $pattern = sprintf('/^%s/', preg_quote($this->prefix . $key, '/'));
149
+        $pattern = sprintf('/^%s/', preg_quote($this->prefix.$key, '/'));
150 150
 
151 151
         return new \APCIterator('user', $pattern, $format);
152 152
     }
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Ftp.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
         $this->ensureDirectoryExists($this->directory, $this->create);
126 126
 
127 127
         $file = $this->computePath($key);
128
-        $lines = ftp_rawlist($this->getConnection(), '-al ' . \Gaufrette\Util\Path::dirname($file));
128
+        $lines = ftp_rawlist($this->getConnection(), '-al '.\Gaufrette\Util\Path::dirname($file));
129 129
 
130 130
         if (false === $lines) {
131 131
             return false;
132 132
         }
133 133
 
134
-        $pattern = '{(?<!->) ' . preg_quote(basename($file)) . '( -> |$)}m';
134
+        $pattern = '{(?<!->) '.preg_quote(basename($file)).'( -> |$)}m';
135 135
         foreach ($lines as $line) {
136 136
             if (preg_match($pattern, $line)) {
137 137
                 return true;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory);
239 239
 
240 240
         $items = $this->parseRawlist(
241
-            ftp_rawlist($this->getConnection(), '-al ' . $this->directory . $directory) ?: []
241
+            ftp_rawlist($this->getConnection(), '-al '.$this->directory.$directory) ?: []
242 242
         );
243 243
 
244 244
         $fileData = $dirs = [];
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
             $item = [
251 251
                 'name' => $itemData['name'],
252
-                'path' => trim(($directory ? $directory . '/' : '') . $itemData['name'], '/'),
252
+                'path' => trim(($directory ? $directory.'/' : '').$itemData['name'], '/'),
253 253
                 'time' => $itemData['time'],
254 254
                 'size' => $itemData['size'],
255 255
             ];
@@ -381,13 +381,13 @@  discard block
 block discarded – undo
381 381
     {
382 382
         $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory);
383 383
 
384
-        $lines = ftp_rawlist($this->getConnection(), '-alR ' . $this->directory . $directory);
384
+        $lines = ftp_rawlist($this->getConnection(), '-alR '.$this->directory.$directory);
385 385
 
386 386
         if (false === $lines) {
387 387
             return ['keys' => [], 'dirs' => []];
388 388
         }
389 389
 
390
-        $regexDir = '/' . preg_quote($this->directory . $directory, '/') . '\/?(.+):$/u';
390
+        $regexDir = '/'.preg_quote($this->directory.$directory, '/').'\/?(.+):$/u';
391 391
         $regexItem = '/^(?:([d\-\d])\S+)\s+\S+(?:(?:\s+\S+){5})?\s+(\S+)\s+(.+?)$/';
392 392
 
393 393
         $prevLine = null;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                     continue;
412 412
                 }
413 413
 
414
-                $path = ltrim($directory . '/' . $name, '/');
414
+                $path = ltrim($directory.'/'.$name, '/');
415 415
 
416 416
                 if ('d' === $tokens[1] || '<dir>' === $tokens[2]) {
417 417
                     $keys['dirs'][] = $path;
@@ -451,13 +451,13 @@  discard block
 block discarded – undo
451 451
             $infos = preg_split("/[\s]+/", $line, 9);
452 452
 
453 453
             if ($this->isLinuxListing($infos)) {
454
-                $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7] . ' 00:00') : (date('Y') . ' ' . $infos[7]);
454
+                $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7].' 00:00') : (date('Y').' '.$infos[7]);
455 455
                 if ('total' !== $infos[0]) {
456 456
                     $parsed[] = [
457 457
                         'perms' => $infos[0],
458 458
                         'num' => $infos[1],
459 459
                         'size' => $infos[4],
460
-                        'time' => strtotime($infos[5] . ' ' . $infos[6] . '. ' . $infos[7]),
460
+                        'time' => strtotime($infos[5].' '.$infos[6].'. '.$infos[7]),
461 461
                         'name' => $infos[8],
462 462
                     ];
463 463
                 }
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                     'perms' => $isDir ? 'd' : '-',
468 468
                     'num' => '',
469 469
                     'size' => $isDir ? '' : $infos[2],
470
-                    'time' => strtotime($infos[0] . ' ' . $infos[1]),
470
+                    'time' => strtotime($infos[0].' '.$infos[1]),
471 471
                     'name' => $infos[3],
472 472
                 ];
473 473
             }
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
      */
484 484
     private function computePath($key)
485 485
     {
486
-        return rtrim($this->directory, '/') . '/' . $key;
486
+        return rtrim($this->directory, '/').'/'.$key;
487 487
     }
488 488
 
489 489
     /**
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/AmazonS3.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use AmazonS3 as AmazonClient;
6 6
 use Gaufrette\Adapter;
7 7
 
8
-@trigger_error('The ' . __NAMESPACE__ . '\AmazonS3 adapter is deprecated since version 0.4 and will be removed in 1.0. Use the AwsS3 adapter instead.', E_USER_DEPRECATED);
8
+@trigger_error('The '.__NAMESPACE__.'\AmazonS3 adapter is deprecated since version 0.4 and will be removed in 1.0. Use the AwsS3 adapter instead.', E_USER_DEPRECATED);
9 9
 
10 10
 /**
11 11
  * Amazon S3 adapter using the AWS SDK for PHP v1.x.
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
         $this->ensureBucketExists();
126 126
 
127 127
         $response = $this->service->copy_object(
128
-            [ // source
128
+            [// source
129 129
                 'bucket' => $this->bucket,
130 130
                 'filename' => $this->computePath($sourceKey),
131 131
             ],
132
-            [ // target
132
+            [// target
133 133
                 'bucket' => $this->bucket,
134 134
                 'filename' => $this->computePath($targetKey),
135 135
             ],
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
      */
237 237
     public function isDirectory($key)
238 238
     {
239
-        if ($this->exists($key . '/')) {
239
+        if ($this->exists($key.'/')) {
240 240
             return true;
241 241
         }
242 242
 
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/MogileFS.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use Gaufrette\Adapter;
6 6
 use Gaufrette\Util;
7 7
 
8
-@trigger_error('The ' . __NAMESPACE__ . '\MogileFS adapter is deprecated since version 0.4 and will be removed in 1.0.', E_USER_DEPRECATED);
8
+@trigger_error('The '.__NAMESPACE__.'\MogileFS adapter is deprecated since version 0.4 and will be removed in 1.0.', E_USER_DEPRECATED);
9 9
 
10 10
 /**
11 11
  * Adapter for the MogileFS filesystem.
@@ -195,12 +195,12 @@  discard block
 block discarded – undo
195 195
         $domains = [];
196 196
 
197 197
         for ($i = 1; $i <= $res['domains']; ++$i) {
198
-            $dom = 'domain' . $i;
198
+            $dom = 'domain'.$i;
199 199
             $classes = [];
200 200
 
201 201
             // Associate classes to current domain (class name => mindevcount)
202
-            for ($j = 1; $j <= $res[$dom . 'classes']; ++$j) {
203
-                $classes[$res[$dom . 'class' . $j . 'name']] = $res[$dom . 'class' . $j . 'mindevcount'];
202
+            for ($j = 1; $j <= $res[$dom.'classes']; ++$j) {
203
+                $classes[$res[$dom.'class'.$j.'name']] = $res[$dom.'class'.$j.'mindevcount'];
204 204
             }
205 205
 
206 206
             $domains[] = ['name' => $res[$dom], 'classes' => $classes];
@@ -347,11 +347,11 @@  discard block
 block discarded – undo
347 347
         stream_set_blocking($fp, true);
348 348
         stream_set_timeout($fp, 30, 200000);
349 349
 
350
-        $out = 'PUT ' . $url['path'] . ' HTTP/1.1' . $b;
351
-        $out .= 'Host: ' . $url['host'] . $b;
352
-        $out .= 'Content-Length: ' . Util\Size::fromContent($data) . $b . $b;
350
+        $out = 'PUT '.$url['path'].' HTTP/1.1'.$b;
351
+        $out .= 'Host: '.$url['host'].$b;
352
+        $out .= 'Content-Length: '.Util\Size::fromContent($data).$b.$b;
353 353
         $out .= $data;
354
-        $out .= $b . $b;
354
+        $out .= $b.$b;
355 355
         fwrite($fp, $out);
356 356
         fflush($fp);
357 357
 
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/GoogleCloudStorage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@
 block discarded – undo
270 270
      */
271 271
     public function isDirectory($key)
272 272
     {
273
-        if ($this->exists($key . '/')) {
273
+        if ($this->exists($key.'/')) {
274 274
             return true;
275 275
         }
276 276
 
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Dropbox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 use Dropbox_API as DropboxApi;
9 9
 use Dropbox_Exception_NotFound as DropboxNotFoundException;
10 10
 
11
-@trigger_error('The ' . __NAMESPACE__ . '\Dropbox adapter is deprecated since version 0.4 and will be removed in 1.0. You can move to our Flysystem adapter and use their Dropbox adapter if needed.', E_USER_DEPRECATED);
11
+@trigger_error('The '.__NAMESPACE__.'\Dropbox adapter is deprecated since version 0.4 and will be removed in 1.0. You can move to our Flysystem adapter and use their Dropbox adapter if needed.', E_USER_DEPRECATED);
12 12
 
13 13
 /**
14 14
  * Dropbox adapter.
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Sftp.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use Gaufrette\Adapter;
6 6
 use Ssh\Sftp as SftpClient;
7 7
 
8
-@trigger_error('The ' . __NAMESPACE__ . '\Sftp adapter is deprecated since version 0.4 and will be removed in 1.0.', E_USER_DEPRECATED);
8
+@trigger_error('The '.__NAMESPACE__.'\Sftp adapter is deprecated since version 0.4 and will be removed in 1.0.', E_USER_DEPRECATED);
9 9
 
10 10
 /**
11 11
  * @deprecated The Sftp adapter is deprecated since version 0.4 and will be removed in 1.0.
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     protected function computePath($key)
179 179
     {
180
-        return $this->directory . '/' . ltrim($key, '/');
180
+        return $this->directory.'/'.ltrim($key, '/');
181 181
     }
182 182
 
183 183
     /**
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/LazyOpenCloud.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use Gaufrette\Adapter\OpenStackCloudFiles\ObjectStoreFactoryInterface;
6 6
 
7
-@trigger_error('The ' . __NAMESPACE__ . '\LazyOpenCloud adapter is deprecated since version 0.4 and will be removed in 1.0. Use the OpenCloud adapter instead.', E_USER_DEPRECATED);
7
+@trigger_error('The '.__NAMESPACE__.'\LazyOpenCloud adapter is deprecated since version 0.4 and will be removed in 1.0. Use the OpenCloud adapter instead.', E_USER_DEPRECATED);
8 8
 
9 9
 /**
10 10
  * LazyOpenCloud.
Please login to merge, or discard this patch.
src/Gaufrette/StreamWrapper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -257,11 +257,11 @@
 block discarded – undo
257 257
         $key = substr($parts['path'], 1);
258 258
 
259 259
         if (null !== $parts['query']) {
260
-            $key .= '?' . $parts['query'];
260
+            $key .= '?'.$parts['query'];
261 261
         }
262 262
 
263 263
         if (null !== $parts['fragment']) {
264
-            $key .= '#' . $parts['fragment'];
264
+            $key .= '#'.$parts['fragment'];
265 265
         }
266 266
 
267 267
         if (empty($domain) || empty($key)) {
Please login to merge, or discard this patch.