Skip to content

Commit 8d50cb4

Browse files
committed
used constructor promotion
1 parent a96b04b commit 8d50cb4

1 file changed

Lines changed: 7 additions & 21 deletions

File tree

src/Http/Request.php

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,38 +33,24 @@ class Request implements IRequest
3333
{
3434
use Nette\SmartObject;
3535

36-
private string $method;
37-
private UrlScript $url;
38-
private array $post;
39-
private array $files;
40-
private array $cookies;
4136
private array $headers;
42-
private ?string $remoteAddress;
43-
private ?string $remoteHost;
4437

4538
/** @var ?callable */
4639
private $rawBodyCallback;
4740

4841

4942
public function __construct(
50-
UrlScript $url,
51-
array $post = [],
52-
array $files = [],
53-
array $cookies = [],
43+
private UrlScript $url,
44+
private array $post = [],
45+
private array $files = [],
46+
private array $cookies = [],
5447
array $headers = [],
55-
string $method = 'GET',
56-
?string $remoteAddress = null,
57-
?string $remoteHost = null,
48+
private string $method = 'GET',
49+
private ?string $remoteAddress = null,
50+
private ?string $remoteHost = null,
5851
?callable $rawBodyCallback = null,
5952
) {
60-
$this->url = $url;
61-
$this->post = $post;
62-
$this->files = $files;
63-
$this->cookies = $cookies;
6453
$this->headers = array_change_key_case($headers, CASE_LOWER);
65-
$this->method = $method;
66-
$this->remoteAddress = $remoteAddress;
67-
$this->remoteHost = $remoteHost;
6854
$this->rawBodyCallback = $rawBodyCallback;
6955
}
7056

0 commit comments

Comments
 (0)