@@ -39,62 +39,62 @@ class Request
39
39
* Stored $_POST values
40
40
* @var array<string,mixed>
41
41
*/
42
- protected $ post ;
42
+ protected readonly array $ post ;
43
43
44
44
/**
45
45
* Stored $_GET values
46
46
* @var array<string,mixed>
47
47
*/
48
- protected $ get ;
48
+ protected readonly array $ get ;
49
49
50
50
/**
51
51
* Stored $_COOKIE values
52
52
* @var array<string,mixed>
53
53
*/
54
- protected $ cookie ;
54
+ protected readonly array $ cookie ;
55
55
56
56
/**
57
57
* Stored $_SERVER values
58
58
* @var array<string,mixed>
59
59
*/
60
- protected $ server ;
60
+ protected readonly array $ server ;
61
61
62
62
/**
63
63
* Request property data
64
64
*
65
65
* @var array<string, mixed>
66
66
*/
67
- protected $ request ;
67
+ protected readonly array $ request ;
68
68
69
69
/**
70
70
* Stored $_FILES values
71
71
* @var array<string,array<string,mixed>>
72
72
*/
73
- protected $ files ;
73
+ protected readonly array $ files ;
74
74
75
75
/**
76
76
* Stored php://input values
77
77
* @var string
78
78
*/
79
- protected $ raw_data ;
79
+ protected string $ raw_data ;
80
80
81
81
/**
82
82
* Stored command line arguments
83
83
* @var array<string,string|null>
84
84
*/
85
- protected $ cli_args ;
85
+ protected readonly array $ cli_args ;
86
86
87
87
/**
88
88
* Shared instance of the request parser.
89
89
* @var RequestParserInterface
90
90
*/
91
- protected $ parser ;
91
+ protected readonly RequestParserInterface $ parser ;
92
92
93
93
/**
94
94
* The request values to mock.
95
95
* @var array<string,mixed>
96
96
*/
97
- private $ mock ;
97
+ private array $ mock ;
98
98
99
99
/**
100
100
* Constructor.
@@ -122,15 +122,8 @@ public function __construct($parser)
122
122
*/
123
123
public function __destruct ()
124
124
{
125
- unset($ this ->post );
126
- unset($ this ->get );
127
- unset($ this ->server );
128
- unset($ this ->cookie );
129
- unset($ this ->request );
130
- unset($ this ->files );
131
- unset($ this ->parser );
132
- unset($ this ->mock );
133
- unset($ this ->raw_data );
125
+ // Intentionally not unsetting $this->mock and $this->raw_data, since
126
+ // that may break access to mocked request values during PHP shutdown.
134
127
}
135
128
136
129
/**
0 commit comments