original_string: public function authenticate($code = null)
      {
          if (null === $code) {
              if (isset($_GET['code'])) {
                  $code = $_GET['code'];
              }
          }
  
          $url = 'https://oauth.vk.com/access_token?' . http_build_query(array(
                  'client_id' => $this->getClientId(),
                  'client_secret' => $this->getClientSecret(),
                  'code' => $code,
                  'redirect_uri' => $this->getRedirectUri(),
              ));
  
          $token = $this->curl($url);
          $decodedToken = json_decode($token, true);
          $decodedToken['created'] = time(); // add access token created unix timestamp to array
  
          $this->setAccessToken($decodedToken);
  
          return $this;
      }
code: public function authenticate($code = null)
      {
          if (null === $code) {
              if (isset($_GET['code'])) {
                  $code = $_GET['code'];
              }
          }
  
          $url = 'https://oauth.vk.com/access_token?' . http_build_query(array(
                  'client_id' => $this->getClientId(),
                  'client_secret' => $this->getClientSecret(),
                  'code' => $code,
                  'redirect_uri' => $this->getRedirectUri(),
              ));
  
          $token = $this->curl($url);
          $decodedToken = json_decode($token, true);
          $decodedToken['created'] = time(); // add access token created unix timestamp to array
  
          $this->setAccessToken($decodedToken);
  
          return $this;
      }
code_tokens: public function authenticate ( $ code = null ) { if ( null === $ code ) { if ( isset ( $ _GET [ 'code' ] ) ) { $ code = $ _GET [ 'code' ] ; } } $ url = 'https://oauth.vk.com/access_token?' . http_build_query ( array ( 'client_id' => $ this -> getClientId ( ) , 'client_secret' => $ this -> getClientSecret ( ) , 'code' => $ code , 'redirect_uri' => $ this -> getRedirectUri ( ) , ) ) ; $ token = $ this -> curl ( $ url ) ; $ decodedToken = json_decode ( $ token , true ) ; $ decodedToken [ 'created' ] = time ( ) ; // add access token created unix timestamp to array $ this -> setAccessToken ( $ decodedToken ) ; return $ this ; }
docstring: Authenticate user and get access token from server
  
  @param string $code
  
  @return $this
docstring_tokens: Authenticate user and get access token from server