Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing types #202

Open
wants to merge 1 commit into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 1 addition & 2 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 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
Loading