Skip to content

Commit 84c9cef

Browse files
committed
apply code suggestions
1 parent 79091a3 commit 84c9cef

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

system/HTTP/CLIRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function getOptionString(bool $useLongOpts = false): string
185185
*/
186186
protected function parseCommand()
187187
{
188-
$args = $this->getServer('argv') ?? [];
188+
$args = $this->getServer('argv');
189189
array_shift($args); // Scrap index.php
190190

191191
$optionValue = false;

system/Superglobals.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __construct(
8585
}
8686

8787
/**
88-
* Get a value from $_SERVER
88+
* Get a value from $_SERVER.
8989
*
9090
* @return array<array-key, mixed>|float|int|string|null
9191
*/
@@ -95,7 +95,7 @@ public function server(string $key): array|float|int|string|null
9595
}
9696

9797
/**
98-
* Set a value in $_SERVER
98+
* Set a value in $_SERVER.
9999
*
100100
* @param array<array-key, mixed>|float|int|string $value
101101
*/
@@ -106,15 +106,15 @@ public function setServer(string $key, array|float|int|string $value): void
106106
}
107107

108108
/**
109-
* Remove a key from $_SERVER
109+
* Remove a key from $_SERVER.
110110
*/
111111
public function unsetServer(string $key): void
112112
{
113113
unset($this->server[$key], $_SERVER[$key]);
114114
}
115115

116116
/**
117-
* Get all $_SERVER values
117+
* Get all $_SERVER values.
118118
*
119119
* @return array<string, array|float|int|string>
120120
*/
@@ -124,7 +124,7 @@ public function getServerArray(): array
124124
}
125125

126126
/**
127-
* Set the entire $_SERVER array
127+
* Set the entire $_SERVER array.
128128
*
129129
* @param array<string, array|float|int|string> $array
130130
*/
@@ -135,7 +135,7 @@ public function setServerArray(array $array): void
135135
}
136136

137137
/**
138-
* Get a value from $_GET
138+
* Get a value from $_GET.
139139
*
140140
* @return array<array-key, mixed>|string|null
141141
*/
@@ -145,7 +145,7 @@ public function get(string $key): array|string|null
145145
}
146146

147147
/**
148-
* Set a value in $_GET
148+
* Set a value in $_GET.
149149
*
150150
* @param array<array-key, mixed>|string $value
151151
*/
@@ -156,15 +156,15 @@ public function setGet(string $key, array|string $value): void
156156
}
157157

158158
/**
159-
* Remove a key from $_GET
159+
* Remove a key from $_GET.
160160
*/
161161
public function unsetGet(string $key): void
162162
{
163163
unset($this->get[$key], $_GET[$key]);
164164
}
165165

166166
/**
167-
* Get all $_GET values
167+
* Get all $_GET values.
168168
*
169169
* @return array<string, array|string>
170170
*/
@@ -174,7 +174,7 @@ public function getGetArray(): array
174174
}
175175

176176
/**
177-
* Set the entire $_GET array
177+
* Set the entire $_GET array.
178178
*
179179
* @param array<string, array|string> $array
180180
*/
@@ -185,7 +185,7 @@ public function setGetArray(array $array): void
185185
}
186186

187187
/**
188-
* Get a value from $_POST
188+
* Get a value from $_POST.
189189
*
190190
* @return array<array-key, mixed>|string|null
191191
*/
@@ -195,7 +195,7 @@ public function post(string $key): array|string|null
195195
}
196196

197197
/**
198-
* Set a value in $_POST
198+
* Set a value in $_POST.
199199
*
200200
* @param array<array-key, mixed>|string $value
201201
*/
@@ -206,15 +206,15 @@ public function setPost(string $key, array|string $value): void
206206
}
207207

208208
/**
209-
* Remove a key from $_POST
209+
* Remove a key from $_POST.
210210
*/
211211
public function unsetPost(string $key): void
212212
{
213213
unset($this->post[$key], $_POST[$key]);
214214
}
215215

216216
/**
217-
* Get all $_POST values
217+
* Get all $_POST values.
218218
*
219219
* @return array<string, array|string>
220220
*/
@@ -224,7 +224,7 @@ public function getPostArray(): array
224224
}
225225

226226
/**
227-
* Set the entire $_POST array
227+
* Set the entire $_POST array.
228228
*
229229
* @param array<string, array|string> $array
230230
*/
@@ -235,7 +235,7 @@ public function setPostArray(array $array): void
235235
}
236236

237237
/**
238-
* Get a value from $_COOKIE
238+
* Get a value from $_COOKIE.
239239
*
240240
* @return array<array-key, mixed>|string|null
241241
*/
@@ -245,7 +245,7 @@ public function cookie(string $key): array|string|null
245245
}
246246

