public function getUsedLength(): int
    {
        $maxLength = 0;

        /** @var PackedItem $item */
        foreach ($this->items as $item) {
            $maxLength = max($maxLength, $item->getY() + $item->getLength());
        }

        return $maxLength;
    }
public function getUsedLength(): int
    {
        $maxLength = 0;

        /** @var PackedItem $item */
        foreach ($this->items as $item) {
            $maxLength = max($maxLength, $item->getY() + $item->getLength());
        }

        return $maxLength;
    }
public function getUsedLength ( ) : int { $ maxLength = 0 ; /** @var PackedItem $item */ foreach ( $ this -> items as $ item ) { $ maxLength = max ( $ maxLength , $ item -> getY ( ) + $ item -> getLength ( ) ) ; } return $ maxLength ; }
Used length inside box for packing items.

@return int
Used length inside box for packing items .