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
09:40 queued 03:51
created

Filter::getRawFilter()   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
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 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 6
    public static function box(array $params)
14
    {
15 6
        $rawIds    = $params['ids'];
16 6
        $operator  = key($rawIds);
17 6
        $ids       = join(',', current($rawIds));
18 6
        $path      = $params['path'];
19 6
        $rawFilter = $path . '.id|' . $operator;
20
21 6
        return new self([
22 6
            'raw_filter' => $rawFilter,
23 6
            'ids'        => $ids,
24 6
            'operator'   => $operator,
25 6
            'path'       => $path,
26
        ]);
27
    }
28
29 6
    private function __construct(array $params)
30
    {
31 6
        $this->rawFilter = $params['raw_filter'];
32 6
        $this->ids       = $params['ids'];
33 6
        $this->operator  = $params['operator'];
34 6
        $this->path      = $params['path'];
0 ignored issues
show
Bug Best Practice introduced by
The property path does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
35 6
    }
36
37 4
    public function getRawFilter()
38
    {
39 4
        return $this->rawFilter;
40
    }
41
42 6
    public function getIds()
43
    {
44 6
        return $this->ids;
45
    }
46
47 6
    public function getOperator()
48
    {
49 6
        return $this->operator;
50
    }
51
52 1
    public function getPath()
53
    {
54 1
        return $this->path;
55
    }
56
}
57