Skip to content

Commit aef9f57

Browse files
SP-1167 - Add support for PHP 8.4
1 parent e54070e commit aef9f57

Some content is hidden

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

57 files changed

+1013
-808
lines changed

.github/workflows/documentation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Documentation
33
on:
44
push:
55
branches:
6-
- '*.*.x'
6+
- "*.*.x"
77

88
concurrency:
99
group: documentation
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Run phpdoc
1919
run: |
2020
docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 -d ./src -t ./docs
@@ -24,4 +24,4 @@ jobs:
2424
git config user.email ""
2525
git add docs/
2626
git commit -m "Update phpdoc" || echo "No changes to commit"
27-
git push
27+
git push

.github/workflows/test.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@ name: Test
33
on: [push, pull_request]
44

55
jobs:
6-
76
phpunit10:
87
runs-on: ubuntu-20.04
98

109
strategy:
1110
matrix:
12-
php-version: ['8.1', '8.2', '8.3']
11+
php-version: ["8.1", "8.2", "8.3", "8.4"]
1312

1413
steps:
15-
- uses: actions/checkout@v3
16-
- uses: php-actions/composer@v5
14+
- uses: actions/checkout@v4
15+
- uses: php-actions/composer@v6
1716
with:
1817
php_version: ${{ matrix.php-version }}
1918
args: --ignore-platform-reqs
20-
- uses: php-actions/phpunit@v3
19+
- uses: php-actions/phpunit@v4
2120
with:
2221
configuration: phpunit.xml
2322
php_version: ${{ matrix.php-version }}
@@ -31,12 +30,12 @@ jobs:
3130
runs-on: ubuntu-latest
3231

