GreaterThanOrEqual::reverse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
 * GreaterThanOrEqual checks if value is greater or equal to the data searched.
11
 *
12
 * @author Antonio Ramirez <[email protected]>
13
 * @link http://www.ramirezcobos.com/
14
 * @link http://www.2amigos.us/
15
 * @package dosamigos\arrayquery\conditions
16
 */
17
class GreaterThanOrEqual extends Condition
18
{
19
20
    /**
21
     * Returns [[LessThanOrEqual]] condition
22
     * @return LessThanOrEqual
23
     */
24
    public function reverse()
25
    {
26
        return new LessThanOrEqual($this->value);
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function matches($data)
33
    {
34
        $gt = new GreaterThan($this->value);
35
        $e = new Equal($this->value);
36
37
        return $gt->matches($data) || $e->matches($data);
38
    }
39
40
}
41