15
15
use Psr \Http \Message \ServerRequestInterface ;
16
16
use Psr \Http \Message \StreamInterface ;
17
17
use Psr \Http \Message \UriInterface ;
18
- use ReflectionObject ;
19
18
20
19
/**
21
20
* TODO
@@ -92,8 +91,6 @@ public function __clone()
92
91
* @param array<string, bool> $options
93
92
*
94
93
* @throws \InvalidArgumentException
95
- *
96
- * @return Request
97
94
*/
98
95
public static function fromSfWebRequest (\sfWebRequest $ sfWebRequest , array $ options = []): self
99
96
{
@@ -118,9 +115,7 @@ public static function fromSfWebRequest(\sfWebRequest $sfWebRequest, array $opti
118
115
return $ new ;
119
116
}
120
117
121
- /**
122
- * @deprecated Avoid this at all costs! It only serves as a last resort!
123
- */
118
+ /** @deprecated Avoid this at all costs! It only serves as a last resort! */
124
119
public function getSfWebRequest (): \sfWebRequest
125
120
{
126
121
return $ this ->sfWebRequest ;
@@ -137,10 +132,10 @@ public function getProtocolVersion(): string
137
132
/**
138
133
* @param string $version
139
134
*
140
- * @throws \ReflectionException
141
- *
142
135
* @return static
143
136
*
137
+ * @throws \ReflectionException
138
+ *
144
139
* @deprecated Will modify sfWebRequest even though it has no intrinsic support for this
145
140
*/
146
141
public function withProtocolVersion ($ version ): self
@@ -154,9 +149,7 @@ public function withProtocolVersion($version): self
154
149
return $ new ;
155
150
}
156
151
157
- /**
158
- * @return string[][]
159
- */
152
+ /** @return string[][] */
160
153
public function getHeaders (): array
161
154
{
162
155
$ headers = [];
@@ -197,9 +190,9 @@ public function hasHeader($name): bool
197
190
/**
198
191
* @param string $name
199
192
*
200
- * @throws \InvalidArgumentException
201
- *
202
193
* @return string[]
194
+ *
195
+ * @throws \InvalidArgumentException
203
196
*/
204
197
public function getHeader ($ name ): array
205
198
{
@@ -225,11 +218,11 @@ public function getHeaderLine($name): string
225
218
/**
226
219
* @param string $name
227
220
*
221
+ * @return static
222
+ *
228
223
* @throws \InvalidArgumentException
229
224
* @throws \ReflectionException
230
225
*
231
- * @return static
232
- *
233
226
* @deprecated Will modify sfWebRequest even though it has no intrinsic support for this
234
227
*/
235
228
public function withoutHeader ($ name ): self
@@ -289,9 +282,7 @@ public function withRequestTarget($requestTarget): self
289
282
return $ new ;
290
283
}
291
284
292
- /**
293
- * {@inheritdoc}
294
- */
285
+ /** {@inheritdoc} */
295
286
public function getMethod (): string
296
287
{
297
288
$ method = $ this ->sfWebRequest ->getMethod ();
@@ -307,9 +298,9 @@ public function getMethod(): string
307
298
*
308
299
* @psalm-param mixed $method
309
300
*
310
- * @throws InvalidTypeException
311
- *
312
301
* @return static
302
+ *
303
+ * @throws InvalidTypeException
313
304
*/
314
305
public function withMethod ($ method ): self
315
306
{
@@ -329,12 +320,12 @@ public function getUri(): UriInterface
329
320
/**
330
321
* @param bool $preserveHost
331
322
*
323
+ * @return static
324
+ *
332
325
* @throws LogicException
333
326
* @throws \InvalidArgumentException
334
327
* @throws \ReflectionException
335
328
*
336
- * @return static
337
- *
338
329
* @deprecated Will not alter sfWebRequest! Will crash on Symfony compatibility mode if `$preserveHost === true`!
339
330
*/
340
331
public function withUri (UriInterface $ uri , $ preserveHost = false ): self
@@ -376,10 +367,10 @@ public function getCookieParams(): array
376
367
/**
377
368
* @param array<array-key, mixed>|string[] $cookies
378
369
*
379
- * @throws LogicException
380
- *
381
370
* @return static
382
371
*
372
+ * @throws LogicException
373
+ *
383
374
* @deprecated Will not alter sfWebRequest! Will crash on Symfony compatibility mode!
384
375
*/
385
376
public function withCookieParams (array $ cookies ): self
@@ -390,9 +381,7 @@ public function withCookieParams(array $cookies): self
390
381
return $ new ;
391
382
}
392
383
393
- /**
394
- * @return array<array-key, array<array-key, mixed>|mixed|string>
395
- */
384
+ /** @return array<array-key, array<array-key, mixed>|mixed|string> */
396
385
public function getQueryParams (): array
397
386
{
398
387
return $ this ->queryParams ?? $ this ->sfWebRequest ->getGetParameters ();
@@ -401,10 +390,10 @@ public function getQueryParams(): array
401
390
/**
402
391
* @param array<array-key, mixed> $query
403
392
*
404
- * @throws LogicException
405
- *
406
393
* @return static
407
394
*
395
+ * @throws LogicException
396
+ *
408
397
* @deprecated Will not alter sfWebRequest! Will crash on Symfony compatibility mode!
409
398
*/
410
399
public function withQueryParams (array $ query ): self
@@ -416,9 +405,9 @@ public function withQueryParams(array $query): self
416
405
}
417
406
418
407
/**
419
- * @throws \LogicException
420
- *
421
408
* @return array<array-key, mixed>
409
+ *
410
+ * @throws \LogicException
422
411
*/
423
412
public function getUploadedFiles (): array
424
413
{
@@ -443,9 +432,7 @@ public function withUploadedFiles(array $uploadedFiles): self
443
432
return $ new ;
444
433
}
445
434
446
- /**
447
- * @return null|array<array-key, mixed>|object
448
- */
435
+ /** @return null|array<array-key, mixed>|object */
449
436
public function getParsedBody ()
450
437
{
451
438
if (false === $ this ->parsedBody ) {
@@ -458,9 +445,9 @@ public function getParsedBody()
458
445
/**
459
446
* @param null|array<array-key, mixed>|object $data
460
447
*
461
- * @throws InvalidTypeException
462
- *
463
448
* @return static
449
+ *
450
+ * @throws InvalidTypeException
464
451
*/
465
452
public function withParsedBody ($ data ): self
466
453
{
@@ -474,9 +461,7 @@ public function withParsedBody($data): self
474
461
return $ new ;
475
462
}
476
463
477
- /**
478
- * @return mixed[]
479
- */
464
+ /** @return mixed[] */
480
465
public function getAttributes (): array
481
466
{
482
467
return $ this ->attributes ;
@@ -530,7 +515,7 @@ public function withoutAttribute($name): self
530
515
private function retroducePathInfoArray (array $ pathInfo ): void
531
516
{
532
517
if (null === $ this ->reflexPathInfoArray ) {
533
- $ reflexiveWebRequest = new ReflectionObject ($ this ->sfWebRequest );
518
+ $ reflexiveWebRequest = new \ ReflectionObject ($ this ->sfWebRequest );
534
519
$ this ->reflexPathInfoArray = $ reflexiveWebRequest ->getProperty ('pathInfoArray ' );
535
520
$ this ->reflexPathInfoArray ->setAccessible (true );
536
521
}
@@ -554,9 +539,7 @@ private function setHeader(string $name, $value): void
554
539
$ this ->retroducePathInfoArray ($ pathInfoArray );
555
540
}
556
541
557
- /**
558
- * get the array key resp. to pathInfoArray from the header field name
559
- */
542
+ /** get the array key resp. to pathInfoArray from the header field name */
560
543
private function getPathInfoKey (string $ name ): string
561
544
{
562
545
$ keyName = strtoupper (str_replace ('- ' , '_ ' , $ name ));
@@ -615,9 +598,9 @@ private function addUploadedFiles(array $files, array $keys): void
615
598
}
616
599
617
600
/**
618
- * @throws LogicException
619
- *
620
601
* @return static
602
+ *
603
+ * @throws LogicException
621
604
*/
622
605
private function getCloneOrDie (): self
623
606
{
@@ -628,9 +611,7 @@ private function getCloneOrDie(): self
628
611
return clone $ this ;
629
612
}
630
613
631
- /**
632
- * @return static
633
- */
614
+ /** @return static */
634
615
private function getThisOrClone (): self
635
616
{
636
617
if ($ this ->isImmutable ) {
0 commit comments