BetweenOrEqualBothRule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 25
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getValues() 0 7 1
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