Skip to content

Commit

Permalink
Change method signatures for ClientId to accept ints
Browse files Browse the repository at this point in the history
  • Loading branch information
Sephster committed Apr 14, 2024
1 parent bd459d7 commit 39d3cd3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Entities/TokenInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public function setExpiryDateTime(DateTimeImmutable $dateTime): void;
/**
* Set the identifier of the user associated with the token.
*
* @param int|non-empty-string $identifier
* @param non-empty-string|int $identifier
*/
public function setUserIdentifier(int|string $identifier): void;
public function setUserIdentifier(string|int $identifier): void;

/**
* Get the token user's identifier.
Expand Down
2 changes: 1 addition & 1 deletion src/Grant/AbstractGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected function validateClient(ServerRequestInterface $request): ClientEntity
* getClientEntity might return null. By contrast, this method will
* always either return a ClientEntityInterface or throw.
*/
protected function getClientEntityOrFail(string $clientId, ServerRequestInterface $request): ClientEntityInterface
protected function getClientEntityOrFail(string|int $clientId, ServerRequestInterface $request): ClientEntityInterface
{
$client = $this->clientRepository->getClientEntity($clientId);

Expand Down
2 changes: 1 addition & 1 deletion src/Repositories/AccessTokenRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface AccessTokenRepositoryInterface extends RepositoryInterface
public function getNewToken(
ClientEntityInterface $clientEntity,
array $scopes,
mixed $userIdentifier = null
string|int|null $userIdentifier = null
): AccessTokenEntityInterface;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Repositories/ClientRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ interface ClientRepositoryInterface extends RepositoryInterface
/**
* Get a client.
*/
public function getClientEntity(string $clientIdentifier): ?ClientEntityInterface;
public function getClientEntity(string|int $clientIdentifier): ?ClientEntityInterface;

/**
* Validate a client's secret.
*/
public function validateClient(string $clientIdentifier, ?string $clientSecret, ?string $grantType): bool;
public function validateClient(string|int $clientIdentifier, ?string $clientSecret, ?string $grantType): bool;
}

0 comments on commit 39d3cd3

Please sign in to comment.