3332
steps:
34-
- uses: actions/checkout@v3
35-
- uses: php-actions/composer@v5
33+
- uses: actions/checkout@v4
34+
- uses: php-actions/composer@v6
3635
with:
3736
php_version: 8.1
3837
php_extensions: bcmath gmp xdebug
3938
- name: Install PHP_CodeSniffer
4039
run: |
4140
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
42-
php phpcs.phar src --standard=ruleset.xml
41+
php phpcs.phar src --standard=ruleset.xml

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
],
1313
"homepage": "https://github.com/bitpay/php-bitpay-client-v2",
1414
"require": {
15-
"php": "^8.1 || ^8.2 || ^8.3",
15+
"php": "^8.1 || ^8.2 || ^8.3 || ^8.4",
1616
"ext-json": "*",
1717
"ext-reflection": "*",
1818
"bitpay/key-utils": "^2.0",
1919
"guzzlehttp/guzzle": "^7.0",
20-
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
21-
"netresearch/jsonmapper": "^4.1",
20+
"symfony/yaml": "^6.0 || ^7.0",
21+
"netresearch/jsonmapper": "^5.0",
2222
"symfony/console": "^6.0"
2323
},
2424
"authors": [
@@ -28,7 +28,7 @@
2828
}
2929
],
3030
"require-dev": {
31-
"phpunit/phpunit": "^9.0 || ^10.2.2"
31+
"phpunit/phpunit": "^10.5.45 || ^11.5.7 || ^12.0.2"
3232
},
3333
"scripts": {
3434
"setup": [

composer.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup/ConfigGenerator.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function selectTokens(OutputInterface $output, mixed $helper, InputInterface $in
9090
$shouldGenerateMerchant = true;
9191
$shouldGeneratePayout = true;
9292
}
93-
93+
9494
return [$shouldGenerateMerchant, $shouldGeneratePayout];
9595
}
9696

@@ -144,6 +144,9 @@ function getPublicKey(string $privateKeyLocation, string $password): PublicKey {
144144
$storageEngine = new EncryptedFilesystemStorage($password);
145145
try {
146146
// Use the EncryptedFilesystemStorage to load the Merchant's encrypted private key with the Master Password.
147+
/**
148+
* @var PrivateKey
149+
*/
147150
$privateKey = $storageEngine->load($privateKeyLocation);
148151
} catch (\Exception $ex) {
149152
// Check if the loaded keys is a valid key
@@ -255,13 +258,13 @@ function getPayoutToken(
255258
->setHelp($help)
256259
->setCode(function (InputInterface $input, OutputInterface $output): int {
257260
$helper = $this->getHelper('question');
258-
261+
259262
try {
260263
$env = getEnv($output, $helper, $input);
261264
$apiUrl = $env === 'P' ? 'https://bitpay.com' : 'https://test.bitpay.com';
262265
$password = getPrivateKeyPassword($helper, $input, $output);
263266
$privateKeyLocation = getPrivateKeyLocation($helper, $input, $output);
264-
267+
265268
[$shouldGenerateMerchant, $shouldGeneratePayout] = selectTokens($output, $helper, $input);
266269
$publicKey = getPublicKey($privateKeyLocation, $password);
267270
$sin = getSin($publicKey);

src/BitPaySDK/Client.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ public function getInvoiceByGuid(
257257
public function getInvoices(
258258
string $dateStart,
259259
string $dateEnd,
260-
string $status = null,
261-
string $orderId = null,
262-
int $limit = null,
263-
int $offset = null
260+
?string $status = null,
261+
?string $orderId = null,
262+
?int $limit = null,
263+
?int $offset = null
264264
): array {
265265
$invoiceClient = $this->getInvoiceClient();
266266

@@ -581,7 +581,7 @@ public function getBill(string $billId, string $facade = Facade::MERCHANT, bool
581581
* @throws BitPayApiException
582582
* @throws BitPayGenericException
583583
*/
584-
public function getBills(string $status = null): array
584+
public function getBills(?string $status = null): array
585585
{
586586
$billClient = $this->getBillClient();
587587

@@ -762,7 +762,7 @@ public function getPayoutRecipient(string $recipientId): PayoutRecipient
762762
* @throws BitPayApiException
763763
* @throws BitPayGenericException
764764
*/
765-
public function getPayoutRecipients(string $status = null, int $limit = null, int $offset = null): array
765+
public function getPayoutRecipients(?string $status = null, ?int $limit = null, ?int $offset = null): array
766766
{
767767
$payoutRecipientsClient = $this->getPayoutRecipientsClient();
768768

@@ -874,12 +874,12 @@ public function getPayout(string $payoutId): Payout
874874
* @throws BitPayApiException
875875
*/
876876
public function getPayouts(
877-
string $startDate = null,
878-
string $endDate = null,
879-
string $status = null,
880-
string $reference = null,
881-
int $limit = null,
882-
int $offset = null
877+
?string $startDate = null,
878+
?string $endDate = null,
879+
?string $status = null,
880+
?string $reference = null,
881+
?int $limit = null,
882+
?int $offset = null
883883
): array {
884884
$payoutClient = $this->getPayoutClient();
885885

@@ -972,9 +972,9 @@ public function getSettlements(
972972
string $currency,
973973
string $dateStart,
974974
string $dateEnd,
975-
string $status = null,
976-
int $limit = null,
977-
int $offset = null
975+
?string $status = null,
976+
?int $limit = null,
977+
?int $offset = null
978978
): array {
979979
$settlementsClient = $this->getSettlementClient();
980980

src/BitPaySDK/Client/BillClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function get(string $billId, string $facade = Facade::MERCHANT, bool $sig
108108
* @throws BitPayApiException
109109
* @throws BitPayGenericException
110110
*/
111-
public function getBills(string $status = null): array
111+
public function getBills(?string $status = null): array
112112
{
113113
$params = [];
114114
$params["token"] = $this->tokenCache->getTokenByFacade(Facade::MERCHANT);

src/BitPaySDK/Client/InvoiceClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ public function getByGuid(
210210
public function getInvoices(
211211
string $dateStart,
212212
string $dateEnd,
213-
string $status = null,
214-
string $orderId = null,
215-
int $limit = null,
216-
int $offset = null
213+
?string $status = null,
214+
?string $orderId = null,
215+
?int $limit = null,
216+
?int $offset = null
217217
): array {
218218
$params = [];
219219
$params["token"] = $this->tokenCache->getTokenByFacade(Facade::MERCHANT);

src/BitPaySDK/Client/PayoutClient.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ public function get(string $payoutId): Payout
125125
* @throws BitPayGenericException
126126
*/
127127
public function getPayouts(
128-
string $startDate = null,
129-
string $endDate = null,
130-
string $status = null,
131-
string $reference = null,
132-
int $limit = null,
133-
int $offset = null
128+
?string $startDate = null,
129+
?string $endDate = null,
130+
?string $status = null,
131+
?string $reference = null,
132+
?int $limit = null,
133+
?int $offset = null
134134
): array {
135135
$params = [];
136136
$params["token"] = $this->tokenCache->getTokenByFacade(Facade::PAYOUT);

src/BitPaySDK/Client/PayoutRecipientsClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function get(string $recipientId): PayoutRecipient
121121
* @throws BitPayApiException
122122
* @throws BitPayGenericException
123123
*/
124-
public function getPayoutRecipients(string $status = null, int $limit = null, int $offset = null): array
124+
public function getPayoutRecipients(?string $status = null, ?int $limit = null, ?int $offset = null): array
125125
{
126126
$params = [];
127127
$params["token"] = $this->tokenCache->getTokenByFacade(Facade::PAYOUT);

0 commit comments

Comments
 (0)