Skip to content

Commit 3d44e31

Browse files
committed
Add missing types
Signed-off-by: ADmad <[email protected]>
1 parent 746db20 commit 3d44e31

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

src/MessageTrait.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,14 @@ trait MessageTrait
3030
/**
3131
* List of all registered headers, as key => array of values.
3232
*
33-
* @var array
34-
* @psalm-var array<non-empty-string, list<string>>
33+
* @var array<non-empty-string, list<string>>
3534
*/
3635
protected $headers = [];
3736

3837
/**
3938
* Map of normalized header name to original name used to register header.
4039
*
41-
* @var array
42-
* @psalm-var array<non-empty-string, non-empty-string>
40+
* @var array<non-empty-string, non-empty-string>
4341
*/
4442
protected $headerNames = [];
4543

src/Request/ArraySerializer.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ public static function fromArray(array $serializedRequest): Request
7070
}
7171

7272
/**
73-
* @return mixed
7473
* @throws Exception\DeserializationException
7574
*/
76-
private static function getValueFromKey(array $data, string $key, ?string $message = null)
75+
private static function getValueFromKey(array $data, string $key, ?string $message = null): mixed
7776
{
7877
if (isset($data[$key])) {
7978
return $data[$key];

src/RequestTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ trait RequestTrait
3636
*
3737
* @var null|string
3838
*/
39-
private $requestTarget;
39+
private ?string $requestTarget = null;
4040

4141
/** @var UriInterface */
4242
private $uri;

src/Response/ArraySerializer.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ public static function fromArray(array $serializedResponse): Response
6868
}
6969

7070
/**
71-
* @return mixed
7271
* @throws Exception\DeserializationException
7372
*/
74-
private static function getValueFromKey(array $data, string $key, ?string $message = null)
73+
private static function getValueFromKey(array $data, string $key, ?string $message = null): mixed
7574
{
7675
if (isset($data[$key])) {
7776
return $data[$key];

src/Response/JsonResponse.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ class JsonResponse extends Response
4343
| JSON_HEX_QUOT
4444
| JSON_UNESCAPED_SLASHES;
4545

46-
/** @var mixed */
47-
private $payload;
46+
private mixed $payload;
4847

4948
/**
5049
* Create a JSON response with the given data.
@@ -65,7 +64,7 @@ class JsonResponse extends Response
6564
* @throws Exception\InvalidArgumentException If unable to encode the $data to JSON.
6665
*/
6766
public function __construct(
68-
$data,
67+
mixed $data,
6968
int $status = 200,
7069
array $headers = [],
7170
private int $encodingOptions = self::DEFAULT_JSON_FLAGS

src/Uri.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ class Uri implements UriInterface, Stringable
5252
*/
5353
public const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~\pL';
5454

55-
/** @var int[] Array indexed by valid scheme names to their corresponding ports. */
55+
/**
56+
* Array indexed by valid scheme names to their corresponding ports.
57+
*
58+
* @var array<string, positive-int>
59+
*/
5660
protected $allowedSchemes = [
5761
'http' => 80,
5862
'https' => 443,

0 commit comments

Comments
 (0)