Completed
Push — master ( df9952...f86661 )
by Hannes
04:17 queued 02:11
created

All::evaluate()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 3
nop 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace hanneskod\yaysondb\Expression\Counter;
6
7
use hanneskod\yaysondb\Expression\Counter;
8
9
/**
10
 * All contained expressions must evaluate to true
11
 */
12 View Code Duplication
class All extends Counter
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    /**
15
     * Evaluate that contained expressions returns true
16
     */
17
    public function evaluate($operand): bool
18
    {
19
        foreach ($this->exprs as $expr) {
20
            if (!$expr->evaluate($operand)) {
21
                return false;
22
            }
23
        }
24
25
        return true;
26
    }
27
}
28