You are here

public static function TokenAuthenticationBase::intervalInSeconds in RESTful 7.2

Process callback helper to get the time difference in seconds.

Parameters

int $value: The expiration timestamp in the access token.

Return value

int Number of seconds before expiration.

File

modules/restful_token_auth/src/Plugin/resource/TokenAuthenticationBase.php, line 56
Contains Drupal\restful_token_auth\Plugin\resource\TokenAuthenticationBase.

Class

TokenAuthenticationBase

Namespace

Drupal\restful_token_auth\Plugin\resource

Code

public static function intervalInSeconds($value) {
  $interval = $value - time();
  return $interval < 0 ? 0 : $interval;
}