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..17928d38 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. @@ -65,7 +64,7 @@ class JsonResponse extends Response * @throws Exception\InvalidArgumentException If unable to encode the $data to JSON. */ public function __construct( - $data, + mixed $data, int $status = 200, array $headers = [], private int $encodingOptions = self::DEFAULT_JSON_FLAGS 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,