SimpleParser::getQueryValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Noitran\RQL\Parsers\Simple;
6
7
use Illuminate\Http\Request;
8
use Illuminate\Support\Collection;
9
use Noitran\RQL\Parsers\AbstractParser;
10
11
/**
12
 * Class RequestParser.
13
 */
14
class SimpleParser extends AbstractParser
15
{
16
    /**
17
     * @var array
18
     */
19
    protected $request;
20
21
    /**
22
     * SimpleParser constructor.
23
     *
24
     * @param array $request
25
     */
26
    public function __construct(array $request)
27
    {
28
        $this->request = $request;
29
30
        $this->init();
31
    }
32
33
    /**
34
     * @return string|array|null
35
     */
36
    public function getQueryValue()
37
    {
38
        return $this->request;
39
    }
40
41
    /**
42
     * @return Collection
43
     */
44
    public function parse(): Collection
45
    {
46
        $input = $this->getQueryValue();
47
48
        return $this->parseInput($input);
49
    }
50
}
51