BaseIntervalPoint   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 62
ccs 10
cts 12
cp 0.8333
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A eq() 0 4 1
A neq() 0 4 1
A lt() 0 4 1
A lte() 0 4 1
A gt() 0 4 1
A gte() 0 4 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