InOperator::executeComparison()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 1
b 0
f 1
1
<?php
2
/**
3
 * Copyright © Thomas Klein, All rights reserved.
4
 * See LICENSE bundled with this library for license details.
5
 */
6
declare(strict_types=1);
7
8
namespace LogicTree\Operator\Comparator;
9
10
use function in_array;
11
12
/**
13
 * The IN:
14
 * The output is "true" if $expr1 is in list $expr2 after type juggling.
15
 */
16
final class InOperator extends AbstractCompareTwo
17
{
18
    public const CODE = 'in';
19
20
    public function executeComparison($expr1, $expr2): bool
21
    {
22
        return in_array($expr1, $expr2, false);
23
    }
24
}
25