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
Pull Request — 2.2 (#165)
by Simone
10:05 queued 07:02
created

Value::camesFromAdditionalFilters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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