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 ( 26dfd6...38922b )
by Simone
04:29
created

Operators   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 61
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultOperator() 0 3 1
A get() 0 3 1
A getAll() 0 3 1
1
<?php
2
3
namespace Mado\QueryBundle\Vocabulary;
4
5
class Operators
6
{
7
    const DEFAULT_OPERATOR = 'eq';
8
9
    private static $operatorMap = [
10
        'eq' => [
11
            'meta' => '=',
12
        ],
13
        'neq' => [
14
            'meta' => '!=',
15
        ],
16
        'gt' => [
17
            'meta' => '>',
18
        ],
19
        'gte' => [
20
            'meta' => '>=',
21
        ],
22
        'lt' => [
23
            'meta' => '<',
24
        ],
25
        'lte' => [
26
            'meta' => '<=',
27
        ],
28
        'startswith' => [
29
            'meta' => 'LIKE',
30
            'substitution_pattern' => '{string}%'
31
        ],
32
        'contains' => [
33
            'meta' => 'LIKE',
34
            'substitution_pattern' => '%{string}%'
35
        ],
36
        'notcontains' => [
37
            'meta' => 'NOT LIKE',
38
            'substitution_pattern' => '%{string}%'
39
        ],
40
        'endswith' => [
41
            'meta' => 'LIKE',
42
            'substitution_pattern' => '%{string}'
43
        ],
44
        'list' => [
45
            'meta' => 'IN',
46
            'substitution_pattern' => '({string})',
47
        ],
48
        'field_eq' => [
49
            'meta' => '=',
50
        ],
51
    ];
52
53
    public static function getAll()
54
    {
55
        return static::$operatorMap;
0 ignored issues
show
Bug introduced by
Since $operatorMap is declared private, accessing it with static will lead to errors in possible sub-classes; you can either use self, or increase the visibility of $operatorMap to at least protected.
Loading history...
56
    }
57
58
    public static function getDefaultOperator()
59
    {
60
        return static::getAll()[static::DEFAULT_OPERATOR];
61
    }
62
63
    public static function get($operator)
64
    {
65
        return static::getAll()[$operator];
66
    }
67
}
68