Conditions | 5 |
Paths | 5 |
Total Lines | 35 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
43 | 9 | public function overlaps(self $slot): bool |
|
44 | { |
||
45 | /** |
||
46 | * this: |----| |
||
47 | * slot: |----| |
||
48 | */ |
||
49 | 9 | if ($slot->start()->aheadOf($this->end)) { |
|
50 | 1 | return false; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * this: |----| |
||
55 | * slot: |----| |
||
56 | */ |
||
57 | 8 | if ($this->start->aheadOf($slot->end())) { |
|
58 | 1 | return false; |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * this: |----| |
||
63 | * slot: |----| |
||
64 | */ |
||
65 | 7 | if ($slot->start()->equals($this->end)) { |
|
66 | 1 | return false; |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * this: |----| |
||
71 | * slot: |----| |
||
72 | */ |
||
73 | 6 | if ($this->start->equals($slot->end())) { |
|
74 | 1 | return false; |
|
75 | } |
||
76 | |||
77 | 5 | return true; |
|
78 | } |
||
80 |