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
07:08 queued 02:50
created

Filter   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
dl 0
loc 50
ccs 25
cts 25
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A box() 0 13 1
A getPath() 0 3 1
A getRawFilter() 0 3 1
A getOperator() 0 3 1
A __construct() 0 6 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 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