1 | <?php |
||
12 | class IntervalComparator |
||
13 | { |
||
14 | /** |
||
15 | * @var ComparableIntervalInterface |
||
16 | */ |
||
17 | private $interval; |
||
18 | |||
19 | /** |
||
20 | * @param ComparableIntervalInterface $interval |
||
21 | */ |
||
22 | public function __construct(ComparableIntervalInterface $interval) |
||
26 | |||
27 | /** |
||
28 | * @param IntervalPointInterface $point |
||
29 | * |
||
30 | * @return bool |
||
31 | */ |
||
32 | public function contains(IntervalPointInterface $point) |
||
44 | |||
45 | /** |
||
46 | * @param ComparableIntervalInterface $interval |
||
47 | * @param bool $check_interval_type |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function intersects(ComparableIntervalInterface $interval, $check_interval_type = true) |
||
72 | |||
73 | /** |
||
74 | * @param ComparableIntervalInterface $interval |
||
75 | * |
||
76 | * @return ComparableIntervalInterface|null |
||
77 | */ |
||
78 | public function intersection(ComparableIntervalInterface $interval) |
||
121 | |||
122 | /** |
||
123 | * The point is before the interval |
||
124 | * |
||
125 | * @param IntervalPointInterface $point |
||
126 | * |
||
127 | * @return bool |
||
128 | */ |
||
129 | public function before(IntervalPointInterface $point) |
||
133 | |||
134 | /** |
||
135 | * The point is after the interval |
||
136 | * |
||
137 | * @param IntervalPointInterface $point |
||
138 | * |
||
139 | * @return bool |
||
140 | */ |
||
141 | public function after(IntervalPointInterface $point) |
||
145 | } |
||
146 |