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 ( a79b7a...4d8a3d )
by Simone
03:07
created

Value   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 40
rs 10
c 1
b 0
f 0
wmc 8

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getOperator() 0 3 1
A getFilter() 0 7 2
A fromFilter() 0 3 1
A getValues() 0 3 1
A camesFromAdditionalFilters() 0 3 1
A camesFromQueryString() 0 3 1
1
<?php
2
3
namespace Mado\QueryBundle\Queries\Objects;
4
5
/**
6
 * @since Interface available since Release 2.1.3
7
 */
8
final class Value
9
{
10
    private $filter;
11
12
    private function __construct($filter) {
13
        $this->filter = $filter;
14
    }
15
16
    public function getFilter()
17
    {
18
        if ($this->camesFromAdditionalFilters()) {
19
            return $this->filter[$this->getOperator()][0];
20
        }
21
22
        return $this->filter;
23
    }
24
25
    public function getValues()
26
    {
27
        return $this->filter[$this->getOperator()];
28
    }
29
30
    public function getOperator()
31
    {
32
        return key($this->filter);
33
    }
34
35
    public static function fromFilter($filter)
36
    {
37
        return new self($filter);
38
    }
39
40
    public function camesFromQueryString()
41
    {
42
        return is_string($this->filter);
43
    }
44
45
    public function camesFromAdditionalFilters()
46
    {
47
        return !$this->camesFromQueryString();
48
    }
49
}
50