Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SP-1167 - Add support for PHP 8.4 #42

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:

strategy:
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ["8.1", "8.2", "8.3", "8.4"]

steps:
- uses: actions/checkout@v4
- uses: php-actions/composer@v5
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-version }}
args: --ignore-platform-reqs
Expand All @@ -26,14 +26,14 @@ jobs:
XDEBUG_MODE: coverage
phpcs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: php-actions/composer@v5
- uses: php-actions/composer@v6
with:
php_version: 8.1
php_extensions: bcmath gmp xdebug
- name: Install PHP_CodeSniffer
run: |
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar src --standard=ruleset.xml
php phpcs.phar src --standard=ruleset.xml
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
},
"require": {
"php": "^8.1 || ^8.2 || ^8.3",
"php": "^8.1 || ^8.2 || ^8.3 || ^8.4",
"ext-bcmath": "*",
"ext-openssl": "*",
"ext-curl": "*",
Expand Down
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion examples.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

try {
// Use the EncryptedFilesystemStorage to load the Merchant's encrypted private key with the Master Password.
/**
* @var PrivateKey
*/
$privateKey = $storageEngine->load(__DIR__ . '/secure/SecurePathPlusYourClientName.key');
} catch (Exception $ex) {
// Check if the loaded keys is a valid key
Expand Down Expand Up @@ -86,4 +89,4 @@
**/
echo $resultData['data'][0]['pairingCode'];

/** End of request **/
/** End of request **/
5 changes: 5 additions & 0 deletions src/BitPayKeyUtils/KeyHelper/KeyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ public function generate();
* @return boolean
*/
public function isValid();

/**
* @return string
*/
public function getId();
}
2 changes: 1 addition & 1 deletion src/BitPayKeyUtils/KeyHelper/PublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getSin()
* @return PublicKey
* @throws Exception
*/
public function generate(PrivateKey $privateKey = null)
public function generate(?PrivateKey $privateKey = null)
{
if ($privateKey instanceof PrivateKey) {
$this->setPrivateKey($privateKey);
Expand Down
28 changes: 14 additions & 14 deletions src/BitPayKeyUtils/Math/BcEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public function __construct()
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
* @throws Exception
* @throws Exception
Expand Down Expand Up @@ -56,8 +56,8 @@ public function input($x)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return int
* @throws Exception
* @throws Exception
Expand All @@ -72,8 +72,8 @@ public function cmp($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string|null
* @throws Exception
* @throws Exception
Expand Down Expand Up @@ -136,8 +136,8 @@ public function invertm($num, $mod)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string|null
* @throws Exception
* @throws Exception
Expand All @@ -156,8 +156,8 @@ public function mod($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
* @throws Exception
* @throws Exception
Expand All @@ -172,8 +172,8 @@ public function mul($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
* @throws Exception
* @throws Exception
Expand All @@ -188,8 +188,8 @@ public function pow($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
* @throws Exception
* @throws Exception
Expand Down
32 changes: 16 additions & 16 deletions src/BitPayKeyUtils/Math/EngineInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,50 @@
interface EngineInterface
{
/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
*/
public function add($a, $b);

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
*/
public function cmp($a, $b);

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
*/
public function div($a, $b);

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
*/
public function invertm($a, $b);

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
*/
public function mod($a, $b);

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
*/
public function mul($a, $b);

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
*/
public function pow($a, $b);

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
*/
public function sub($a, $b);
}
32 changes: 16 additions & 16 deletions src/BitPayKeyUtils/Math/GmpEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
class GmpEngine implements EngineInterface
{
/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
*/
public function add($a, $b)
Expand All @@ -15,8 +15,8 @@ public function add($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
*/
public function cmp($a, $b)
Expand All @@ -25,8 +25,8 @@ public function cmp($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @param int $round
* @return string
*/
Expand All @@ -36,8 +36,8 @@ public function div($a, $b, $round = GMP_ROUND_ZERO)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
*/
public function invertm($a, $b)
Expand All @@ -46,8 +46,8 @@ public function invertm($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
*/
public function mod($a, $b)
Expand All @@ -56,8 +56,8 @@ public function mod($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
*/
public function mul($a, $b)
Expand All @@ -66,8 +66,8 @@ public function mul($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
*/
public function pow($a, $b)
Expand All @@ -76,8 +76,8 @@ public function pow($a, $b)
}

/**
* @param String $a Numeric String
* @param String $b Numeric String
* @param string $a Numeric String
* @param string $b Numeric String
* @return string
*/
public function sub($a, $b)
Expand Down
Loading