You are here

public function JsonWebToken::setClaim in JSON Web Token Authentication (JWT) 8

Same name and namespace in other branches
  1. 8.0 src/JsonWebToken/JsonWebToken.php \Drupal\jwt\JsonWebToken\JsonWebToken::setClaim()

Add or update the given claim with the given value.

Parameters

mixed $claim: Either a string or indexed array of strings representing the claim or nested claim to be set.

mixed $value: A serializable value to set the given claim to on the JWT.

Overrides JsonWebTokenInterface::setClaim

File

src/JsonWebToken/JsonWebToken.php, line 48

Class

JsonWebToken
Class JsonWebToken.

Namespace

Drupal\jwt\JsonWebToken

Code

public function setClaim($claim, $value) {
  $payload = $this->payload;
  $this
    ->internalSetClaim($payload, $claim, $value);
  $this->payload = $payload;
}