From 598d2b576c7fae13c1dc224462462a8e037c963f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Chru=C5=9Bciel?= Date: Wed, 11 Dec 2024 17:58:51 +0100 Subject: [PATCH] [Maintenance] Remove deprecation notice --- .../Resolver/TpayTransactionChannelResolver.php | 15 ++------------- .../Notification/Verifier/SignatureVerifier.php | 12 ++---------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/Tpay/Resolver/TpayTransactionChannelResolver.php b/src/Tpay/Resolver/TpayTransactionChannelResolver.php index ab145ba0..555cc513 100644 --- a/src/Tpay/Resolver/TpayTransactionChannelResolver.php +++ b/src/Tpay/Resolver/TpayTransactionChannelResolver.php @@ -6,8 +6,6 @@ use CommerceWeavers\SyliusTpayPlugin\PayByLinkPayment\Payum\Factory\GatewayFactory; use CommerceWeavers\SyliusTpayPlugin\PayByLinkPayment\Payum\Factory\GetTpayTransactionsChannelsFactoryInterface; -use CommerceWeavers\SyliusTpayPlugin\PayByLinkPayment\Payum\Request\GetTpayTransactionsChannels; -use Payum\Core\Model\ArrayObject; use Payum\Core\Payum; use Psr\Log\LoggerInterface; use Tpay\OpenApi\Utilities\TpayException; @@ -16,25 +14,16 @@ final class TpayTransactionChannelResolver implements TpayTransactionChannelReso { public function __construct( private readonly Payum $payum, - private readonly ?GetTpayTransactionsChannelsFactoryInterface $getTpayTransactionsChannelsFactory = null, + private readonly GetTpayTransactionsChannelsFactoryInterface $getTpayTransactionsChannelsFactory, private readonly ?LoggerInterface $logger = null, ) { - if (null === $this->getTpayTransactionsChannelsFactory) { - trigger_deprecation( - 'commerce-weavers/sylius-tpay-plugin', - '1.0', - 'Not passing a $getTpayTransactionsChannelsFactory to %s constructor is deprecated and will be removed in SyliusTpayPlugin 2.0.', - self::class, - ); - } } public function resolve(): array { $gateway = $this->payum->getGateway(GatewayFactory::NAME); - $value = $this->getTpayTransactionsChannelsFactory?->createNewEmpty() - ?? new GetTpayTransactionsChannels(new ArrayObject()); + $value = $this->getTpayTransactionsChannelsFactory->createNewEmpty(); try { $gateway->execute($value, true); diff --git a/src/Tpay/Security/Notification/Verifier/SignatureVerifier.php b/src/Tpay/Security/Notification/Verifier/SignatureVerifier.php index 9f3c4732..5ba44814 100644 --- a/src/Tpay/Security/Notification/Verifier/SignatureVerifier.php +++ b/src/Tpay/Security/Notification/Verifier/SignatureVerifier.php @@ -17,16 +17,8 @@ public function __construct( private readonly CertificateResolverInterface $certificateResolver, private readonly TrustedCertificateResolverInterface $trustedCertificateResolver, private readonly X509FactoryInterface $x509Factory, - private readonly ?ProductionModeCheckerInterface $productionModeChecker = null, + private readonly ProductionModeCheckerInterface $productionModeChecker, ) { - if (null === $this->productionModeChecker) { - trigger_deprecation( - 'commerce-weavers/sylius-tpay-plugin', - '1.0', - 'Not passing a $productionModeChecker to %s constructor is deprecated and will be removed in SyliusTpayPlugin 2.0.', - self::class, - ); - } } public function verify(string $jws, string $requestContent): bool @@ -52,7 +44,7 @@ public function verify(string $jws, string $requestContent): bool throw new InvalidSignatureException('Missing x5u header'); } - $production = $this->productionModeChecker?->isProduction($x5u) ?? false; + $production = $this->productionModeChecker->isProduction($x5u); $certificate = $this->certificateResolver->resolve($x5u); $trusted = $this->trustedCertificateResolver->resolve($production);