diff --git a/src/ServerRequest/Cookies.php b/src/ServerRequest/Cookies.php index 639983f..201a175 100644 --- a/src/ServerRequest/Cookies.php +++ b/src/ServerRequest/Cookies.php @@ -14,18 +14,11 @@ */ final class Cookies implements \Countable { - /** @var Map */ - private Map $cookies; - /** - * @param Map|null $cookies + * @param Map $cookies */ - private function __construct(?Map $cookies = null) + private function __construct(private Map $cookies) { - /** @var Map */ - $cookies = $cookies ?? Map::of(); - - $this->cookies = $cookies; } /** @@ -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()); } /** diff --git a/src/ServerRequest/Environment.php b/src/ServerRequest/Environment.php index 2c3c87a..2b191dd 100644 --- a/src/ServerRequest/Environment.php +++ b/src/ServerRequest/Environment.php @@ -14,18 +14,11 @@ */ final class Environment implements \Countable { - /** @var Map */ - private Map $variables; - /** - * @param Map|null $variables + * @param Map $variables */ - private function __construct(?Map $variables = null) + private function __construct(private Map $variables) { - /** @var Map */ - $variables = $variables ?? Map::of(); - - $this->variables = $variables; } /** @@ -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()); } /** diff --git a/src/ServerRequest/Query.php b/src/ServerRequest/Query.php index b03795d..b19be56 100644 --- a/src/ServerRequest/Query.php +++ b/src/ServerRequest/Query.php @@ -13,7 +13,6 @@ final class Query implements \Countable private function __construct( private array $data, ) { - $this->data = $data; } /**