EmptyOperator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A executeComparison() 0 3 1
1
<?php
2
/**
3
 * Copyright © 2018 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
/**
11
 * Class EmptyOperator
12
 *
13
 * The EMPTY:
14
 * The output is "true" if $expression is empty
15
 */
16
final class EmptyOperator extends AbstractCompareOne
17
{
18
    public const CODE = 'empty';
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function executeComparison($expression): bool
24
    {
25
        return empty($expression);
26
    }
27
}
28