Skip to content

Commit 0ddf3f9

Browse files
authored
Merge pull request #202 from ADmad/property-types
QA: Add type declarations and refine psalm types
2 parents 60c1829 + 3e88878 commit 0ddf3f9

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

src/MessageTrait.php

Lines changed: 2 additions & 4 deletions
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

Lines changed: 1 addition & 2 deletions
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/Response/ArraySerializer.php

Lines changed: 1 addition & 2 deletions
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

Lines changed: 1 addition & 2 deletions
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.

src/Uri.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ class Uri implements UriInterface, Stringable
5555
*/
5656
public const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~\pL';
5757

58-
/** @var int[] Array indexed by valid scheme names to their corresponding ports. */
58+
/**
59+
* Array indexed by valid scheme names to their corresponding ports.
60+
*
61+
* @var array<string, positive-int>
62+
*/
5963
protected $allowedSchemes = [
6064
'http' => 80,
6165
'https' => 443,

0 commit comments

Comments
 (0)