/**
* Returns the method's calculator instance
*
* @param ShippingMethodInterface $shippingMethod
*
* @return \WellCommerce\Bundle\ShippingBundle\Calculator\ShippingMethodCalculatorInterface
*/
protected function getCalculator(ShippingMethodInterface $shippingMethod)
{
$calculator = $shippingMethod->getCalculator();
if (!$this->shippingMethodCalculatorCollection->has($calculator)) {
throw new CalculatorNotFoundException($calculator);
}
return $this->shippingMethodCalculatorCollection->get($calculator);
}