GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 243f13...a9f992 )
by Simone
03:07
created

QueryBuilderOptions   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 23.81%

Importance

Changes 0
Metric Value
wmc 11
c 0
b 0
f 0
dl 0
loc 54
ccs 5
cts 21
cp 0.2381
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 3 1
A __construct() 0 3 1
A get() 0 10 3
A getRel() 0 3 1
A getSorting() 0 3 1
A getPrinting() 0 3 1
A getOrFilters() 0 3 1
A getSelect() 0 3 1
A getAndFilters() 0 3 1
1
<?php
2
3
namespace Mado\QueryBundle\Queries;
4
5
class QueryBuilderOptions
6
{
7
    private $options;
8
9 4
    private function __construct(array $options)
10
    {
11 4
        $this->options = $options;
12 4
    }
13
14 4
    public static function fromArray(array $options)
15
    {
16 4
        return new self($options);
17
    }
18
19
    public function get($option, $defaultValue = null)
20
    {
21
        if (
22
            !isset($this->options[$option])
23
            || empty($this->options[$option])
24
        ) {
25
            return $defaultValue;
26
        }
27
28
        return $this->options[$option];
29
    }
30
31
    public function getAndFilters()
32
    {
33
        return $this->get('filters', []);
34
    }
35
36
    public function getOrFilters()
37
    {
38
        return $this->get('orFilters', []);
39
    }
40
41
    public function getSorting()
42
    {
43
        return $this->get('sorting', []);
44
    }
45
46
    public function getRel()
47
    {
48
        return $this->get('rel');
49
    }
50
51
    public function getPrinting()
52
    {
53
        return $this->get('printing', []);
54
    }
55
56
    public function getSelect()
57
    {
58
        return $this->get('select');
59
    }
60
}
61