Completed
Pull Request — master (#640)
by Tobias
02:02
created
src/Gaufrette/Adapter/Cache.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Gaufrette\Adapter;
4 4
 
5
-use Gaufrette\File;
6 5
 use Gaufrette\Adapter;
7 6
 use Gaufrette\Adapter\InMemory as InMemoryAdapter;
8 7
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 use Gaufrette\Adapter;
7 7
 use Gaufrette\Adapter\InMemory as InMemoryAdapter;
8 8
 
9
-@trigger_error('The ' . __NAMESPACE__ . '\Cache adapter is deprecated since version 0.4 and will be removed in 1.0.', E_USER_DEPRECATED);
9
+@trigger_error('The '.__NAMESPACE__.'\Cache adapter is deprecated since version 0.4 and will be removed in 1.0.', E_USER_DEPRECATED);
10 10
 
11 11
 /**
12 12
  * Cache adapter.
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/DoctrineDbal.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -152,6 +152,10 @@
 block discarded – undo
152 152
         return false;
153 153
     }
154 154
 
155
+    /**
156
+     * @param string $key
157
+     * @param string $column
158
+     */
155 159
     private function getColumnValue($key, $column)
156 160
     {
157 161
         $value = $this->connection->fetchColumn(
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@
 block discarded – undo
184 184
 
185 185
         return [
186 186
             'dirs' => [],
187
-            'keys' => array_map(function ($value) {
187
+            'keys' => array_map(function($value) {
188 188
                 return $value['_key'];
189 189
             },
190 190
                 $keys),
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Dropbox.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -162,6 +162,9 @@
 block discarded – undo
162 162
         }
163 163
     }
164 164
 
165
+    /**
166
+     * @param string $key
167
+     */
165 168
     private function getDropboxMetadata($key)
166 169
     {
167 170
         try {
Please login to merge, or discard this 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/Util/Path.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
             }
42 42
         }
43 43
 
44
-        return $prefix . implode('/', $tokens);
44
+        return $prefix.implode('/', $tokens);
45 45
     }
46 46
 
47 47
     /**
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Local.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@
 block discarded – undo
205 205
     {
206 206
         $this->ensureDirectoryExists($this->directory, $this->create);
207 207
 
208
-        return $this->normalizePath($this->directory . '/' . $key);
208
+        return $this->normalizePath($this->directory.'/'.$key);
209 209
     }
210 210
 
211 211
     /**
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Flysystem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
      */
59 59
     public function keys()
60 60
     {
61
-        return array_map(function ($content) {
61
+        return array_map(function($content) {
62 62
             return $content['path'];
63 63
         }, $this->adapter->listContents());
64 64
     }
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Apc.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
      * @param string $key    - by default ''
139 139
      * @param int    $format - by default APC_ITER_NONE
140 140
      *
141
-     * @return \APCIterator
141
+     * @return \Traversable
142 142
      */
143 143
     protected function getCachedKeysIterator($key = '', $format = APC_ITER_NONE)
144 144
     {
Please login to merge, or discard this 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/MogileFS.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
     /**
251 251
      * Makes request to MogileFS tracker.
252 252
      *
253
-     * @param cmd Command
253
+     * @param cmd string
254 254
      * @param args Array of arguments
255 255
      *
256 256
      * @return mixed Array on success, false on failure
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     /**
303 303
      * Get file location at server from MogileFS tracker.
304 304
      *
305
-     * @param key File key
305
+     * @param key string key
306 306
      *
307 307
      * @return mixed Array on success, false on failure
308 308
      */
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      * Sends file to MogileFS tracker.
319 319
      *
320 320
      * @param path Save path at server
321
-     * @param data Data to save
321
+     * @param data string to save
322 322
      *
323 323
      * @return bool
324 324
      */
Please login to merge, or discard this 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/Zip.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
      * Returns the stat of a file in the zip archive
136 136
      *  (name, index, crc, mtime, compression size, compression method, filesize).
137 137
      *
138
-     * @param $key
138
+     * @param string $key
139 139
      *
140 140
      * @return array|bool
141 141
      */
Please login to merge, or discard this patch.
Switch Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -166,46 +166,46 @@
 block discarded – undo
166 166
 
167 167
         if (true !== ($resultCode = $this->zipArchive->open($this->zipFile, ZipArchive::CREATE))) {
168 168
             switch ($resultCode) {
169
-            case ZipArchive::ER_EXISTS:
170
-                $errMsg = 'File already exists.';
169
+                case ZipArchive::ER_EXISTS:
170
+                    $errMsg = 'File already exists.';
171 171
 
172
-                break;
173
-            case ZipArchive::ER_INCONS:
174
-                $errMsg = 'Zip archive inconsistent.';
172
+                    break;
173
+                case ZipArchive::ER_INCONS:
174
+                    $errMsg = 'Zip archive inconsistent.';
175 175
 
176
-                break;
177
-            case ZipArchive::ER_INVAL:
178
-                $errMsg = 'Invalid argument.';
176
+                    break;
177
+                case ZipArchive::ER_INVAL:
178
+                    $errMsg = 'Invalid argument.';
179 179
 
180
-                break;
181
-            case ZipArchive::ER_MEMORY:
182
-                $errMsg = 'Malloc failure.';
180
+                    break;
181
+                case ZipArchive::ER_MEMORY:
182
+                    $errMsg = 'Malloc failure.';
183 183
 
184
-                break;
185
-            case ZipArchive::ER_NOENT:
186
-                $errMsg = 'Invalid argument.';
184
+                    break;
185
+                case ZipArchive::ER_NOENT:
186
+                    $errMsg = 'Invalid argument.';
187 187
 
188
-                break;
189
-            case ZipArchive::ER_NOZIP:
190
-                $errMsg = 'Not a zip archive.';
188
+                    break;
189
+                case ZipArchive::ER_NOZIP:
190
+                    $errMsg = 'Not a zip archive.';
191 191
 
192
-                break;
193
-            case ZipArchive::ER_OPEN:
194
-                $errMsg = 'Can\'t open file.';
192
+                    break;
193
+                case ZipArchive::ER_OPEN:
194
+                    $errMsg = 'Can\'t open file.';
195 195
 
196
-                break;
197
-            case ZipArchive::ER_READ:
198
-                $errMsg = 'Read error.';
196
+                    break;
197
+                case ZipArchive::ER_READ:
198
+                    $errMsg = 'Read error.';
199 199
 
200
-                break;
201
-            case ZipArchive::ER_SEEK:
202
-                $errMsg = 'Seek error.';
200
+                    break;
201
+                case ZipArchive::ER_SEEK:
202
+                    $errMsg = 'Seek error.';
203 203
 
204
-                break;
205
-            default:
206
-                $errMsg = 'Unknown error.';
204
+                    break;
205
+                default:
206
+                    $errMsg = 'Unknown error.';
207 207
 
208
-                break;
208
+                    break;
209 209
             }
210 210
 
211 211
             throw new \RuntimeException(sprintf('%s', $errMsg));
Please login to merge, or discard this patch.