public function getUsedWidth(): int
    {
        $maxWidth = 0;

        /** @var PackedItem $item */
        foreach ($this->items as $item) {
            $maxWidth = max($maxWidth, $item->getX() + $item->getWidth());
        }

        return $maxWidth;
    }
public function getUsedWidth(): int
    {
        $maxWidth = 0;

        /** @var PackedItem $item */
        foreach ($this->items as $item) {
            $maxWidth = max($maxWidth, $item->getX() + $item->getWidth());
        }

        return $maxWidth;
    }
public function getUsedWidth ( ) : int { $ maxWidth = 0 ; /** @var PackedItem $item */ foreach ( $ this -> items as $ item ) { $ maxWidth = max ( $ maxWidth , $ item -> getX ( ) + $ item -> getWidth ( ) ) ; } return $ maxWidth ; }
Used width inside box for packing items.

@return int
Used width inside box for packing items .