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.

Value   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 94.12%

Importance

Changes 0
Metric Value
wmc 8
eloc 11
dl 0
loc 40
c 0
b 0
f 0
ccs 16
cts 17
cp 0.9412
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getOperator() 0 3 1
A fromFilter() 0 3 1
A getValues() 0 3 1
A camesFromAdditionalFilters() 0 3 1
A camesFromQueryString() 0 3 1
A getFilter() 0 7 2
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