Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"require": {
"php": ">=8.1",
"jumbojett/openid-connect-php": "^1.0.0",
"jumbojett/openid-connect-php": "^1.0.2",
"guzzlehttp/guzzle": "^7.5",
"web-token/jwt-library": "^3.4"
},
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ parameters:
paths:
- src
level: 8
excludePaths:
- src/BaseOpenIDConnectClient.php
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
10 changes: 3 additions & 7 deletions src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ class OpenIDConnectClient extends \Jumbojett\OpenIDConnectClient
{
protected ?JweDecryptInterface $jweDecrypter;
protected ?OpenIDConfiguration $openIDConfiguration;
/**
* @var int|null Response code from the server
*/
protected ?int $responseCode;

/**
* @var string|null Content type from the server
*/
private ?string $responseContentType;
private ?string $internalResponseContentType = null;

public function __construct(
?string $providerUrl = null,
Expand Down Expand Up @@ -199,7 +195,7 @@ protected function fetchURL(string $url, string $post_body = null, array $header
}

$this->responseCode = $request->status();
$this->responseContentType = $request->header('Content-Type');
$this->internalResponseContentType = $request->header('Content-Type');

if ($request->failed()) {
throw new OpenIDConnectClientException(
Expand Down Expand Up @@ -227,7 +223,7 @@ public function getResponseCode(): int
*/
public function getResponseContentType(): ?string
{
return $this->responseContentType;
return $this->internalResponseContentType;
}

public function setTlsVerify(bool|string $tlsVerify): void
Expand Down
5 changes: 1 addition & 4 deletions src/Services/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ protected function default400Response(OpenIDConnectClientException $exception):

protected function getRequest(): ?Request
{
/** @psalm-var Request $request */
$request = request();
if (!($request instanceof Request)) {
return null;
}

return $request;
}
}
Loading