Skip to content

Commit

Permalink
Be more explicit about array size
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Sep 24, 2016
1 parent 62c3bea commit fe1eed7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions VolumePacker.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,10 @@ protected function findBestOrientation(Item $item, OrientatedItem $prevItem = nu
/** @var OrientatedItem $orientation */
foreach ($orientations as $o => $orientation) {
$orientationFit = min($widthLeft - $orientation->getWidth(), $lengthLeft - $orientation->getLength());

$orientationFits[$o] = $orientationFit;
}

if ($orientationFits) {
if (!empty($orientationFits)) {
asort($orientationFits);
reset($orientationFits);
$bestFit = key($orientationFits);
Expand Down

0 comments on commit fe1eed7

Please sign in to comment.