Code Duplication    Length = 13-13 lines in 2 locations

src/Params/GetInputParam.php 1 location

@@ 5-17 (lines=13) @@
2
3
namespace Tomaj\NetteApi\Params;
4
5
class GetInputParam extends InputParam
6
{
7
    protected $type = self::TYPE_GET;
8
9
    public function getValue()
10
    {
11
        if (!filter_has_var(INPUT_GET, $this->key) && isset($_GET[$this->key])) {
12
            return $_GET[$this->key];
13
        }
14
        $value = $this->isMulti() ? filter_input(INPUT_GET, $this->key, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY) : filter_input(INPUT_GET, $this->key);
15
        return $value !== null ? $value : $this->default;
16
    }
17
}
18

src/Params/PostInputParam.php 1 location

@@ 5-17 (lines=13) @@
2
3
namespace Tomaj\NetteApi\Params;
4
5
class PostInputParam extends InputParam
6
{
7
    protected $type = self::TYPE_POST;
8
9
    public function getValue()
10
    {
11
        if (!filter_has_var(INPUT_POST, $this->key) && isset($_POST[$this->key])) {
12
            return $_POST[$this->key];
13
        }
14
        $value = $this->isMulti() ? filter_input(INPUT_POST, $this->key, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY) : filter_input(INPUT_POST, $this->key);
15
        return $value !== null ? $value : $this->default;
16
    }
17
}
18