Skip to content

Commit

Permalink
Removed type casts from Parsed get claim methods as they are unnecess…
Browse files Browse the repository at this point in the history
…ary.
  • Loading branch information
RobDWaller committed Jan 9, 2022
1 parent 44791f3 commit 66005c5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Parsed.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@ public function getHeader(): array
*/
public function getAlgorithm(): string
{
return (string) $this->getHeaderClaim('alg');
return $this->getHeaderClaim('alg');
}

/**
* Access the type claim from the header.
*/
public function getType(): string
{
return (string) $this->getHeaderClaim('typ');
return $this->getHeaderClaim('typ');
}

/**
* Access the content type claim from the header.
*/
public function getContentType(): string
{
return (string) $this->getHeaderClaim('cty');
return $this->getHeaderClaim('cty');
}

/**
Expand All @@ -123,15 +123,15 @@ public function getPayload(): array
*/
public function getIssuer(): string
{
return (string) $this->getPayloadClaim('iss');
return $this->getPayloadClaim('iss');
}

/**
* Access the subject claim from the payload.
*/
public function getSubject(): string
{
return (string) $this->getPayloadClaim('sub');
return $this->getPayloadClaim('sub');
}

/**
Expand All @@ -149,7 +149,7 @@ public function getAudience(): string|array
*/
public function getExpiration(): int
{
return (int) $this->getPayloadClaim('exp');
return $this->getPayloadClaim('exp');
}

/**
Expand All @@ -166,7 +166,7 @@ public function getExpiresIn(): int
*/
public function getNotBefore(): int
{
return (int) $this->getPayloadClaim('nbf');
return $this->getPayloadClaim('nbf');
}

/**
Expand All @@ -184,15 +184,15 @@ public function getUsableIn(): int
*/
public function getIssuedAt(): int
{
return (int) $this->getPayloadClaim('iat');
return $this->getPayloadClaim('iat');
}

/**
* Access the JWT Id claim from the payload.
*/
public function getJwtId(): string
{
return (string) $this->getPayloadClaim('jti');
return $this->getPayloadClaim('jti');
}

/**
Expand Down

0 comments on commit 66005c5

Please sign in to comment.