diff --git a/.gitignore b/.gitignore index d04695f..ae60653 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ vendor .idea *.iml clover.xml +.phpunit.result.cache \ No newline at end of file diff --git a/composer.json b/composer.json index 70ab64a..90349db 100755 --- a/composer.json +++ b/composer.json @@ -7,15 +7,15 @@ "Apple Jwt" ], "require": { - "php": ">=5.6", - "guzzlehttp/guzzle": "~6.5", - "firebase/php-jwt": "~5.2", + "php": ">=8.1", + "guzzlehttp/guzzle": "~7.15.2", + "firebase/php-jwt": "~7.1.0", "ext-json": "*", "ext-openssl": "*" }, "require-dev": { "mockery/mockery": "1.3.1", - "phpunit/phpunit": "5.7.27" + "phpunit/phpunit": "8.5.50" }, "autoload": { "psr-4": { diff --git a/src/Client.php b/src/Client.php index 92765c4..ecf9139 100644 --- a/src/Client.php +++ b/src/Client.php @@ -7,6 +7,7 @@ use Exception; use Firebase\JWT\JWK; use Firebase\JWT\JWT; +use Firebase\JWT\Key; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\RequestOptions; @@ -47,7 +48,7 @@ public function __construct(ClientInterface $httpClient, Config $config) public function verifyAndDecodeJwt($jwtToken) { return new JwtVerifyResponse( - JWT::decode($jwtToken, $this->getApplePublicKey(), ['RS256']) + JWT::decode($jwtToken, $this->getApplePublicKey()) ); } diff --git a/test/ClientTest.php b/test/ClientTest.php index a8197d1..3ab1fb9 100644 --- a/test/ClientTest.php +++ b/test/ClientTest.php @@ -13,13 +13,10 @@ class ClientTest extends m\Adapter\Phpunit\MockeryTestCase { - /** @var string */ - private $appleJwk; + private string|false $appleJwk; + private string|false $appleJwt; - /** @var string */ - private $appleJwt; - - protected function setUp() + protected function setUp(): void { $this->appleJwk = file_get_contents(__DIR__ . '/data/appleJwk.json'); $this->appleJwt = file_get_contents(__DIR__ . '/data/appleJwt'); diff --git a/test/Response/JwtVerifyResponseTest.php b/test/Response/JwtVerifyResponseTest.php index 0fda81c..b890429 100644 --- a/test/Response/JwtVerifyResponseTest.php +++ b/test/Response/JwtVerifyResponseTest.php @@ -9,9 +9,9 @@ class JwtVerifyResponseTest extends MockeryTestCase { /** @var stdClass */ - private $appleJwt; + private mixed $appleJwt; - protected function setUp() + protected function setUp(): void { $this->appleJwt = json_decode(file_get_contents(__DIR__ . '/../data/appleJwtDecoded.json')); parent::setUp();