From e576d40bd07b61b6f3d85b9b19673863f7165a9b Mon Sep 17 00:00:00 2001 From: Szymon Kostrubiec Date: Mon, 29 Jul 2024 07:35:59 +0200 Subject: [PATCH] OP-366 - Apply ECS fixes --- src/Controller/Shop/InitializePaymentController.php | 3 ++- src/DependencyInjection/BitBagSyliusImojeExtension.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Controller/Shop/InitializePaymentController.php b/src/Controller/Shop/InitializePaymentController.php index fbf4179..860343d 100644 --- a/src/Controller/Shop/InitializePaymentController.php +++ b/src/Controller/Shop/InitializePaymentController.php @@ -52,7 +52,7 @@ public function __construct( BlikModelProviderInterface $blikModelProvider, TransactionPaymentDataResolverInterface $transactionPaymentDataResolver, TranslatorInterface $translator, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->orderResolver = $orderResolver; $this->paymentResolver = $paymentResolver; @@ -123,6 +123,7 @@ private function getPaymentFromOrder(OrderInterface $order): PaymentInterface $payment = $this->paymentResolver->resolve($order); } catch (\InvalidArgumentException $e) { $this->logger->error($e->getMessage()); + throw new ImojeNotConfiguredException('Payment method not found'); } diff --git a/src/DependencyInjection/BitBagSyliusImojeExtension.php b/src/DependencyInjection/BitBagSyliusImojeExtension.php index 272fc6d..64d91f1 100644 --- a/src/DependencyInjection/BitBagSyliusImojeExtension.php +++ b/src/DependencyInjection/BitBagSyliusImojeExtension.php @@ -4,17 +4,18 @@ namespace BitBag\SyliusImojePlugin\DependencyInjection; +use Sylius\Bundle\CoreBundle\DependencyInjection\PrependDoctrineMigrationsTrait; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Sylius\Bundle\CoreBundle\DependencyInjection\PrependDoctrineMigrationsTrait; final class BitBagSyliusImojeExtension extends Extension implements PrependExtensionInterface { use PrependDoctrineMigrationsTrait; + public function load(array $configs, ContainerBuilder $container): void { $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));