BaseIntervalPoint::lte()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2016, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Component\Interval;
11
12
abstract class BaseIntervalPoint implements IntervalPointInterface
13
{
14
    /**
15
     * @param IntervalPointInterface $point
16
     *
17
     * @return bool
18
     */
19 21
    public function eq(IntervalPointInterface $point)
20
    {
21 21
        return $this->value() == $point->value();
22
    }
23
24
    /**
25
     * @param IntervalPointInterface $point
26
     *
27
     * @return bool
28
     */
29
    public function neq(IntervalPointInterface $point)
30
    {
31
        return $this->value() != $point->value();
32
    }
33
34
    /**
35
     * @param IntervalPointInterface $point
36
     *
37
     * @return bool
38
     */
39 31
    public function lt(IntervalPointInterface $point)
40
    {
41 31
        return $this->value() < $point->value();
42
    }
43
44
    /**
45
     * @param IntervalPointInterface $point
46
     *
47
     * @return bool
48
     */
49 12
    public function lte(IntervalPointInterface $point)
50
    {
51 12
        return $this->value() <= $point->value();
52
    }
53
54
    /**
55
     * @param IntervalPointInterface $point
56
     *
57
     * @return bool
58
     */
59 24
    public function gt(IntervalPointInterface $point)
60
    {
61 24
        return $this->value() > $point->value();
62
    }
63
64
    /**
65
     * @param IntervalPointInterface $point
66
     *
67
     * @return bool
68
     */
69 65
    public function gte(IntervalPointInterface $point)
70
    {
71 65
        return $this->value() >= $point->value();
72
    }
73
}
74