From 88ac87da9868081acc77f266adf3706544f69e8c Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 11 Nov 2024 17:03:32 +0530 Subject: [PATCH] Add missing types Signed-off-by: ADmad --- src/MessageTrait.php | 6 ++---- src/Request/ArraySerializer.php | 3 +-- src/Response/ArraySerializer.php | 3 +-- src/Response/JsonResponse.php | 3 +-- src/Uri.php | 6 +++++- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/MessageTrait.php b/src/MessageTrait.php index e95d072a..2d842eb4 100644 --- a/src/MessageTrait.php +++ b/src/MessageTrait.php @@ -30,16 +30,14 @@ trait MessageTrait /** * List of all registered headers, as key => array of values. * - * @var array - * @psalm-var array> + * @var array> */ protected $headers = []; /** * Map of normalized header name to original name used to register header. * - * @var array - * @psalm-var array + * @var array */ protected $headerNames = []; diff --git a/src/Request/ArraySerializer.php b/src/Request/ArraySerializer.php index e3c10485..58fe17e4 100644 --- a/src/Request/ArraySerializer.php +++ b/src/Request/ArraySerializer.php @@ -70,10 +70,9 @@ public static function fromArray(array $serializedRequest): Request } /** - * @return mixed * @throws Exception\DeserializationException */ - private static function getValueFromKey(array $data, string $key, ?string $message = null) + private static function getValueFromKey(array $data, string $key, ?string $message = null): mixed { if (isset($data[$key])) { return $data[$key]; diff --git a/src/Response/ArraySerializer.php b/src/Response/ArraySerializer.php index 0828e798..ddbf17bc 100644 --- a/src/Response/ArraySerializer.php +++ b/src/Response/ArraySerializer.php @@ -68,10 +68,9 @@ public static function fromArray(array $serializedResponse): Response } /** - * @return mixed * @throws Exception\DeserializationException */ - private static function getValueFromKey(array $data, string $key, ?string $message = null) + private static function getValueFromKey(array $data, string $key, ?string $message = null): mixed { if (isset($data[$key])) { return $data[$key]; diff --git a/src/Response/JsonResponse.php b/src/Response/JsonResponse.php index f570a0a0..fd6769ca 100644 --- a/src/Response/JsonResponse.php +++ b/src/Response/JsonResponse.php @@ -43,8 +43,7 @@ class JsonResponse extends Response | JSON_HEX_QUOT | JSON_UNESCAPED_SLASHES; - /** @var mixed */ - private $payload; + private mixed $payload; /** * Create a JSON response with the given data. diff --git a/src/Uri.php b/src/Uri.php index 0c35fdc6..d6b1d498 100644 --- a/src/Uri.php +++ b/src/Uri.php @@ -52,7 +52,11 @@ class Uri implements UriInterface, Stringable */ public const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~\pL'; - /** @var int[] Array indexed by valid scheme names to their corresponding ports. */ + /** + * Array indexed by valid scheme names to their corresponding ports. + * + * @var array + */ protected $allowedSchemes = [ 'http' => 80, 'https' => 443,