LessThanOrEqual::matches()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2013-2017 2amigOS! Consulting Group LLC
4
 * @link http://2amigos.us
5
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
6
 */
7
namespace dosamigos\arrayquery\conditions;
8
9
10
/**
11
 * LessThanOrEqual checks if value is less than or equal to the data searched.
12
 *
13
 * @author Antonio Ramirez <[email protected]>
14
 * @link http://www.ramirezcobos.com/
15
 * @link http://www.2amigos.us/
16
 * @package dosamigos\arrayquery\conditions
17
 */
18
class LessThanOrEqual extends Condition
19
{
20
21
    /**
22
     * Returns [[GreaterThanOrEqual]] condition
23
     * @return GreaterThanOrEqual
24
     */
25
    public function reverse()
26
    {
27
        return new GreaterThanOrEqual($this->value);
28
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function matches($data)
34
    {
35
        $gt = new LessThan($this->value);
36
        $e = new Equal($this->value);
37
38
        return $gt->matches($data) || $e->matches($data);
39
    }
40
41
}
42