diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d04ea35..5cd5e5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,11 @@ jobs: strategy: matrix: operating-system: ['ubuntu-latest'] - php-versions: ['8.1'] + php-versions: ['8.1', '8.2', '8.3'] phpunit-versions: ['latest'] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/composer.json b/composer.json index 69fea3c..06ce517 100644 --- a/composer.json +++ b/composer.json @@ -27,10 +27,10 @@ "paragonie/constant_time_encoding": ">= 2.6", "paragonie/corner": "^2", "paragonie/easy-ecc": "^1", - "paragonie/sodium_compat": "^1.17" + "paragonie/sodium_compat": "^1|^2" }, "require-dev": { - "phpunit/phpunit": "^9|^10", + "phpunit/phpunit": "^9", "vimeo/psalm": "^4|^5" }, "scripts": { diff --git a/src/Keys/Version3/SymmetricKey.php b/src/Keys/Version3/SymmetricKey.php index f634ea3..cc55e1f 100644 --- a/src/Keys/Version3/SymmetricKey.php +++ b/src/Keys/Version3/SymmetricKey.php @@ -21,6 +21,6 @@ class SymmetricKey extends BaseSymmetricKey public function __construct( string $keyMaterial ) { - return parent::__construct($keyMaterial, new Version3()); + parent::__construct($keyMaterial, new Version3()); } } diff --git a/src/Keys/Version4/SymmetricKey.php b/src/Keys/Version4/SymmetricKey.php index 04e1b3f..f1847d6 100644 --- a/src/Keys/Version4/SymmetricKey.php +++ b/src/Keys/Version4/SymmetricKey.php @@ -19,6 +19,6 @@ class SymmetricKey extends BaseSymmetricKey public function __construct( string $keyMaterial ) { - return parent::__construct($keyMaterial, new Version4()); + parent::__construct($keyMaterial, new Version4()); } } diff --git a/src/Rules/FooterJSON.php b/src/Rules/FooterJSON.php index d0c4e3c..4ec57f1 100644 --- a/src/Rules/FooterJSON.php +++ b/src/Rules/FooterJSON.php @@ -100,6 +100,7 @@ public function isValid(JsonToken $token): bool /** @var array|bool|null $decoded */ $decoded = json_decode($json, true, $this->maxDepth); + /** @psalm-suppress RiskyTruthyFalsyComparison */ if (!$decoded) { $this->rejectReason = json_last_error_msg(); } diff --git a/src/Util.php b/src/Util.php index 2f26b6b..4c58cea 100644 --- a/src/Util.php +++ b/src/Util.php @@ -55,12 +55,14 @@ public static function calculateJsonDepth(string $json): int $previous = ''; $depth = 1; + /** @psalm-suppress RiskyTruthyFalsyComparison */ while (!empty($stripped) && $stripped !== $previous) { $previous = $stripped; // Remove pairs of tokens $stripped = str_replace(['[]', '{}'], [], $stripped); ++$depth; } + /** @psalm-suppress RiskyTruthyFalsyComparison */ if (!empty($stripped)) { throw new EncodingException( 'Invalid JSON string provided', diff --git a/tests/ExceptionHelpfulTest.php b/tests/ExceptionHelpfulTest.php index d3a72e7..b521b8d 100644 --- a/tests/ExceptionHelpfulTest.php +++ b/tests/ExceptionHelpfulTest.php @@ -19,7 +19,7 @@ private function generateException(int $code): void throw new PasetoException('Test', $code); } - public function codeProvider(): array + public static function codeProvider(): array { return [ [ExceptionCode::BAD_VERSION],