original_string: public function authenticateForScope($scopes)
    {
      if ($this->token && $this->tokenScopes == $scopes) {
        return $this->token;
      }
  
      $cacheKey = self::CACHE_PREFIX;
      if (is_string($scopes)) {
        $cacheKey .= $scopes;
      } else if (is_array($scopes)) {
        $cacheKey .= implode(":", $scopes);
      }
  
      $this->token = $this->client->getCache()->get($cacheKey);
      if (!$this->token) {
        $this->retrieveToken($scopes, $cacheKey);
      } else if ($this->token['expiration_time'] < time()) {
        $this->client->getCache()->delete($cacheKey);
        $this->retrieveToken($scopes, $cacheKey);
      }
  
      $this->tokenScopes = $scopes;
      return $this->token;
    }
code: public function authenticateForScope($scopes)
    {
      if ($this->token && $this->tokenScopes == $scopes) {
        return $this->token;
      }
  
      $cacheKey = self::CACHE_PREFIX;
      if (is_string($scopes)) {
        $cacheKey .= $scopes;
      } else if (is_array($scopes)) {
        $cacheKey .= implode(":", $scopes);
      }
  
      $this->token = $this->client->getCache()->get($cacheKey);
      if (!$this->token) {
        $this->retrieveToken($scopes, $cacheKey);
      } else if ($this->token['expiration_time'] < time()) {
        $this->client->getCache()->delete($cacheKey);
        $this->retrieveToken($scopes, $cacheKey);
      }
  
      $this->tokenScopes = $scopes;
      return $this->token;
    }
code_tokens: public function authenticateForScope ( $ scopes ) { if ( $ this -> token && $ this -> tokenScopes == $ scopes ) { return $ this -> token ; } $ cacheKey = self :: CACHE_PREFIX ; if ( is_string ( $ scopes ) ) { $ cacheKey .= $ scopes ; } else if ( is_array ( $ scopes ) ) { $ cacheKey .= implode ( ":" , $ scopes ) ; } $ this -> token = $ this -> client -> getCache ( ) -> get ( $ cacheKey ) ; if ( ! $ this -> token ) { $ this -> retrieveToken ( $ scopes , $ cacheKey ) ; } else if ( $ this -> token [ 'expiration_time' ] < time ( ) ) { $ this -> client -> getCache ( ) -> delete ( $ cacheKey ) ; $ this -> retrieveToken ( $ scopes , $ cacheKey ) ; } $ this -> tokenScopes = $ scopes ; return $ this -> token ; }
docstring: Retrieve an access token for the scopes supplied.
docstring_tokens: Retrieve an access token for the scopes supplied .