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

ValidatesOperators::isLogicalOperator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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