Passed
Branch next (ee2197)
by Bas
02:37
created

ValidatesOperators   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 27
ccs 6
cts 6
cp 1
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
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\FluentAQL\Traits;
6
7
trait ValidatesOperators
8
{
9
    /**
10
     * @param mixed $operator
11
     * @return bool
12
     */
13 9
    public function isLogicalOperator(mixed $operator): bool
14
    {
15 9
        return isset($this->logicalOperators[strtoupper($operator)]);
16
    }
17
18
    /**
19
     * @param mixed $operator
20
     * @return bool
21
     */
22 2
    public function isComparisonOperator(mixed $operator): bool
23
    {
24 2
        return isset($this->comparisonOperators[strtoupper($operator)]);
25
    }
26
27
    /**
28
     * @param mixed $operator
29
     * @return bool
30
     */
31 3
    public function isArithmeticOperator(mixed $operator): bool
32
    {
33 3
        return isset($this->arithmeticOperators[$operator]);
34
    }
35
}
36