| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | 11 | public function getFootprint(): int |
|
| 51 | { |
||
| 52 | 11 | $layerWidth = 0; |
|
| 53 | 11 | $layerLength = 0; |
|
| 54 | |||
| 55 | 11 | foreach ($this->items as $item) { |
|
| 56 | 11 | $layerWidth = max($layerWidth, $item->getX() + $item->getWidth()); |
|
| 57 | 11 | $layerLength = max($layerLength, $item->getY() + $item->getLength()); |
|
| 58 | } |
||
| 59 | |||
| 60 | 11 | return $layerWidth * $layerLength; |
|
| 61 | } |
||
| 62 | |||
| 95 |