diff --git a/src/DependencyInjection/CommerceWeaversSyliusTpayExtension.php b/src/DependencyInjection/CommerceWeaversSyliusTpayExtension.php index 16b3b97a..ea1a7da1 100644 --- a/src/DependencyInjection/CommerceWeaversSyliusTpayExtension.php +++ b/src/DependencyInjection/CommerceWeaversSyliusTpayExtension.php @@ -110,8 +110,16 @@ private function getCurrentConfiguration(ContainerBuilder $container): array private function setUpTpayLogger(ContainerBuilder $container): void { - if ($container->hasParameter('kernel.logs_dir')) { - Logger::setLogPath(sprintf('%s/tpay_open_api_', $container->getParameter('kernel.logs_dir'))); + if (!$container->hasParameter('kernel.logs_dir')) { + return; + } + + $logsDir = $container->getParameter('kernel.logs_dir'); + + if (!is_string($logsDir)) { + return; } + + Logger::setLogPath(sprintf('%s/tpay_open_api_', $logsDir)); } } diff --git a/src/Payum/Action/Api/BaseApiAwareAction.php b/src/Payum/Action/Api/BaseApiAwareAction.php index 3ae72209..b77fe6b8 100644 --- a/src/Payum/Action/Api/BaseApiAwareAction.php +++ b/src/Payum/Action/Api/BaseApiAwareAction.php @@ -8,7 +8,6 @@ use Payum\Core\Action\ActionInterface; use Payum\Core\ApiAwareInterface; use Payum\Core\ApiAwareTrait; -use Tpay\OpenApi\Utilities\Logger; use Tpay\OpenApi\Utilities\TpayException; /** diff --git a/src/Tpay/Provider/ValidTpayChannelListProvider.php b/src/Tpay/Provider/ValidTpayChannelListProvider.php index 6d6d050f..652e7f57 100644 --- a/src/Tpay/Provider/ValidTpayChannelListProvider.php +++ b/src/Tpay/Provider/ValidTpayChannelListProvider.php @@ -5,6 +5,7 @@ namespace CommerceWeavers\SyliusTpayPlugin\Tpay\Provider; use CommerceWeavers\SyliusTpayPlugin\Payum\Exception\UnableToGetBankListException; +use CommerceWeavers\SyliusTpayPlugin\Repository\PaymentMethodRepositoryInterface; use CommerceWeavers\SyliusTpayPlugin\Tpay\PayGroup; use CommerceWeavers\SyliusTpayPlugin\Tpay\PaymentType; use Payum\Core\Security\CryptedInterface; @@ -12,11 +13,14 @@ use Sylius\Bundle\PayumBundle\Model\GatewayConfigInterface; use Sylius\Component\Channel\Context\ChannelContextInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; -use Sylius\Component\Core\Repository\PaymentMethodRepositoryInterface; +use Sylius\Component\Core\Repository\PaymentMethodRepositoryInterface as BasePaymentMethodRepositoryInterface; use Webmozart\Assert\Assert; final class ValidTpayChannelListProvider implements ValidTpayChannelListProviderInterface { + /** + * @param BasePaymentMethodRepositoryInterface&PaymentMethodRepositoryInterface $paymentMethodRepository + */ public function __construct( private readonly AvailableTpayChannelListProviderInterface $availableTpayApiBankListProvider, private readonly PaymentMethodRepositoryInterface $paymentMethodRepository,