/** * @param \Generated\Shared\Transfer\DiscountTransfer $discountTransfer * * @throws \Spryker\Zed\Discount\Business\Exception\CalculatorException * * @return \Spryker\Zed\Discount\Dependency\Plugin\DiscountCalculatorPluginInterface */ protected function getCalculatorPlugin(DiscountTransfer $discountTransfer) { if (!isset($this->calculatorPlugins[$discountTransfer->getCalculatorPlugin()])) { throw new CalculatorException(sprintf('Calculator plugin with name "%s" not found. Did you forget to register it in "%s"::getAvailableCalculatorPlugins', $discountTransfer->getCalculatorPlugin(), DiscountDependencyProvider::class)); } return $this->calculatorPlugins[$discountTransfer->getCalculatorPlugin()]; }