Skip to content
Merged
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
13 changes: 3 additions & 10 deletions src/ServerRequest/Cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@
*/
final class Cookies implements \Countable
{
/** @var Map<string, string> */
private Map $cookies;

/**
* @param Map<string, string>|null $cookies
* @param Map<string, string> $cookies
*/
private function __construct(?Map $cookies = null)
private function __construct(private Map $cookies)
{
/** @var Map<string, string> */
$cookies = $cookies ?? Map::of();

$this->cookies = $cookies;
}

/**
Expand All @@ -36,7 +29,7 @@ private function __construct(?Map $cookies = null)
#[\NoDiscard]
public static function of(?Map $cookies = null): self
{
return new self($cookies);
return new self($cookies ?? Map::of());
}

/**
Expand Down
13 changes: 3 additions & 10 deletions src/ServerRequest/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@
*/
final class Environment implements \Countable
{
/** @var Map<string, string> */
private Map $variables;

/**
* @param Map<string, string>|null $variables
* @param Map<string, string> $variables
*/
private function __construct(?Map $variables = null)
private function __construct(private Map $variables)
{
/** @var Map<string, string> */
$variables = $variables ?? Map::of();

$this->variables = $variables;
}

/**
Expand All @@ -36,7 +29,7 @@ private function __construct(?Map $variables = null)
#[\NoDiscard]
public static function of(?Map $variables = null): self
{
return new self($variables);
return new self($variables ?? Map::of());
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/ServerRequest/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ final class Query implements \Countable
private function __construct(
private array $data,
) {
$this->data = $data;
}

/**
Expand Down