Skip to content

Commit a0a1908

Browse files
committed
Fix composer.json to support PHP 8; fix code style
1 parent f7d5cb0 commit a0a1908

Some content is hidden

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

73 files changed

+205
-132
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
operating-system: [ubuntu-latest]
11-
php-versions: ['7.3', '7.4', '8.0']
11+
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0']
1212
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1313

1414
steps:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea
22
composer.lock
33
vendor
4+
.php_cs.cache
5+
.phpunit.result.cache

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
"type": "library",
66
"license": "MIT",
77
"require": {
8-
"php": "^7.3 | ^8.0",
9-
"ext-curl": "*"
8+
"php": ">=7.1.3",
9+
"ext-curl": "*",
10+
"ext-json": "*"
1011
},
1112
"autoload": {
1213
"psr-4": {"TransactPro\\Gateway\\": "src/Gateway"}
@@ -15,8 +16,8 @@
1516
"psr-4": {"TransactPro\\Gateway\\": "tests/Gateway"}
1617
},
1718
"require-dev": {
18-
"phpunit/phpunit": "^6.0",
19-
"jakub-onderka/php-parallel-lint": "^0.9.2",
19+
"phpunit/phpunit": "^6.0 | ^9.5",
20+
"php-parallel-lint/php-parallel-lint": "^1.3",
2021
"friendsofphp/php-cs-fixer": "^2.1"
2122
},
2223
"scripts": {

phpunit.xml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit bootstrap="tests/bootstrap.php" colors="true">
4-
<testsuites>
5-
<testsuite name="GW3 Test Suite">
6-
<directory>tests/Gateway/</directory>
7-
</testsuite>
8-
</testsuites>
9-
10-
<filter>
11-
<whitelist>
12-
<directory suffix=".php">src/Gateway/</directory>
13-
</whitelist>
14-
</filter>
15-
16-
<php>
17-
<ini name="date.timezone" value="UTC"/>
18-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/Gateway/</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="GW3 Test Suite">
10+
<directory>tests/Gateway/</directory>
11+
</testsuite>
12+
</testsuites>
13+
<php>
14+
<ini name="date.timezone" value="UTC"/>
15+
</php>
1916
</phpunit>

src/Gateway/DataSets/Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function setTerminalMID(string $terminalMID): self
6565
}
6666

6767
/**
68-
* @param int $cardVerificationMode
68+
* @param int $cardVerificationMode
6969
* @return Command
7070
*/
7171
public function setCardVerificationMode(int $cardVerificationMode): self
@@ -76,7 +76,7 @@ public function setCardVerificationMode(int $cardVerificationMode): self
7676
}
7777

7878
/**
79-
* @param int $paymentMethodDataSource
79+
* @param int $paymentMethodDataSource
8080
* @return Command
8181
*/
8282
public function setPaymentMethodDataSource(int $paymentMethodDataSource): self
@@ -87,7 +87,7 @@ public function setPaymentMethodDataSource(int $paymentMethodDataSource): self
8787
}
8888

8989
/**
90-
* @param string $paymentMethodDataToken
90+
* @param string $paymentMethodDataToken
9191
* @return Command
9292
*/
9393
public function setPaymentMethodDataToken(string $paymentMethodDataToken): self

src/Gateway/DataSets/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function setMerchantSideUrl(string $merchantSideURL): self
8888
}
8989

9090
/**
91-
* @param string $recipientName
91+
* @param string $recipientName
9292
*
9393
* @return Order
9494
*/

src/Gateway/DataSets/System.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function setBrowserAcceptHeader(string $browserAcceptHeader): self
5454
}
5555

5656
/**
57-
* @param bool $browserJavaEnabled
57+
* @param bool $browserJavaEnabled
5858
*
5959
* @return System
6060
*/
@@ -66,7 +66,7 @@ public function setBrowserJavaEnabled(bool $browserJavaEnabled): self
6666
}
6767

6868
/**
69-
* @param bool $browserJavaScriptEnabled
69+
* @param bool $browserJavaScriptEnabled
7070
*
7171
* @return System
7272
*/
@@ -78,7 +78,7 @@ public function setBrowserJavaScriptEnabled(bool $browserJavaScriptEnabled): sel
7878
}
7979

8080
/**
81-
* @param string $browserLanguage
81+
* @param string $browserLanguage
8282
*
8383
* @return System
8484
*/
@@ -90,7 +90,7 @@ public function setBrowserLanguage(string $browserLanguage): self
9090
}
9191

9292
/**
93-
* @param string $browserColorDepth
93+
* @param string $browserColorDepth
9494
*
9595
* @return System
9696
*/
@@ -102,7 +102,7 @@ public function setBrowserColorDepth(string $browserColorDepth): self
102102
}
103103

104104
/**
105-
* @param string $browserScreenHeight
105+
* @param string $browserScreenHeight
106106
*
107107
* @return System
108108
*/
@@ -114,7 +114,7 @@ public function setBrowserScreenHeight(string $browserScreenHeight): self
114114
}
115115

116116
/**
117-
* @param string $browserScreenWidth
117+
* @param string $browserScreenWidth
118118
*
119119
* @return System
120120
*/
@@ -126,7 +126,7 @@ public function setBrowserScreenWidth(string $browserScreenWidth): self
126126
}
127127

128128
/**
129-
* @param string $browserTZ
129+
* @param string $browserTZ
130130
*
131131
* @return System
132132
*/
@@ -138,7 +138,7 @@ public function setBrowserTZ(string $browserTZ): self
138138
}
139139

140140
/**
141-
* @param string $userAgent
141+
* @param string $userAgent
142142
*
143143
* @return System
144144
*/

src/Gateway/DataSets/Verify3dEnrollment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class Verify3dEnrollment extends DataSet implements DataSetInterface
2121
{
2222
/**
23-
* @param string $pan
23+
* @param string $pan
2424
*
2525
* @return self
2626
*/
@@ -32,7 +32,7 @@ public function setPAN(string $pan): self
3232
}
3333

3434
/**
35-
* @param string $terminalMID
35+
* @param string $terminalMID
3636
*
3737
* @return self
3838
*/
@@ -44,7 +44,7 @@ public function setTerminalMID(string $terminalMID): self
4444
}
4545

4646
/**
47-
* @param string $currency
47+
* @param string $currency
4848
*
4949
* @return self
5050
*/

src/Gateway/Exceptions/DigestMismatchException.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@
2121
*/
2222
class DigestMismatchException extends ResponseException
2323
{
24-
public function __construct($message = "Digest mismatch", $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); }
24+
public function __construct($message = "Digest mismatch", $code = 0, Throwable $previous = null)
25+
{
26+
parent::__construct($message, $code, $previous);
27+
}
2528
}

src/Gateway/Exceptions/DigestMissingException.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
*/
2121
class DigestMissingException extends ResponseException
2222
{
23-
public function __construct($message = "Digest is missing", $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); }
23+
public function __construct($message = "Digest is missing", $code = 0, Throwable $previous = null)
24+
{
25+
parent::__construct($message, $code, $previous);
26+
}
2427
}

0 commit comments

Comments
 (0)