BetweenOrEqualBothRule::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * BetweenOrEqualBoth
4
 *
5
 * @package php-logical-filter
6
 * @author  Jean Claveau
7
 */
8
namespace JClaveau\LogicalFilter\Rule;
9
10
class BetweenOrEqualBothRule extends BetweenRule
11
{
12
    /** @var string operator */
13
    const operator = '=><=';
14
15
    /**
16
     */
17 11
    public function __construct( $field, array $limits )
18
    {
19 11
        $this->addOperand( new AboveOrEqualRule($field, $limits[0]) );
20 11
        $this->addOperand( new BelowOrEqualRule($field, $limits[1]) );
21 11
    }
22
23
    /**
24
     */
25 11
    public function getValues()
26
    {
27
        return [
28 11
            $this->getMinimum(),
29 11
            $this->getMaximum(),
30 11
        ];
31
    }
32
33
    /**/
34
}
35