Skip to content

Commit

Permalink
Fix up signatures
Browse files Browse the repository at this point in the history
Also add phpunit dependency, add test target, and fix up phpunit.xml.dist.
  • Loading branch information
hexmode committed Apr 20, 2024
1 parent 7be38be commit 034f028
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : [
Expand All @@ -19,5 +20,8 @@
},
"autoload" : {
"classmap": [ "src/"]
},
"scripts" : {
"test": "phpunit"
}
}
10 changes: 0 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,10 @@
stopOnFailure="false"
processIsolation="false"
backupGlobals="false"
syntaxCheck="true"
>
<testsuites>
<testsuite name="Tests">
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
6 changes: 3 additions & 3 deletions src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -1223,9 +1223,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);
Expand Down Expand Up @@ -1727,7 +1727,7 @@ public function getAccessToken(): string
return $this->accessToken;
}

public function getRefreshToken(): string
public function getRefreshToken(): ?string
{
return $this->refreshToken;
}
Expand Down

0 comments on commit 034f028

Please sign in to comment.