Skip to content

Commit 516c50d

Browse files
authored
refactor: Superglobals - remove property promotion and fix PHPDocs (#9871)
1 parent f204ff7 commit 516c50d

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

system/Superglobals.php

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,36 @@
4242
*/
4343
final class Superglobals
4444
{
45+
/**
46+
* @var array<string, server_items>
47+
*/
48+
private array $server = [];
49+
50+
/**
51+
* @var array<string, get_items>
52+
*/
53+
private array $get = [];
54+
55+
/**
56+
* @var array<string, post_items>
57+
*/
58+
private array $post = [];
59+
60+
/**
61+
* @var array<string, cookie_items>
62+
*/
63+
private array $cookie = [];
64+
65+
/**
66+
* @var array<string, files_items>
67+
*/
68+
private array $files = [];
69+
70+
/**
71+
* @var array<string, request_items>
72+
*/
73+
private array $request = [];
74+
4575
/**
4676
* @param array<string, server_items>|null $server
4777
* @param array<string, get_items>|null $get
@@ -51,12 +81,12 @@ final class Superglobals
5181
* @param array<string, request_items>|null $request
5282
*/
5383
public function __construct(
54-
private ?array $server = null,
55-
private ?array $get = null,
56-
private ?array $post = null,
57-
private ?array $cookie = null,
58-
private ?array $files = null,
59-
private ?array $request = null,
84+
?array $server = null,
85+
?array $get = null,
86+
?array $post = null,
87+
?array $cookie = null,
88+
?array $files = null,
89+
?array $request = null,
6090
) {
6191
$this
6292
->setServerArray($server ?? $_SERVER)
@@ -360,7 +390,7 @@ public function setRequestArray(array $array): self
360390
/**
361391
* Get all $_FILES values.
362392
*
363-
* @return files_items
393+
* @return array<string, files_items>
364394
*/
365395
public function getFilesArray(): array
366396
{
@@ -370,7 +400,7 @@ public function getFilesArray(): array
370400
/**
371401
* Set the entire $_FILES array.
372402
*
373-
* @param files_items $array
403+
* @param array<string, files_items> $array
374404
*/
375405
public function setFilesArray(array $array): self
376406
{

0 commit comments

Comments
 (0)