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 ( 4b666b...dcf075 )
by Simone
02:54
created

Value::getFilter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
nc 2
nop 0
dl 0
loc 11
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
namespace Mado\QueryBundle\Queries\Objects;
4
5
final class Value
6
{
7
    private $filter;
8
9
    private function __construct($filter) {
10
        $this->filter = $filter;
11
    }
12
13
    public function getFilter()
14
    {
15
        $filterCameFromQueryString = is_string($this->filter);
16
17
        $isAdditionalFilter = !$filterCameFromQueryString;
18
19
        if ($isAdditionalFilter) {
20
            return $this->filter['list'][0];
21
        }
22
23
        return $this->filter;
24
    }
25
26
    public static function fromFilter($filter)
27
    {
28
        return new self($filter);
29
    }
30
}
31