Skip to content

Commit

Permalink
Fix static analysys
Browse files Browse the repository at this point in the history
  • Loading branch information
coldic3 committed Nov 4, 2024
1 parent 048ae1c commit 58ac9c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/DependencyInjection/CommerceWeaversSyliusTpayExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
1 change: 0 additions & 1 deletion src/Payum/Action/Api/BaseApiAwareAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
6 changes: 5 additions & 1 deletion src/Tpay/Provider/ValidTpayChannelListProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
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;
use Payum\Core\Security\CypherInterface;
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,
Expand Down

0 comments on commit 58ac9c5

Please sign in to comment.