Total Complexity | 1 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class Operator |
||
12 | { |
||
13 | /** |
||
14 | * Greater than operator. |
||
15 | * |
||
16 | * @const string |
||
17 | */ |
||
18 | public const GREATER = '>'; |
||
19 | |||
20 | /** |
||
21 | * Greater than or equal to operator. |
||
22 | * |
||
23 | * @const string |
||
24 | */ |
||
25 | public const GREATER_OR_EQUAL = '>='; |
||
26 | |||
27 | /** |
||
28 | * Less than operator. |
||
29 | * |
||
30 | * @const string |
||
31 | */ |
||
32 | public const LESS = '<'; |
||
33 | |||
34 | /** |
||
35 | * Less than or equal to operator. |
||
36 | * |
||
37 | * @const string |
||
38 | */ |
||
39 | public const LESS_OR_EQUAL = '<='; |
||
40 | |||
41 | /** |
||
42 | * Equal to operator. |
||
43 | * |
||
44 | * @const string |
||
45 | */ |
||
46 | public const EQUAL = '='; |
||
47 | |||
48 | /** |
||
49 | * Not equal to operator. |
||
50 | * |
||
51 | * @const string |
||
52 | */ |
||
53 | public const NOT_EQUAL = '<>'; |
||
54 | |||
55 | /** |
||
56 | * Available operators |
||
57 | * |
||
58 | * @var array |
||
59 | */ |
||
60 | protected static $operators = [ |
||
61 | self::GREATER, |
||
62 | self::GREATER_OR_EQUAL, |
||
63 | self::LESS, |
||
64 | self::LESS_OR_EQUAL, |
||
65 | self::EQUAL, |
||
66 | self::NOT_EQUAL, |
||
67 | ]; |
||
68 | |||
69 | /** |
||
70 | * Checks operator for availability |
||
71 | * |
||
72 | * @param string $operator |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | 17 | public static function has(string $operator): bool |
|
79 | } |
||
80 | } |