private function getCostCollection(OrderInterface $order) : Collection
    {
        if ($order->hasShippingMethod()) {
            $costs = $this->getCurrentShippingMethodCostsCollection($order);
            if ($costs->count() > 0) {
                return $costs;
            }
        }
        
        return $this->getShippingCostCollection($order);
    }
private function getCostCollection(OrderInterface $order) : Collection
    {
        if ($order->hasShippingMethod()) {
            $costs = $this->getCurrentShippingMethodCostsCollection($order);
            if ($costs->count() > 0) {
                return $costs;
            }
        }
        
        return $this->getShippingCostCollection($order);
    }
private function getCostCollection ( OrderInterface $ order ) : Collection { if ( $ order -> hasShippingMethod ( ) ) { $ costs = $ this -> getCurrentShippingMethodCostsCollection ( $ order ) ; if ( $ costs -> count ( ) > 0 ) { return $ costs ; } } return $ this -> getShippingCostCollection ( $ order ) ; }
Returns the costs collection for existing shipping method or all shipping methods if current method is not longer available

@param OrderInterface $order

@return Collection
Returns the costs collection for existing shipping method or all shipping methods if current method is not longer available