Skip to content

Commit 88d3d50

Browse files
committed
Swap if statements to avoid unnecessary checks once the $gatewayConfig is null
1 parent 6c83561 commit 88d3d50

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Api/Factory/NextCommand/PayByRedirectFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ public function supports(Pay $command, PaymentInterface $payment): bool
4141

4242
$gatewayConfig = $this->getGatewayConfig($payment);
4343

44-
if ($gatewayConfig instanceof CryptedInterface) {
45-
$gatewayConfig->decrypt($this->cypher);
46-
}
47-
4844
if (null === $gatewayConfig) {
4945
return false;
5046
}
5147

48+
if ($gatewayConfig instanceof CryptedInterface) {
49+
$gatewayConfig->decrypt($this->cypher);
50+
}
51+
5252
$config = $gatewayConfig->getConfig();
5353

5454
return isset($config['type']) && $config['type'] === 'redirect';

0 commit comments

Comments
 (0)