Skip to content

Commit

Permalink
KuveytPos style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nuryagdym committed Mar 27, 2024
1 parent c83709a commit fd78dc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Crypt/KuveytPosCrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function create3DHash(AbstractPosAccount $posAccount, array $requestData)
$hashedPassword,
];

$hashStr = implode(static::HASH_SEPARATOR, $hashData);
$hashStr = \implode(static::HASH_SEPARATOR, $hashData);

return $this->hashString($hashStr);
}
Expand Down Expand Up @@ -62,7 +62,7 @@ public function createHash(AbstractPosAccount $posAccount, array $requestData):
$hashedPassword,
];

$hashStr = implode(static::HASH_SEPARATOR, $hashData);
$hashStr = \implode(static::HASH_SEPARATOR, $hashData);

return $this->hashString($hashStr);
}
Expand Down
11 changes: 4 additions & 7 deletions src/Serializer/KuveytPosSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Serializer;
use Throwable;
use function in_array;
use function sprintf;
use function strip_tags;

class KuveytPosSerializer implements SerializerInterface
{
Expand Down Expand Up @@ -57,10 +54,10 @@ public static function supports(string $gatewayClass): bool
public function encode(array $data, string $txType)
{
if (PosInterface::TX_TYPE_HISTORY === $txType || PosInterface::TX_TYPE_ORDER_HISTORY === $txType) {
throw new DomainException(sprintf('Serialization of the transaction %s is not supported', $txType));
throw new DomainException(\sprintf('Serialization of the transaction %s is not supported', $txType));
}

if (in_array($txType, $this->nonPaymentTransactions, true)) {
if (\in_array($txType, $this->nonPaymentTransactions, true)) {
return $data;
}

Expand All @@ -72,7 +69,7 @@ public function encode(array $data, string $txType)
*/
public function decode(string $data, string $txType): array
{
if (in_array($txType, $this->nonPaymentTransactions, true)) {
if (\in_array($txType, $this->nonPaymentTransactions, true)) {
return $this->serializer->decode($data, JsonEncoder::FORMAT);
}

Expand All @@ -95,7 +92,7 @@ public function decode(string $data, string $txType): array
*/
private function isHTML(string $str): bool
{
return $str !== strip_tags($str);
return $str !== \strip_tags($str);
}

/**
Expand Down

0 comments on commit fd78dc2

Please sign in to comment.