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 (#120)
by Simone
05:37 queued 02:42
created

Filter   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 42
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A box() 0 11 1
A getRawFilter() 0 3 1
A getOperator() 0 3 1
A __construct() 0 5 1
A getIds() 0 3 1
1
<?php
2
3
namespace Mado\QueryBundle\Objects;
4
5
class Filter
6
{
7
    private $rawFilter;
8
9
    private $ids;
10
11
    private $operator;
12
13
    public static function box(array $params)
14
    {
15
        $rawIds    = $params['ids'];
16
        $operator  = key($rawIds);
17
        $ids       = join(',', current($rawIds));
18
        $rawFilter = $params['path'] . '.id|' . $operator;
19
20
        return new self([
21
            'raw_filter' => $rawFilter,
22
            'ids'        => $ids,
23
            'operator'   => $operator,
24
        ]);
25
    }
26
27
    private function __construct(array $params)
28
    {
29
        $this->rawFilter = $params['raw_filter'];
30
        $this->ids       = $params['ids'];
31
        $this->operator  = $params['operator'];
32
    }
33
34
    public function getRawFilter()
35
    {
36
        return $this->rawFilter;
37
    }
38
39
    public function getIds()
40
    {
41
        return $this->ids;
42
    }
43
44
    public function getOperator()
45
    {
46
        return $this->operator;
47
    }
48
}
49