@@ -127,6 +127,8 @@ public static function getCurrent(bool $trustProxy = false, int $hostPortSource
127127 {
128128 $ request = new Request ();
129129
130+ /** @var array<string, string> $_SERVER */
131+
130132 if (isset ($ _SERVER ['HTTPS ' ])) {
131133 if ($ _SERVER ['HTTPS ' ] === 'on ' || $ _SERVER ['HTTPS ' ] === '1 ' ) {
132134 $ request ->isSecure = true ;
@@ -253,13 +255,14 @@ public static function getCurrent(bool $trustProxy = false, int $hostPortSource
253255 * - keys are lowercased
254256 * - values are arrays of strings
255257 *
256- * @return array
258+ * @return array<string, list<string>>
257259 */
258260 private static function getCurrentRequestHeaders () : array
259261 {
260262 $ headers = [];
261263
262264 if (function_exists ('apache_request_headers ' )) {
265+ /** @var array<string, string> $requestHeaders */
263266 $ requestHeaders = apache_request_headers ();
264267
265268 if ($ requestHeaders ) {
@@ -272,6 +275,8 @@ private static function getCurrentRequestHeaders() : array
272275 }
273276 }
274277
278+ /** @var array<string, string> $_SERVER */
279+
275280 foreach ($ _SERVER as $ key => $ value ) {
276281 if (substr ($ key , 0 , 5 ) === 'HTTP_ ' ) {
277282 $ key = substr ($ key , 5 );
@@ -1175,6 +1180,7 @@ private function parseQualityValues(string $header) : array
11751180 {
11761181 $ values = $ this ->parseHeaderParameters ($ header );
11771182
1183+ /** @psalm-var list<array{string, float, int}> $result */
11781184 $ result = [];
11791185
11801186 $ count = count ($ values );
@@ -1216,11 +1222,12 @@ private function parseQualityValues(string $header) : array
12161222 /**
12171223 * Parses a header with multiple values and optional parameters.
12181224 *
1219- * Example: text/html; charset=utf8, text/xml => ['text/html' => ['charset' => 'utf8'], 'text/xml' => []]
1225+ * Example: text/html; charset=utf8, text/xml
1226+ * => ['text/html' => ['charset' => 'utf8'], 'text/xml' => []]
12201227 *
12211228 * @param string $header The header to parse.
12221229 *
1223- * @return array An associative array of values and theirs parameters.
1230+ * @return array<string, array<string, string>> An associative array of values and theirs parameters.
12241231 */
12251232 private function parseHeaderParameters (string $ header ) : array
12261233 {
0 commit comments