Completed
Push — master ( 8d38f7...0c3e6a )
by Tobias
02:45
created
tests/StreamTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->assertFalse($stream->isWritable());
114 114
         $this->assertFalse($stream->isSeekable());
115 115
 
116
-        $throws = function (callable $fn) use ($stream) {
116
+        $throws = function(callable $fn) use ($stream) {
117 117
             try {
118 118
                 $fn($stream);
119 119
                 $this->fail();
@@ -121,25 +121,25 @@  discard block
 block discarded – undo
121 121
             }
122 122
         };
123 123
 
124
-        $throws(function ($stream) {
124
+        $throws(function($stream) {
125 125
             $stream->read(10);
126 126
         });
127
-        $throws(function ($stream) {
127
+        $throws(function($stream) {
128 128
             $stream->write('bar');
129 129
         });
130
-        $throws(function ($stream) {
130
+        $throws(function($stream) {
131 131
             $stream->seek(10);
132 132
         });
133
-        $throws(function ($stream) {
133
+        $throws(function($stream) {
134 134
             $stream->tell();
135 135
         });
136
-        $throws(function ($stream) {
136
+        $throws(function($stream) {
137 137
             $stream->eof();
138 138
         });
139
-        $throws(function ($stream) {
139
+        $throws(function($stream) {
140 140
             $stream->getSize();
141 141
         });
142
-        $throws(function ($stream) {
142
+        $throws(function($stream) {
143 143
             $stream->getContents();
144 144
         });
145 145
         $this->assertSame('', (string) $stream);
Please login to merge, or discard this patch.
tests/UriTest.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -212,61 +212,61 @@
 block discarded – undo
212 212
     public function getResolveTestCases()
213 213
     {
214 214
         return [
215
-            [self::RFC3986_BASE, 'g:h',           'g:h'],
216
-            [self::RFC3986_BASE, 'g',             'http://a/b/c/g'],
217
-            [self::RFC3986_BASE, './g',           'http://a/b/c/g'],
218
-            [self::RFC3986_BASE, 'g/',            'http://a/b/c/g/'],
219
-            [self::RFC3986_BASE, '/g',            'http://a/g'],
220
-            [self::RFC3986_BASE, '//g',           'http://g'],
221
-            [self::RFC3986_BASE, '?y',            'http://a/b/c/d;p?y'],
222
-            [self::RFC3986_BASE, 'g?y',           'http://a/b/c/g?y'],
223
-            [self::RFC3986_BASE, '#s',            'http://a/b/c/d;p?q#s'],
224
-            [self::RFC3986_BASE, 'g#s',           'http://a/b/c/g#s'],
225
-            [self::RFC3986_BASE, 'g?y#s',         'http://a/b/c/g?y#s'],
226
-            [self::RFC3986_BASE, ';x',            'http://a/b/c/;x'],
227
-            [self::RFC3986_BASE, 'g;x',           'http://a/b/c/g;x'],
228
-            [self::RFC3986_BASE, 'g;x?y#s',       'http://a/b/c/g;x?y#s'],
229
-            [self::RFC3986_BASE, '',              self::RFC3986_BASE],
230
-            [self::RFC3986_BASE, '.',             'http://a/b/c/'],
231
-            [self::RFC3986_BASE, './',            'http://a/b/c/'],
232
-            [self::RFC3986_BASE, '..',            'http://a/b/'],
233
-            [self::RFC3986_BASE, '../',           'http://a/b/'],
234
-            [self::RFC3986_BASE, '../g',          'http://a/b/g'],
235
-            [self::RFC3986_BASE, '../..',         'http://a/'],
236
-            [self::RFC3986_BASE, '../../',        'http://a/'],
237
-            [self::RFC3986_BASE, '../../g',       'http://a/g'],
238
-            [self::RFC3986_BASE, '../../../g',    'http://a/g'],
215
+            [self::RFC3986_BASE, 'g:h', 'g:h'],
216
+            [self::RFC3986_BASE, 'g', 'http://a/b/c/g'],
217
+            [self::RFC3986_BASE, './g', 'http://a/b/c/g'],
218
+            [self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'],
219
+            [self::RFC3986_BASE, '/g', 'http://a/g'],
220
+            [self::RFC3986_BASE, '//g', 'http://g'],
221
+            [self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'],
222
+            [self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'],
223
+            [self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'],
224
+            [self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'],
225
+            [self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'],
226
+            [self::RFC3986_BASE, ';x', 'http://a/b/c/;x'],
227
+            [self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'],
228
+            [self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'],
229
+            [self::RFC3986_BASE, '', self::RFC3986_BASE],
230
+            [self::RFC3986_BASE, '.', 'http://a/b/c/'],
231
+            [self::RFC3986_BASE, './', 'http://a/b/c/'],
232
+            [self::RFC3986_BASE, '..', 'http://a/b/'],
233
+            [self::RFC3986_BASE, '../', 'http://a/b/'],
234
+            [self::RFC3986_BASE, '../g', 'http://a/b/g'],
235
+            [self::RFC3986_BASE, '../..', 'http://a/'],
236
+            [self::RFC3986_BASE, '../../', 'http://a/'],
237
+            [self::RFC3986_BASE, '../../g', 'http://a/g'],
238
+            [self::RFC3986_BASE, '../../../g', 'http://a/g'],
239 239
             [self::RFC3986_BASE, '../../../../g', 'http://a/g'],
240
-            [self::RFC3986_BASE, '/./g',          'http://a/g'],
241
-            [self::RFC3986_BASE, '/../g',         'http://a/g'],
242
-            [self::RFC3986_BASE, 'g.',            'http://a/b/c/g.'],
243
-            [self::RFC3986_BASE, '.g',            'http://a/b/c/.g'],
244
-            [self::RFC3986_BASE, 'g..',           'http://a/b/c/g..'],
245
-            [self::RFC3986_BASE, '..g',           'http://a/b/c/..g'],
246
-            [self::RFC3986_BASE, './../g',        'http://a/b/g'],
247
-            [self::RFC3986_BASE, 'foo////g',      'http://a/b/c/foo////g'],
248
-            [self::RFC3986_BASE, './g/.',         'http://a/b/c/g/'],
249
-            [self::RFC3986_BASE, 'g/./h',         'http://a/b/c/g/h'],
250
-            [self::RFC3986_BASE, 'g/../h',        'http://a/b/c/h'],
251
-            [self::RFC3986_BASE, 'g;x=1/./y',     'http://a/b/c/g;x=1/y'],
252
-            [self::RFC3986_BASE, 'g;x=1/../y',    'http://a/b/c/y'],
240
+            [self::RFC3986_BASE, '/./g', 'http://a/g'],
241
+            [self::RFC3986_BASE, '/../g', 'http://a/g'],
242
+            [self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'],
243
+            [self::RFC3986_BASE, '.g', 'http://a/b/c/.g'],
244
+            [self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'],
245
+            [self::RFC3986_BASE, '..g', 'http://a/b/c/..g'],
246
+            [self::RFC3986_BASE, './../g', 'http://a/b/g'],
247
+            [self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'],
248
+            [self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'],
249
+            [self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'],
250
+            [self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'],
251
+            [self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'],
252
+            [self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'],
253 253
             // dot-segments in the query or fragment
254
-            [self::RFC3986_BASE, 'g?y/./x',       'http://a/b/c/g?y/./x'],
255
-            [self::RFC3986_BASE, 'g?y/../x',      'http://a/b/c/g?y/../x'],
256
-            [self::RFC3986_BASE, 'g#s/./x',       'http://a/b/c/g#s/./x'],
257
-            [self::RFC3986_BASE, 'g#s/../x',      'http://a/b/c/g#s/../x'],
258
-            [self::RFC3986_BASE, 'g#s/../x',      'http://a/b/c/g#s/../x'],
259
-            [self::RFC3986_BASE, '?y#s',          'http://a/b/c/d;p?y#s'],
260
-            ['http://a/b/c/d;p?q#s', '?y',        'http://a/b/c/d;p?y'],
261
-            ['http://u@a/b/c/d;p?q', '.',         'http://u@a/b/c/'],
262
-            ['http://u:p@a/b/c/d;p?q', '.',       'http://u:p@a/b/c/'],
263
-            ['http://a/b/c/d/', 'e',              'http://a/b/c/d/e'],
264
-            ['urn:no-slash', 'e',                 'urn:e'],
254
+            [self::RFC3986_BASE, 'g?y/./x', 'http://a/b/c/g?y/./x'],
255
+            [self::RFC3986_BASE, 'g?y/../x', 'http://a/b/c/g?y/../x'],
256
+            [self::RFC3986_BASE, 'g#s/./x', 'http://a/b/c/g#s/./x'],
257
+            [self::RFC3986_BASE, 'g#s/../x', 'http://a/b/c/g#s/../x'],
258
+            [self::RFC3986_BASE, 'g#s/../x', 'http://a/b/c/g#s/../x'],
259
+            [self::RFC3986_BASE, '?y#s', 'http://a/b/c/d;p?y#s'],
260
+            ['http://a/b/c/d;p?q#s', '?y', 'http://a/b/c/d;p?y'],
261
+            ['http://u@a/b/c/d;p?q', '.', 'http://u@a/b/c/'],
262
+            ['http://u:p@a/b/c/d;p?q', '.', 'http://u:p@a/b/c/'],
263
+            ['http://a/b/c/d/', 'e', 'http://a/b/c/d/e'],
264
+            ['urn:no-slash', 'e', 'urn:e'],
265 265
             // falsey relative parts
266
-            [self::RFC3986_BASE, '//0',           'http://0'],
267
-            [self::RFC3986_BASE, '0',             'http://a/b/c/0'],
268
-            [self::RFC3986_BASE, '?0',            'http://a/b/c/d;p?0'],
269
-            [self::RFC3986_BASE, '#0',            'http://a/b/c/d;p?q#0'],
266
+            [self::RFC3986_BASE, '//0', 'http://0'],
267
+            [self::RFC3986_BASE, '0', 'http://a/b/c/0'],
268
+            [self::RFC3986_BASE, '?0', 'http://a/b/c/d;p?0'],
269
+            [self::RFC3986_BASE, '#0', 'http://a/b/c/d;p?q#0'],
270 270
         ];
271 271
     }
272 272
 
Please login to merge, or discard this patch.
src/RequestTrait.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -40,6 +40,9 @@
 block discarded – undo
40 40
         return $target;
41 41
     }
42 42
 
43
+    /**
44
+     * @param string $requestTarget
45
+     */
43 46
     public function withRequestTarget($requestTarget): self
44 47
     {
45 48
         if (\preg_match('#\s#', $requestTarget)) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $target = '/';
35 35
         }
36 36
         if ('' !== $this->uri->getQuery()) {
37
-            $target .= '?' . $this->uri->getQuery();
37
+            $target .= '?'.$this->uri->getQuery();
38 38
         }
39 39
 
40 40
         return $target;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         }
98 98
 
99 99
         if (null !== ($port = $this->uri->getPort())) {
100
-            $host .= ':' . $port;
100
+            $host .= ':'.$port;
101 101
         }
102 102
 
103 103
         if (isset($this->headerNames['host'])) {
Please login to merge, or discard this patch.
src/UploadedFile.php 1 patch
Doc Comments   +14 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,6 +85,9 @@  discard block
 block discarded – undo
85 85
         }
86 86
     }
87 87
 
88
+    /**
89
+     * @param integer $error
90
+     */
88 91
     private function setError($error): void
89 92
     {
90 93
         if (false === \is_int($error)) {
@@ -98,6 +101,9 @@  discard block
 block discarded – undo
98 101
         $this->error = $error;
99 102
     }
100 103
 
104
+    /**
105
+     * @param integer $size
106
+     */
101 107
     private function setSize($size): void
102 108
     {
103 109
         if (false === \is_int($size)) {
@@ -107,6 +113,9 @@  discard block
 block discarded – undo
107 113
         $this->size = $size;
108 114
     }
109 115
 
116
+    /**
117
+     * @param string|null $clientFilename
118
+     */
110 119
     private function setClientFilename($clientFilename): void
111 120
     {
112 121
         if (null !== $clientFilename && !\is_string($clientFilename)) {
@@ -116,6 +125,9 @@  discard block
 block discarded – undo
116 125
         $this->clientFilename = $clientFilename;
117 126
     }
118 127
 
128
+    /**
129
+     * @param string|null $clientMediaType
130
+     */
119 131
     private function setClientMediaType($clientMediaType): void
120 132
     {
121 133
         if (null !== $clientMediaType && !\is_string($clientMediaType)) {
@@ -210,8 +222,8 @@  discard block
 block discarded – undo
210 222
      *
211 223
      * @author Michael Dowling and contributors to guzzlehttp/psr7
212 224
      *
213
-     * @param StreamInterface $source Stream to read from
214
-     * @param StreamInterface $dest Stream to write to
225
+     * @param \Psr\Http\Message\StreamInterface $source Stream to read from
226
+     * @param \Psr\Http\Message\StreamInterface $dest Stream to write to
215 227
      * @param int $maxLen Maximum number of bytes to read. Pass -1
216 228
      *                    to read the entire stream
217 229
      *
Please login to merge, or discard this patch.
src/Uri.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 
74 74
         $authority = $this->host;
75 75
         if ('' !== $this->userInfo) {
76
-            $authority = $this->userInfo . '@' . $authority;
76
+            $authority = $this->userInfo.'@'.$authority;
77 77
         }
78 78
 
79 79
         if (null !== $this->port) {
80
-            $authority .= ':' . $this->port;
80
+            $authority .= ':'.$this->port;
81 81
         }
82 82
 
83 83
         return $authority;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     {
135 135
         $info = $user;
136 136
         if (null !== $password && '' !== $password) {
137
-            $info .= ':' . $password;
137
+            $info .= ':'.$password;
138 138
         }
139 139
 
140 140
         if ($this->userInfo === $info) {
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         $this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : '';
227 227
         $this->fragment = isset($parts['fragment']) ? $this->filterQueryAndFragment($parts['fragment']) : '';
228 228
         if (isset($parts['pass'])) {
229
-            $this->userInfo .= ':' . $parts['pass'];
229
+            $this->userInfo .= ':'.$parts['pass'];
230 230
         }
231 231
     }
232 232
 
@@ -237,24 +237,24 @@  discard block
 block discarded – undo
237 237
     {
238 238
         $uri = '';
239 239
         if ('' !== $scheme) {
240
-            $uri .= $scheme . ':';
240
+            $uri .= $scheme.':';
241 241
         }
242 242
 
243 243
         if ('' !== $authority) {
244
-            $uri .= '//' . $authority;
244
+            $uri .= '//'.$authority;
245 245
         }
246 246
 
247 247
         if ('' !== $path) {
248 248
             if ('/' !== $path[0]) {
249 249
                 if ('' !== $authority) {
250 250
                     // If the path is rootless and an authority is present, the path MUST be prefixed by "/"
251
-                    $path = '/' . $path;
251
+                    $path = '/'.$path;
252 252
                 }
253 253
             } elseif (isset($path[1]) && '/' === $path[1]) {
254 254
                 if ('' === $authority) {
255 255
                     // If the path is starting with more than one "/" and no authority is present, the
256 256
                     // starting slashes MUST be reduced to one.
257
-                    $path = '/' . \ltrim($path, '/');
257
+                    $path = '/'.\ltrim($path, '/');
258 258
                 }
259 259
             }
260 260
 
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
         }
263 263
 
264 264
         if ('' !== $query) {
265
-            $uri .= '?' . $query;
265
+            $uri .= '?'.$query;
266 266
         }
267 267
 
268 268
         if ('' !== $fragment) {
269
-            $uri .= '#' . $fragment;
269
+            $uri .= '#'.$fragment;
270 270
         }
271 271
 
272 272
         return $uri;
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             throw new \InvalidArgumentException('Path must be a string');
301 301
         }
302 302
 
303
-        return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $path);
303
+        return \preg_replace_callback('/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $path);
304 304
     }
305 305
 
306 306
     private function filterQueryAndFragment($str): string
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             throw new \InvalidArgumentException('Query and fragment must be a string');
310 310
         }
311 311
 
312
-        return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $str);
312
+        return \preg_replace_callback('/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $str);
313 313
     }
314 314
 
315 315
     private static function rawurlencodeMatchZero(array $match): string
Please login to merge, or discard this patch.
src/Factory/Psr17Factory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@
 block discarded – undo
33 33
         $resource = @\fopen($filename, $mode);
34 34
         if (false === $resource) {
35 35
             if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'])) {
36
-                throw new \InvalidArgumentException('The mode ' . $mode . ' is invalid.');
36
+                throw new \InvalidArgumentException('The mode '.$mode.' is invalid.');
37 37
             }
38 38
 
39
-            throw new \RuntimeException('The file ' . $filename . ' cannot be opened.');
39
+            throw new \RuntimeException('The file '.$filename.' cannot be opened.');
40 40
         }
41 41
 
42 42
         return Stream::create($resource);
Please login to merge, or discard this patch.
src/Stream.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@
 block discarded – undo
183 183
         }
184 184
 
185 185
         if (-1 === \fseek($this->stream, $offset, $whence)) {
186
-            throw new \RuntimeException('Unable to seek to stream position ' . $offset . ' with whence ' . \var_export($whence, true));
186
+            throw new \RuntimeException('Unable to seek to stream position '.$offset.' with whence '.\var_export($whence, true));
187 187
         }
188 188
     }
189 189
 
Please login to merge, or discard this patch.