SimpleParser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getQueryValue() 0 3 1
A __construct() 0 5 1
A parse() 0 5 1
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