Passed
Push — master ( b4f91d...b5810c )
by Bas
07:20 queued 04:57
created

ValidatesOperators   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 27
ccs 2
cts 6
cp 0.3333
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isLogicalOperator() 0 3 1
A isComparisonOperator() 0 3 1
A isArithmeticOperator() 0 3 1
1
<?php
2
3
namespace LaravelFreelancerNL\FluentAQL\Traits;
4
5
trait ValidatesOperators
6
{
7
    /**
8
     * @param mixed $operator
9
     * @return bool
10
     */
11
    public function isLogicalOperator($operator): bool
12
    {
13
        return isset($this->logicalOperators[strtoupper($operator)]);
14
    }
15
16
    /**
17
     * @param mixed $operator
18
     * @return bool
19
     */
20 4
    public function isComparisonOperator($operator): bool
21
    {
22 4
        return isset($this->comparisonOperators[strtoupper($operator)]);
23
    }
24
25
    /**
26
     * @param mixed $operator
27
     * @return bool
28
     */
29
    public function isArithmeticOperator($operator): bool
30
    {
31
        return isset($this->arithmeticOperators[$operator]);
32
    }
33
}
34