| Conditions | 5 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 3 | protected function intersects( |
|
| 38 | PointInterface $pos1, BoxInterface $box1, |
||
| 39 | PointInterface $pos2, BoxInterface $box2 |
||
| 40 | ) { |
||
| 41 | 3 | if ($pos1->getY() + $box1->getHeight() < $pos2->getY()) { |
|
| 42 | 2 | return false; |
|
| 43 | } |
||
| 44 | 3 | if ($pos1->getY() > $pos2->getY() + $box2->getHeight()) { |
|
| 45 | 2 | return false; |
|
| 46 | } |
||
| 47 | 3 | if ($pos1->getX() > $pos2->getX() + $box2->getWidth()) { |
|
| 48 | 1 | return false; |
|
| 49 | } |
||
| 50 | 3 | if ($pos1->getX() + $box1->getWidth() < $pos2->getX()) { |
|
| 51 | 1 | return false; |
|
| 52 | } |
||
| 53 | |||
| 54 | 3 | return true; |
|
| 55 | } |
||
| 56 | } |
||
| 57 |