Skip to content

Commit 414357e

Browse files
committed
Issue #415: Increased PHPStan level to 8
Signed-off-by: alexmerlin <[email protected]>
1 parent 8e495aa commit 414357e

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/Core/src/Security/src/Entity/OAuthAccessToken.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,17 @@ private function convertToJWT(): Token
233233
throw new RuntimeException('Unable to convert to JWT without config');
234234
}
235235

236+
/** @var non-empty-string $audiences */
237+
$audiences = $this->getClient()->getIdentifier();
238+
/** @var non-empty-string $subject */
239+
$subject = (string) $this->getUserIdentifier();
236240
return $this->jwtConfiguration->builder()
237-
->permittedFor($this->getClient()->getIdentifier())
241+
->permittedFor($audiences)
238242
->identifiedBy($this->getIdentifier())
239243
->issuedAt(new DateTimeImmutable())
240244
->canOnlyBeUsedAfter(new DateTimeImmutable())
241245
->expiresAt($this->getExpiryDateTime())
242-
->relatedTo((string) $this->getUserIdentifier())
246+
->relatedTo($subject)
243247
->withClaim('scopes', $this->getScopes())
244248
->getToken($this->jwtConfiguration->signer(), $this->jwtConfiguration->signingKey());
245249
}

src/Core/src/Security/src/Entity/OAuthClient.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class OAuthClient implements ClientEntityInterface
2525
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'uuid', nullable: true)]
2626
private ?User $user = null;
2727

28-
/** @var non-empty-string $name */
2928
#[ORM\Column(name: 'name', type: 'string', length: 40)]
3029
private string $name;
3130

@@ -70,27 +69,18 @@ public function getIdentity(): string
7069
return $this->getName();
7170
}
7271

73-
/**
74-
* @return non-empty-string
75-
*/
7672
public function getIdentifier(): string
7773
{
7874
return $this->getName();
7975
}
8076

81-
/**
82-
* @param non-empty-string $name
83-
*/
8477
public function setName(string $name): self
8578
{
8679
$this->name = $name;
8780

8881
return $this;
8982
}
9083

91-
/**
92-
* @return non-empty-string
93-
*/
9484
public function getName(): string
9585
{
9686
return $this->name;

0 commit comments

Comments
 (0)