for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Request
* Clase para gestionar los Requests POST y GET
* @author nelson rojas
*/
class Request {
* Obtiene el contenido de $_POST[$var]
* @param string $var
* @return mixed|null
public static function post(string $var) {
return filter_has_var(INPUT_POST, $var) ? $_POST[$var] : NULL;
}
* Permite saber si $var está contenido dentro de $_POST
* @return bool
public static function hasPost(string $var):bool {
return filter_has_var(INPUT_POST, $var);
* Obtiene el contenido de $var dentro de $_GET[$var]
public static function get(string $var) {
return filter_has_var(INPUT_GET, $var) ? $_GET[$var] : NULL;
* Permite saber si existe $var dentro de $_GET
public static function hasGet(string $var):bool {
return filter_has_var(INPUT_GET, $var);