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 — 2.2 ( 7ff136...c87423 )
by Simone
04:24
created

Value::getFilter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 11
ccs 5
cts 6
cp 0.8333
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
crap 2.0185
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 7
    private function __construct($filter) {
13 7
        $this->filter = $filter;
14 7
    }
15
16 1
    public function getFilter()
17
    {
18 1
        $filterCameFromQueryString = is_string($this->filter);
19
20 1
        $isAdditionalFilter = !$filterCameFromQueryString;
21
22 1
        if ($isAdditionalFilter) {
23
            return $this->filter['list'][0];
24
        }
25
26 1
        return $this->filter;
27
    }
28
29 7
    public static function fromFilter($filter)
30
    {
31 7
        return new self($filter);
32
    }
33
}
34