Skip to content

Commit

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

/**
* Get the token user's identifier.
*
* @return non-empty-string|int|null
*/
public function getUserIdentifier(): string|int|null;

Expand Down
4 changes: 2 additions & 2 deletions src/Entities/Traits/AccessTokenTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ abstract public function getClient(): ClientEntityInterface;
abstract public function getExpiryDateTime(): DateTimeImmutable;

/**
* @return non-empty-string|null
* @return non-empty-string|int|null
*/
abstract public function getUserIdentifier(): string|null;
abstract public function getUserIdentifier(): string|int|null;

/**
* @return ScopeEntityInterface[]
Expand Down
12 changes: 6 additions & 6 deletions src/Entities/Traits/TokenEntityTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ trait TokenEntityTrait
protected DateTimeImmutable $expiryDateTime;

/**
* @var non-empty-string|null
* @var non-empty-string|int|null
*/
protected string|null $userIdentifier = null;
protected string|int|null $userIdentifier = null;

protected ClientEntityInterface $client;

Expand Down Expand Up @@ -71,19 +71,19 @@ public function setExpiryDateTime(DateTimeImmutable $dateTime): void
/**
* Set the identifier of the user associated with the token.
*
* @param non-empty-string $identifier The identifier of the user
* @param int|non-empty-string $identifier The identifier of the user
*/
public function setUserIdentifier(string $identifier): void
public function setUserIdentifier(int|string $identifier): void
{
$this->userIdentifier = $identifier;
}

/**
* Get the token user's identifier.
*
* @return non-empty-string|null
* @return non-empty-string|int|null
*/
public function getUserIdentifier(): string|null
public function getUserIdentifier(): string|int|null
{
return $this->userIdentifier;
}
Expand Down

0 comments on commit bd459d7

Please sign in to comment.