Skip to content

Commit bea16d9

Browse files
committed
php: Bump minimum version to 8.0
Officially supported versions are currently 8.1 - 8.4.
1 parent 93ac9eb commit bea16d9

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
}
1414
],
1515
"require": {
16-
"php": ">=5.6.0",
16+
"php": "^8.0",
1717
"ext-json": "*"
18-
},
18+
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^5.7",
20+
"phpunit/phpunit": "^11.0",
2121
"friendsofphp/php-cs-fixer": "^3.0",
22-
"phpstan/phpstan": "^0.12.89"
22+
"phpstan/phpstan": "^2.0"
2323
},
2424
"autoload": {
2525
"psr-4": {

php/src/Exception/WebhookSigningException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class WebhookSigningException extends \Exception
66
{
7-
public function __construct($message, $code = 0, \Throwable $previous = null)
7+
public function __construct($message, $code = 0, ?\Throwable $previous = null)
88
{
99
parent::__construct($message, $code, $previous);
1010
}

php/src/Exception/WebhookVerificationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class WebhookVerificationException extends \Exception
66
{
7-
public function __construct($message, $code = 0, \Throwable $previous = null)
7+
public function __construct($message, $code = 0, ?\Throwable $previous = null)
88
{
99
parent::__construct($message, $code, $previous);
1010
}

php/src/Webhook.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function verify($payload, $headers)
4646
}
4747

4848

49-
$timestamp = self::verifyTimestamp($msgTimestamp);
49+
$timestamp = $this->verifyTimestamp($msgTimestamp);
5050

5151
$signature = $this->sign($msgId, $timestamp, $payload);
5252
$expectedSignature = explode(',', $signature, 2)[1];
@@ -70,7 +70,7 @@ public function verify($payload, $headers)
7070

7171
public function sign($msgId, $timestamp, $payload)
7272
{
73-
if (!self::isPositiveInteger($timestamp)) {
73+
if (!$this->isPositiveInteger($timestamp)) {
7474
throw new Exception\WebhookSigningException("Invalid timestamp");
7575
}
7676
$toSign = "{$msgId}.{$timestamp}.{$payload}";

0 commit comments

Comments
 (0)