247247
/**
248-
* Set a value in $_COOKIE
248+
* Set a value in $_COOKIE.
249249
*
250250
* @param array<array-key, mixed>|string $value
251251
*/
@@ -256,15 +256,15 @@ public function setCookie(string $key, array|string $value): void
256256
}
257257

258258
/**
259-
* Remove a key from $_COOKIE
259+
* Remove a key from $_COOKIE.
260260
*/
261261
public function unsetCookie(string $key): void
262262
{
263263
unset($this->cookie[$key], $_COOKIE[$key]);
264264
}
265265

266266
/**
267-
* Get all $_COOKIE values
267+
* Get all $_COOKIE values.
268268
*
269269
* @return array<string, array|string>
270270
*/
@@ -274,7 +274,7 @@ public function getCookieArray(): array
274274
}
275275

276276
/**
277-
* Set the entire $_COOKIE array
277+
* Set the entire $_COOKIE array.
278278
*
279279
* @param array<string, array|string> $array
280280
*/
@@ -285,7 +285,7 @@ public function setCookieArray(array $array): void
285285
}
286286

287287
/**
288-
* Get a value from $_REQUEST
288+
* Get a value from $_REQUEST.
289289
*
290290
* @return array<array-key, mixed>|string|null
291291
*/
@@ -295,7 +295,7 @@ public function request(string $key): array|string|null
295295
}
296296

297297
/**
298-
* Set a value in $_REQUEST
298+
* Set a value in $_REQUEST.
299299
*
300300
* @param array<array-key, mixed>|string $value
301301
*/
@@ -306,15 +306,15 @@ public function setRequest(string $key, array|string $value): void
306306
}
307307

308308
/**
309-
* Remove a key from $_REQUEST
309+
* Remove a key from $_REQUEST.
310310
*/
311311
public function unsetRequest(string $key): void
312312
{
313313
unset($this->request[$key], $_REQUEST[$key]);
314314
}
315315

316316
/**
317-
* Get all $_REQUEST values
317+
* Get all $_REQUEST values.
318318
*
319319
* @return array<string, array|string>
320320
*/
@@ -324,7 +324,7 @@ public function getRequestArray(): array
324324
}
325325

326326
/**
327-
* Set the entire $_REQUEST array
327+
* Set the entire $_REQUEST array.
328328
*
329329
* @param array<string, array|string> $array
330330
*/
@@ -335,7 +335,7 @@ public function setRequestArray(array $array): void
335335
}
336336

337337
/**
338-
* Get all $_FILES values
338+
* Get all $_FILES values.
339339
*
340340
* @return array<string, array<string, mixed>>
341341
*/
@@ -345,7 +345,7 @@ public function getFilesArray(): array
345345
}
346346

347347
/**
348-
* Set the entire $_FILES array
348+
* Set the entire $_FILES array.
349349
*
350350
* @param array<string, array<string, mixed>> $array
351351
*/
@@ -356,9 +356,9 @@ public function setFilesArray(array $array): void
356356
}
357357

358358
/**
359-
* Get a superglobal array by name
359+
* Get a superglobal array by name.
360360
*
361-
* @param string $name The superglobal name (server, get, post, cookie, request, files)
361+
* @param string $name The superglobal name (server, get, post, cookie, files, request)
362362
*
363363
* @return array<string, array|float|int|string>
364364
*/
@@ -369,16 +369,16 @@ public function getGlobalArray(string $name): array
369369
'get' => $this->get,
370370
'post' => $this->post,
371371
'cookie' => $this->cookie,
372-
'request' => $this->request,
373372
'files' => $this->files,
373+
'request' => $this->request,
374374
default => [],
375375
};
376376
}
377377

378378
/**
379-
* Set a superglobal array by name
379+
* Set a superglobal array by name.
380380
*
381-
* @param string $name The superglobal name (server, get, post, cookie, request, files)
381+
* @param string $name The superglobal name (server, get, post, cookie, files, request)
382382
* @param array<string, array|float|int|string> $array The array to set
383383
*/
384384
public function setGlobalArray(string $name, array $array): void
@@ -388,8 +388,8 @@ public function setGlobalArray(string $name, array $array): void
388388
'get' => $this->setGetArray($array),
389389
'post' => $this->setPostArray($array),
390390
'cookie' => $this->setCookieArray($array),
391-
'request' => $this->setRequestArray($array),
392391
'files' => $this->setFilesArray($array),
392+
'request' => $this->setRequestArray($array),
393393
default => null,
394394
};
395395
}

0 commit comments

Comments
 (0)