Skip to content

Commit bc12c0f

Browse files
Merge pull request #45 from minvws/fix-remove-override-props
fix: remove overloaded properties of OpenIDConnectClient
2 parents d18a2b3 + 04c504d commit bc12c0f

File tree

7 files changed

+381
-90
lines changed

7 files changed

+381
-90
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"require": {
3333
"php": ">=8.1",
34-
"jumbojett/openid-connect-php": "^1.0.0",
34+
"jumbojett/openid-connect-php": "^1.0.2",
3535
"guzzlehttp/guzzle": "^7.5",
3636
"illuminate/contracts": "^10.0||^11.0",
3737
"web-token/jwt-library": "^3.4"

phpstan.neon

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ parameters:
22
paths:
33
- src
44
level: 8
5-
excludePaths:
6-
- src/BaseOpenIDConnectClient.php
75
includes:
86
- phar://phpstan.phar/conf/bleedingEdge.neon

src/OpenIDConnectClient.php

+3-7
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@ class OpenIDConnectClient extends \Jumbojett\OpenIDConnectClient
2020
{
2121
protected ?JweDecryptInterface $jweDecrypter;
2222
protected ?OpenIDConfiguration $openIDConfiguration;
23-
/**
24-
* @var int|null Response code from the server
25-
*/
26-
protected ?int $responseCode;
2723

2824
/**
2925
* @var string|null Content type from the server
3026
*/
31-
private ?string $responseContentType;
27+
private ?string $internalResponseContentType = null;
3228

3329
public function __construct(
3430
?string $providerUrl = null,
@@ -199,7 +195,7 @@ protected function fetchURL(string $url, string $post_body = null, array $header
199195
}
200196

201197
$this->responseCode = $request->status();
202-
$this->responseContentType = $request->header('Content-Type');
198+
$this->internalResponseContentType = $request->header('Content-Type');
203199

204200
if ($request->failed()) {
205201
throw new OpenIDConnectClientException(
@@ -227,7 +223,7 @@ public function getResponseCode(): int
227223
*/
228224
public function getResponseContentType(): ?string
229225
{
230-
return $this->responseContentType;
226+
return $this->internalResponseContentType;
231227
}
232228

233229
public function setTlsVerify(bool|string $tlsVerify): void

src/Services/ExceptionHandler.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,8 @@ protected function default400Response(OpenIDConnectClientException $exception):
103103

104104
protected function getRequest(): ?Request
105105
{
106+
/** @psalm-var Request $request */
106107
$request = request();
107-
if (!($request instanceof Request)) {
108-
return null;
109-
}
110-
111108
return $request;
112109
}
113110
}

0 commit comments

Comments
 (0)