Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapayev committed Oct 12, 2024
1 parent bb16c75 commit 42ef350
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ public function mapTxType($txType): ?string
}

/**
* @param string|int $txType
* @param string|int $securityType
*
* @return PosInterface::MODEL_*|null
*/
public function mapSecurityType($txType): ?string
public function mapSecurityType($securityType): ?string
{
return $this->secureTypeMappings[$txType] ?? null;
return $this->secureTypeMappings[$securityType] ?? null;
}


Expand Down
3 changes: 1 addition & 2 deletions src/Serializer/EstPosSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Mews\Pos\Gateways\EstV3Pos;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Serializer;
use function in_array;

class EstPosSerializer implements SerializerInterface
{
Expand All @@ -30,7 +29,7 @@ public function __construct()
*/
public static function supports(string $gatewayClass): bool
{
return in_array($gatewayClass, [EstPos::class, EstV3Pos::class]);
return \in_array($gatewayClass, [EstPos::class, EstV3Pos::class]);
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/Serializer/InterPosSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

use Mews\Pos\Gateways\InterPos;
use Symfony\Component\Serializer\Exception\NotEncodableValueException;
use function explode;
use function preg_split;

class InterPosSerializer implements SerializerInterface
{
Expand Down Expand Up @@ -36,14 +34,14 @@ public function encode(array $data, ?string $txType = null): array
public function decode(string $data, ?string $txType = null): array
{
//genelde ;; delimiter kullanilmis, ama bazen arasinda ;;; boyle delimiter de var.
$resultValues = preg_split('/(;;;|;;)/', $data);
$resultValues = \preg_split('/(;;;|;;)/', $data);
if (false === $resultValues) {
throw new NotEncodableValueException();
}

$result = [];
foreach ($resultValues as $val) {
[$key, $value] = explode('=', $val);
[$key, $value] = \explode('=', $val);
$result[$key] = $value;
}

Expand Down

0 comments on commit 42ef350

Please sign in to comment.