Completed
Push — master ( f4a4ac...da994a )
by Tobias
02:15
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 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -39,6 +39,9 @@
 block discarded – undo
39 39
         return $target;
40 40
     }
41 41
 
42
+    /**
43
+     * @param string $requestTarget
44
+     */
42 45
     public function withRequestTarget($requestTarget): self
43 46
     {
44 47
         if (preg_match('#\s#', $requestTarget)) {
Please login to merge, or discard this patch.
src/UploadedFile.php 1 patch
Doc Comments   +15 added lines patch added patch discarded remove patch
@@ -87,6 +87,9 @@  discard block
 block discarded – undo
87 87
         }
88 88
     }
89 89
 
90
+    /**
91
+     * @param integer $error
92
+     */
90 93
     private function setError($error): void
91 94
     {
92 95
         if (false === is_int($error)) {
@@ -100,6 +103,9 @@  discard block
 block discarded – undo
100 103
         $this->error = $error;
101 104
     }
102 105
 
106
+    /**
107
+     * @param integer $size
108
+     */
103 109
     private function setSize($size): void
104 110
     {
105 111
         if (false === is_int($size)) {
@@ -114,11 +120,17 @@  discard block
 block discarded – undo
114 120
         return in_array(gettype($param), ['string', 'NULL']);
115 121
     }
116 122
 
123
+    /**
124
+     * @param string $param
125
+     */
117 126
     private function isStringNotEmpty($param): bool
118 127
     {
119 128
         return is_string($param) && false === empty($param);
120 129
     }
121 130
 
131
+    /**
132
+     * @param string|null $clientFilename
133
+     */
122 134
     private function setClientFilename($clientFilename): void
123 135
     {
124 136
         if (false === $this->isStringOrNull($clientFilename)) {
@@ -128,6 +140,9 @@  discard block
 block discarded – undo
128 140
         $this->clientFilename = $clientFilename;
129 141
     }
130 142
 
143
+    /**
144
+     * @param string|null $clientMediaType
145
+     */
131 146
     private function setClientMediaType($clientMediaType): void
132 147
     {
133 148
         if (false === $this->isStringOrNull($clientMediaType)) {
Please login to merge, or discard this patch.
src/MessageTrait.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@
 block discarded – undo
192 192
             }
193 193
         }
194 194
 
195
-        return array_map(function (string $value) {
195
+        return array_map(function(string $value) {
196 196
             return trim($value, " \t");
197 197
         }, $values);
198 198
     }
Please login to merge, or discard this patch.
Doc Comments   +18 added lines patch added patch discarded remove patch
@@ -31,6 +31,9 @@  discard block
 block discarded – undo
31 31
         return $this->protocol;
32 32
     }
33 33
 
34
+    /**
35
+     * @param string $version
36
+     */
34 37
     public function withProtocolVersion($version): self
35 38
     {
36 39
         if ($this->protocol === $version) {
@@ -48,6 +51,9 @@  discard block
 block discarded – undo
48 51
         return $this->headers;
49 52
     }
50 53
 
54
+    /**
55
+     * @param string $header
56
+     */
51 57
     public function hasHeader($header): bool
52 58
     {
53 59
         return isset($this->headerNames[strtolower($header)]);
@@ -65,11 +71,17 @@  discard block
 block discarded – undo
65 71
         return $this->headers[$header];
66 72
     }
67 73
 
74
+    /**
75
+     * @param string $header
76
+     */
68 77
     public function getHeaderLine($header): string
69 78
     {
70 79
         return implode(', ', $this->getHeader($header));
71 80
     }
72 81
 
82
+    /**
83
+     * @param string $header
84
+     */
73 85
     public function withHeader($header, $value): self
74 86
     {
75 87
         $value = $this->validateAndTrimHeader($header, $value);
@@ -85,6 +97,9 @@  discard block
 block discarded – undo
85 97
         return $new;
86 98
     }
87 99
 
100
+    /**
101
+     * @param string $header
102
+     */
88 103
     public function withAddedHeader($header, $value): self
89 104
     {
90 105
         if (!is_string($header) || '' === $header) {
@@ -97,6 +112,9 @@  discard block
 block discarded – undo
97 112
         return $new;
98 113
     }
99 114
 
115
+    /**
116
+     * @param string $header
117
+     */
100 118
     public function withoutHeader($header): self
101 119
     {
102 120
         $normalized = strtolower($header);
Please login to merge, or discard this patch.