/**
  * Returns whether or not the grant supports the client
  *
  * @param Client $client
  *
  * @return bool
  */
 public function supports(Client $client)
 {
     $isAllowed = in_array("refresh_token", $client->getAllowedGrantTypes());
     if (!$isAllowed) {
         return false;
     }
     $refreshToken = $this->getLatestRefreshToken($client);
     return $refreshToken !== null && !$refreshToken->isExpired();
 }
 /**
  * @inheritdoc
  */
 public function supports(Client $client)
 {
     return in_array("client_credentials", $client->getAllowedGrantTypes());
 }