Skip to content

Commit 24f83e4

Browse files
committed
style: run rector
1 parent 7a7c588 commit 24f83e4

File tree

67 files changed

+136
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+136
-68
lines changed

src/DataMapper/RequestDataMapper/AbstractRequestDataMapper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
abstract class AbstractRequestDataMapper implements RequestDataMapperInterface
1818
{
1919
protected EventDispatcherInterface $eventDispatcher;
20+
2021
protected RequestValueMapperInterface $valueMapper;
22+
2123
protected RequestValueFormatterInterface $valueFormatter;
24+
2225
protected CryptInterface $crypt;
2326

2427
protected bool $testMode = false;

src/DataMapper/RequestValueFormatter/GarantiPosRequestValueFormatter.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ public function formatCardExpDate(\DateTimeInterface $expDate, string $fieldName
5757
*/
5858
public function formatDateTime(\DateTimeInterface $dateTime, string $fieldName = null, string $txType = null): string
5959
{
60-
if (PosInterface::TX_TYPE_HISTORY === $txType && ('StartDate' === $fieldName || 'EndDate' === $fieldName)) {
61-
return $dateTime->format('d/m/Y H:i');
62-
}
63-
6460
return $dateTime->format('d/m/Y H:i');
6561
}
6662
}

src/DataMapper/RequestValueFormatter/ToslaPosRequestValueFormatter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function formatDateTime(\DateTimeInterface $dateTime, string $fieldName =
5353
if ('timeSpan' === $fieldName) {
5454
return $dateTime->format('YmdHis');
5555
}
56+
5657
if ('transactionDate' === $fieldName) {
5758
return $dateTime->format('Ymd');
5859
}

src/DataMapper/RequestValueMapper/AbstractRequestValueMapper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function getSecureTypeMappings(): array
8484
*/
8585
public function mapSecureType(string $paymentModel): string
8686
{
87-
if (0 === count($this->secureTypeMappings)) {
87+
if ([] === $this->secureTypeMappings) {
8888
throw new \LogicException('Security type mappings are not supported.');
8989
}
9090

@@ -120,7 +120,7 @@ public function getRecurringOrderFrequencyMappings(): array
120120
*/
121121
public function mapRecurringFrequency(string $period): string
122122
{
123-
if (0 === count($this->recurringOrderFrequencyMappings)) {
123+
if ([] === $this->recurringOrderFrequencyMappings) {
124124
throw new \LogicException('Recurring frequency mappings are not supported.');
125125
}
126126

@@ -132,7 +132,7 @@ public function mapRecurringFrequency(string $period): string
132132
*/
133133
public function mapLang(string $lang): string
134134
{
135-
if (0 === count($this->langMappings)) {
135+
if ([] === $this->langMappings) {
136136
throw new \LogicException('Language mappings are not supported.');
137137
}
138138

@@ -160,7 +160,7 @@ public function getCardTypeMappings(): array
160160
*/
161161
public function mapCardType(string $cardType): string
162162
{
163-
if (0 === count($this->cardTypeMappings)) {
163+
if ([] === $this->cardTypeMappings) {
164164
throw new \LogicException('Card type mappings are not supported.');
165165
}
166166

src/DataMapper/ResponseDataMapper/GarantiPosResponseDataMapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ private function mapSingleOrderHistoryTransaction(array $rawTx): array
516516
if (null !== $transTime) {
517517
$defaultResponse['transaction_time'] = $this->valueFormatter->formatDateTime($transTime, $txType);
518518
}
519+
519520
$defaultResponse['capture_time'] = null !== $rawTx['AuthDate'] ? $this->valueFormatter->formatDateTime($rawTx['AuthDate'], $txType) : null;
520521
$amount = $rawTx['AuthAmount'];
521522
$defaultResponse['capture_amount'] = null !== $amount ? $this->valueFormatter->formatAmount($amount, $txType) : null;

src/DataMapper/ResponseValueFormatter/GarantiPosResponseValueFormatter.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ public function formatInstallment(?string $installment, string $txType): int
1717
return 0;
1818
}
1919

20-
if (PosInterface::TX_TYPE_HISTORY === $txType) {
21-
// history response
22-
if ('Pesin' === $installment || '1' === $installment) {
23-
return 0;
24-
}
20+
// history response
21+
if (PosInterface::TX_TYPE_HISTORY === $txType && ('Pesin' === $installment || '1' === $installment)) {
22+
return 0;
2523
}
2624

2725
return parent::formatInstallment($installment, $txType);

src/DataMapper/ResponseValueMapper/AbstractResponseValueMapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function __construct(
3838
if ([] !== $txTypeMappings) {
3939
$this->txTypeMappings = $txTypeMappings;
4040
}
41+
4142
if ([] !== $secureTypeMappings) {
4243
$this->secureTypeMappings = \array_flip($secureTypeMappings);
4344
}

tests/Unit/DataMapper/RequestDataMapper/AkbankPosRequestDataMapperTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ class AkbankPosRequestDataMapperTest extends TestCase
4141
private array $order;
4242

4343
private EventDispatcherInterface $dispatcher;
44+
4445
private AkbankPosRequestValueFormatter $valueFormatter;
46+
4547
private AkbankPosRequestValueMapper $valueMapper;
4648

4749
protected function setUp(): void

tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class EstPosRequestDataMapperTest extends TestCase
3838

3939
/** @var EventDispatcherInterface & MockObject */
4040
private EventDispatcherInterface $dispatcher;
41+
4142
private EstPosRequestValueFormatter $valueFormatter;
43+
4244
private EstPosRequestValueMapper $valueMapper;
4345

4446
protected function setUp(): void

tests/Unit/DataMapper/RequestDataMapper/EstV3PosRequestDataMapperTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ class EstV3PosRequestDataMapperTest extends TestCase
3737

3838
/** @var EventDispatcherInterface & MockObject */
3939
private EventDispatcherInterface $dispatcher;
40+
4041
private EstPosRequestValueFormatter $valueFormatter;
42+
4143
private EstPosRequestValueMapper $valueMapper;
44+
4245
protected function setUp(): void
4346
{
4447
parent::setUp();

0 commit comments

Comments
 (0)