for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Core\Services\Globals;
class Globals
{
private $GET;
private $POST;
private $SERVER;
private $SESSION;
public function __construct()
$this->GET = \filter_input_array(\INPUT_GET) ?? \null;
$this->POST = \filter_input_array(\INPUT_POST) ?? \null;
$this->SERVER = \filter_input_array(\INPUT_SERVER) ?? \null;
$this->SESSION = \filter_var_array($_SESSION, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
Core\Services\Globals\FI...TIZE_FULL_SPECIAL_CHARS
}
/**
* Get $_GET
* @param string $key
* @return mixed
*/
public function getGET(string $key = \null)
if (null !== $key) {
return $this->GET[$key] ?? \null;
return $this->GET;
* Get $_POST
public function getPOST(string $key = \null)
return $this->POST[$key] ?? \null;
return $this->POST;
* Get $_SERVER
public function getSERVER(string $key = \null)
return $this->SERVER[$key] ?? \null;
return $this->SERVER;
* Get $_SESSION
public function getSESSION(string $key = \null)
return $this->SESSION[$key] ?? \null;
return $this->SESSION;