Skip to content

Commit

Permalink
Add missing types
Browse files Browse the repository at this point in the history
Signed-off-by: ADmad <[email protected]>
  • Loading branch information
ADmad committed Nov 12, 2024
1 parent 746db20 commit 5244e00
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
6 changes: 2 additions & 4 deletions src/MessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ trait MessageTrait
/**
* List of all registered headers, as key => array of values.
*
* @var array
* @psalm-var array<non-empty-string, list<string>>
* @var array<non-empty-string, list<string>>
*/
protected $headers = [];

/**
* Map of normalized header name to original name used to register header.
*
* @var array
* @psalm-var array<non-empty-string, non-empty-string>
* @var array<non-empty-string, non-empty-string>
*/
protected $headerNames = [];

Expand Down
3 changes: 1 addition & 2 deletions src/Request/ArraySerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 1 addition & 2 deletions src/Response/ArraySerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
5 changes: 2 additions & 3 deletions src/Response/JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, positive-int>
*/
protected $allowedSchemes = [
'http' => 80,
'https' => 443,
Expand Down

0 comments on commit 5244e00

Please sign in to comment.