Skip to content

Commit

Permalink
run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
nuryagdym committed May 24, 2024
1 parent b28558c commit 15cd83c
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 198 deletions.
6 changes: 3 additions & 3 deletions src/Gateways/KuveytPos.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ private function sendSoapRequest(array $contents, string $txType, string $url):
$contents['VPosMessage']['TransactionType'],
['parameters' => ['request' => $contents]]
);
} catch (SoapFault $throwable) {
} catch (SoapFault $soapFault) {
$this->logger->error('soap error response', [
'message' => $throwable->getMessage(),
'message' => $soapFault->getMessage(),
]);

throw $throwable;
throw $soapFault;
}

if (null === $result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,11 @@ public function testGet3DFormData(array $order, string $txType, string $paymentM

$this->dispatcher->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $paymentModel) {
return $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& AkbankPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3
;
}));
->with($this->callback(static fn($dispatchedEvent): bool => $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& AkbankPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3));

$actual = $this->requestDataMapper->create3DFormData(
$this->account,
Expand Down Expand Up @@ -213,14 +210,11 @@ public function testGet3DFormDataSubMerchant(): void

$this->dispatcher->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $paymentModel) {
return $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& AkbankPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3
;
}));
->with($this->callback(static fn($dispatchedEvent): bool => $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& AkbankPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3));

$actual = $this->requestDataMapper->create3DFormData(
$this->subMerchantAccount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,11 @@ public function testGet3DFormData(

$this->dispatcher->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $paymentModel) {
return $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& EstPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3
;
}));
->with($this->callback(static fn($dispatchedEvent): bool => $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& EstPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3));

$actual = $this->requestDataMapper->create3DFormData(
$this->account,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,11 @@ public function testGet3DFormData(

$this->dispatcher->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $paymentModel) {
return $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& EstV3Pos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3
;
}));
->with($this->callback(static fn($dispatchedEvent): bool => $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& EstV3Pos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3));

$actual = $this->requestDataMapper->create3DFormData(
$this->account,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,11 @@ public function testGet3DFormData(): void
$paymentModel = PosInterface::MODEL_3D_SECURE;
$this->dispatcher->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $paymentModel) {
return $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& GarantiPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3;
}));
->with($this->callback(static fn($dispatchedEvent): bool => $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& GarantiPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3));

$actual = $this->requestDataMapper->create3DFormData(
$this->account,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,11 @@ public function testGet3DFormData(

$this->dispatcher->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $paymentModel) {
return $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& InterPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3;
}));
->with($this->callback(static fn($dispatchedEvent): bool => $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& InterPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3));

$actual = $this->requestDataMapper->create3DFormData(
$this->account,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,11 @@ public function testGet3DFormData(

$this->dispatcher->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $paymentModel) {
return $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& PayForPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3;
}));
->with($this->callback(static fn($dispatchedEvent): bool => $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& PayForPos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3));

$actual = $this->requestDataMapper->create3DFormData(
$this->account,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,11 @@ public function testCreate3DFormData(array $order, string $txType, string $gatew
$paymentModel = PosInterface::MODEL_3D_SECURE;
$this->dispatcher->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $paymentModel) {
return $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& PosNetV1Pos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3;
}));
->with($this->callback(static fn($dispatchedEvent): bool => $dispatchedEvent instanceof Before3DFormHashCalculatedEvent
&& PosNetV1Pos::class === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
&& count($dispatchedEvent->getFormInputs()) > 3));

$actual = $this->requestDataMapper->create3DFormData(
$this->account,
Expand Down
15 changes: 6 additions & 9 deletions tests/Unit/Gateways/AkbankPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -903,14 +903,11 @@ private function configureClientResponse(

$this->eventDispatcherMock->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $requestData, $order, $paymentModel) {
return $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
;
}));
->with($this->callback(fn($dispatchedEvent): bool => $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()));
}
}
15 changes: 6 additions & 9 deletions tests/Unit/Gateways/EstPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -722,14 +722,11 @@ private function configureClientResponse(

$this->eventDispatcherMock->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $requestData, $order, $paymentModel) {
return $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
;
}));
->with($this->callback(fn($dispatchedEvent): bool => $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()));
}
}
15 changes: 6 additions & 9 deletions tests/Unit/Gateways/GarantiPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,14 +625,11 @@ private function configureClientResponse(

$this->eventDispatcherMock->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $requestData, $order, $paymentModel) {
return $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
;
}));
->with($this->callback(fn($dispatchedEvent): bool => $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()));
}
}
15 changes: 6 additions & 9 deletions tests/Unit/Gateways/InterPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,11 @@ private function configureClientResponse(

$this->eventDispatcherMock->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $requestData, $order, $paymentModel) {
return $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
;
}));
->with($this->callback(fn($dispatchedEvent): bool => $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()));
}
}
30 changes: 12 additions & 18 deletions tests/Unit/Gateways/KuveytPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,12 @@ public function testMake3DPayment(
$paymentModel = PosInterface::MODEL_3D_SECURE;
$this->eventDispatcherMock->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $create3DPaymentRequestData, $order, $paymentModel) {
return $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $create3DPaymentRequestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
;
}));
->with($this->callback(fn($dispatchedEvent): bool => $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $create3DPaymentRequestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()));

$this->serializerMock->expects(self::once())
->method('encode')
Expand Down Expand Up @@ -556,14 +553,11 @@ private function configureClientResponse(

$this->eventDispatcherMock->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $requestData, $order, $paymentModel) {
return $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
;
}));
->with($this->callback(fn($dispatchedEvent): bool => $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()));
}
}
15 changes: 6 additions & 9 deletions tests/Unit/Gateways/PayFlexCPV4PosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,11 @@ private function configureClientResponse(

$this->eventDispatcherMock->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $requestData, $order, $paymentModel) {
return $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
;
}));
->with($this->callback(fn($dispatchedEvent): bool => $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()));
}
}
15 changes: 6 additions & 9 deletions tests/Unit/Gateways/PayFlexV4PosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,14 +658,11 @@ private function configureClientResponse(

$this->eventDispatcherMock->expects(self::once())
->method('dispatch')
->with($this->callback(function ($dispatchedEvent) use ($txType, $requestData, $order, $paymentModel) {
return $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()
;
}));
->with($this->callback(fn($dispatchedEvent): bool => $dispatchedEvent instanceof RequestDataPreparedEvent
&& get_class($this->pos) === $dispatchedEvent->getGatewayClass()
&& $txType === $dispatchedEvent->getTxType()
&& $requestData === $dispatchedEvent->getRequestData()
&& $order === $dispatchedEvent->getOrder()
&& $paymentModel === $dispatchedEvent->getPaymentModel()));
}
}
Loading

0 comments on commit 15cd83c

Please sign in to comment.