First of all i feel really stupid of not seeing this problem and not finding an answer on the interweb already. Here is my input class:
<?php
namespace lib\Api;
class Input {
public $value;
public function get($name){
if(isset($_POST[$name])){
return $_POST[$name];
}else if(isset($_GET[$name])){
return $_GET[$name];
}
return null;
}
public function equals($argument){
$this->getValue() == $argument ? true : false;
}
//etc
}
?>
Then if i put a invallid $_GET[$name]
in there, it is giving the error: Undefined index
Hoping someone can help.