2424 * @author trabis <lusopoemas@gmail.com>
2525 * @author Joomla!
2626 * @copyright 2011-2023 XOOPS Project (https://xoops.org)
27- * @license GNU GPL 2 or later (http ://www.gnu.org/licenses/gpl-2.0.html)
27+ * @license GNU GPL 2.0 or later (https ://www.gnu.org/licenses/gpl-2.0.html)
2828 * @link https://xoops.org
2929 */
3030class Request
@@ -338,6 +338,7 @@ public static function getIP($name, $default = '', $hash = 'default')
338338 */
339339 public static function getHeader ($ headerName , $ default = '' )
340340 {
341+ /** @var string[] $headers */
341342 static $ headers = null ;
342343
343344 if (null === $ headers ) {
@@ -348,10 +349,10 @@ public static function getHeader($headerName, $default = '')
348349 $ headers [strtolower ($ name )] = $ value ;
349350 }
350351 } else {
351- // From joyview - http ://php.net/manual/en/function.getallheaders.php
352+ // From joyview - https ://php.net/manual/en/function.getallheaders.php
352353 foreach ($ _SERVER as $ name => $ value ) {
353354 if ('HTTP_ ' === substr ($ name , 0 , 5 )) {
354- $ translatedName = str_replace (' ' , '- ' , strtolower (str_replace ('_ ' , ' ' , substr ($ name , 5 ))));
355+ $ translatedName = ( string ) str_replace (' ' , '- ' , strtolower (str_replace ('_ ' , ' ' , substr ($ name , 5 ))));
355356 $ headers [$ translatedName ] = $ value ;
356357 }
357358 }
@@ -371,7 +372,7 @@ public static function getHeader($headerName, $default = '')
371372 * @param string $name variable to look for
372373 * @param string $hash hash to check
373374 *
374- * @return boolean True if hash has an element 'name', otherwise false
375+ * @return bool True if hash has an element 'name', otherwise false
375376 */
376377 public static function hasVar ($ name , $ hash = 'default ' )
377378 {
@@ -391,10 +392,10 @@ public static function hasVar($name, $hash = 'default')
391392 /**
392393 * Set a variable in one of the request variables
393394 *
394- * @param string $name Name
395- * @param string $value Value
396- * @param string $hash Hash
397- * @param boolean $overwrite Boolean
395+ * @param string $name Name
396+ * @param string $value Value
397+ * @param string $hash Hash
398+ * @param bool $overwrite Boolean
398399 *
399400 * @return string Previous value
400401 */
@@ -516,9 +517,9 @@ public static function get($hash = 'default', $mask = 0)
516517 /**
517518 * Sets a request variable
518519 *
519- * @param array $array An associative array of key-value pairs
520- * @param string $hash The request variable to set (POST, GET, FILES, METHOD)
521- * @param boolean $overwrite If true and an existing key is found, the value is overwritten,
520+ * @param array $array An associative array of key-value pairs
521+ * @param string $hash The request variable to set (POST, GET, FILES, METHOD)
522+ * @param bool $overwrite If true and an existing key is found, the value is overwritten,
522523 * otherwise it is ignored
523524 *
524525 * @return void
@@ -575,7 +576,7 @@ protected static function cleanVar($var, $mask = 0, $type = null)
575576 if (null === $ noHtmlFilter ) {
576577 $ noHtmlFilter = FilterInput::getInstance ();
577578 }
578- $ var = $ noHtmlFilter-> clean ($ var , $ type );
579+ $ var = $ noHtmlFilter:: clean ($ var , $ type );
579580 }
580581 }
581582
0 commit comments