EqualStrictExpression   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A evaluate() 0 11 3
1
<?php declare(strict_types=1);
2
3
/**
4
 * @license     http://opensource.org/licenses/mit-license.php MIT
5
 * @link        https://github.com/nicoSWD
6
 * @author      Nicolas Oelgart <[email protected]>
7
 */
8
namespace nicoSWD\Rule\Expression;
9
10
use nicoSWD\Rule\TokenStream\TokenCollection;
11
12
final class EqualStrictExpression extends BaseExpression
13
{
14 146
    public function evaluate(mixed $leftValue, mixed $rightValue): bool
15
    {
16 146
        if ($leftValue instanceof TokenCollection) {
17 12
            $leftValue = $leftValue->toArray();
18
        }
19
20 146
        if ($rightValue instanceof TokenCollection) {
21 30
            $rightValue = $rightValue->toArray();
22
        }
23
24 146
        return $leftValue === $rightValue;
25
    }
26
}
27