| Conditions | 7 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 7 |
| Changes | 0 | ||
| 1 | <?php |
||
| 82 | 5 | public function intersects(Period $period): bool |
|
| 83 | { |
||
| 84 | 5 | if ($this->getStart() >= $period->getStart() |
|
| 85 | 5 | && $this->getStart() <= $period->getEnd() |
|
| 86 | ) { |
||
| 87 | 2 | return true; |
|
| 88 | } |
||
| 89 | |||
| 90 | 3 | if ($this->getEnd() <= $period->getEnd() |
|
| 91 | 3 | && $this->getEnd() >= $period->getStart() |
|
| 92 | ) { |
||
| 93 | 1 | return true; |
|
| 94 | } |
||
| 95 | |||
| 96 | 2 | if ($this->in($period) |
|
| 97 | 2 | || $this->encloses($period) |
|
| 98 | ) { |
||
| 99 | 1 | return true; |
|
| 100 | } |
||
| 101 | |||
| 102 | 1 | return false; |
|
| 103 | } |
||
| 104 | } |