for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Inji;
/**
* User Request parser
*
* @author Alexey Krupskiy <[email protected]>
* @link http://inji.ru/
* @copyright 2016 Alexey Krupskiy
* @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
*/
class UserRequest {
public static function get($key, $type, $default) {
if (!isset($_GET[$key])) {
return $default;
}
if ($type == 'array') {
return !is_array($_GET[$key]) ? [] : $_GET[$key];
settype($_GET[$key], $type);
return $_GET[$key];