Skip to content

Commit

Permalink
fix: method signatures after 1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 committed Sep 5, 2024
1 parent 1a468a4 commit a9ff2bf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -1221,10 +1221,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|null
*/
protected function decodeJWT(string $jwt, int $section = 0): stdClass {

protected function decodeJWT(string $jwt, int $section = 0) {
$parts = explode('.', $jwt);
return json_decode(base64url_decode($parts[$section]), false);
}
Expand Down Expand Up @@ -1725,7 +1724,10 @@ public function getAccessToken(): string
return $this->accessToken;
}

public function getRefreshToken(): string
/**
* @return string|null
*/
public function getRefreshToken()
{
return $this->refreshToken;
}
Expand Down
19 changes: 16 additions & 3 deletions tests/OpenIDConnectClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@

class OpenIDConnectClientTest extends TestCase
{
/**
* @return void
*/
public function testJWTDecode()
{
$client = new OpenIDConnectClient();
$client->setAccessToken('');
$header = $client->getAccessTokenHeader();
self::assertEquals('', $header);
}

public function testGetNullRefreshToken()
{
$client = new OpenIDConnectClient();
$client->setAccessToken('');
$token = $client->getRefreshToken();
self::assertEquals('', $token);
}

public function testGetRedirectURL()
{
$client = new OpenIDConnectClient();
Expand Down

0 comments on commit a9ff2bf

Please sign in to comment.