From 7d20c5e4c4e52cd86b5104550a2002f460641127 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Fri, 19 Apr 2024 21:47:13 -0400 Subject: [PATCH 1/3] Fix up signatures Also add phpunit dependency, add test target, and fix up phpunit.xml.dist. --- composer.json | 6 +++++- phpunit.xml.dist | 10 ---------- src/OpenIDConnectClient.php | 6 +++--- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 3fa6d231..8c09c503 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ }, "require-dev": { "roave/security-advisories": "dev-latest", - "yoast/phpunit-polyfills": "^1.0" + "yoast/phpunit-polyfills": "^1.0", + "phpunit/phpunit": "^9.6" }, "archive" : { "exclude" : [ @@ -19,5 +20,8 @@ }, "autoload" : { "classmap": [ "src/"] + }, + "scripts" : { + "test": "phpunit" } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index df8ef259..ce4a62c6 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,20 +9,10 @@ stopOnFailure="false" processIsolation="false" backupGlobals="false" - syntaxCheck="true" > ./tests - - - ./src - - ./vendor - ./tests - - - diff --git a/src/OpenIDConnectClient.php b/src/OpenIDConnectClient.php index abb37d8e..37b84886 100644 --- a/src/OpenIDConnectClient.php +++ b/src/OpenIDConnectClient.php @@ -1224,9 +1224,9 @@ protected function urlEncode(string $str): string /** * @param string $jwt encoded JWT * @param int $section the section we would like to decode - * @return object + * @return ?object */ - protected function decodeJWT(string $jwt, int $section = 0): stdClass { + protected function decodeJWT(string $jwt, int $section = 0): ?stdClass { $parts = explode('.', $jwt); return json_decode(base64url_decode($parts[$section]), false); @@ -1728,7 +1728,7 @@ public function getAccessToken(): string return $this->accessToken; } - public function getRefreshToken(): string + public function getRefreshToken(): ?string { return $this->refreshToken; } From 96b357813b7a84c8068ed6389bf50fd6e9a805f1 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Fri, 19 Apr 2024 22:23:15 -0400 Subject: [PATCH 2/3] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93149158..7834a82b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). [unreleased] + +### Fixed +- Return types are too strict. #412 - Updated CI to also test on PHP 8.3 #407 - Updated readme PHP requirement to PHP 7.0+ #407 - Added dependabot for GitHub Actions #407 From 9cbee4506a122b322c0411c63458966454c932df Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Mon, 22 Apr 2024 10:33:47 -0400 Subject: [PATCH 3/3] remove phpunit dep --- composer.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 8c09c503..3fa6d231 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,7 @@ }, "require-dev": { "roave/security-advisories": "dev-latest", - "yoast/phpunit-polyfills": "^1.0", - "phpunit/phpunit": "^9.6" + "yoast/phpunit-polyfills": "^1.0" }, "archive" : { "exclude" : [ @@ -20,8 +19,5 @@ }, "autoload" : { "classmap": [ "src/"] - }, - "scripts" : { - "test": "phpunit" } }