public function oauth_authenticate($force_login = NULL, $screen_name = NULL, $type = 'authenticate')
  {
    if (! in_array($type, ['authenticate', 'authorize'])) {
      throw new \Exception('To get the ' . $type . ' URL, use the correct third parameter, or omit it.');
    }
    if ($this->_oauth_token === null) {
      throw new CodebirdCredentialsException('To get the ' . $type . ' URL, the OAuth token must be set.');
    }
    $url = self::$_endpoints['oauth'] . 'oauth/' . $type . '?oauth_token=' . $this->_url($this->_oauth_token);
    if ($force_login) {
      $url .= "&force_login=1";
    }
    if ($screen_name) {
      $url .= "&screen_name=" . $screen_name;
    }
    return $url;
  }
public function oauth_authenticate($force_login = NULL, $screen_name = NULL, $type = 'authenticate')
  {
    if (! in_array($type, ['authenticate', 'authorize'])) {
      throw new \Exception('To get the ' . $type . ' URL, use the correct third parameter, or omit it.');
    }
    if ($this->_oauth_token === null) {
      throw new CodebirdCredentialsException('To get the ' . $type . ' URL, the OAuth token must be set.');
    }
    $url = self::$_endpoints['oauth'] . 'oauth/' . $type . '?oauth_token=' . $this->_url($this->_oauth_token);
    if ($force_login) {
      $url .= "&force_login=1";
    }
    if ($screen_name) {
      $url .= "&screen_name=" . $screen_name;
    }
    return $url;
  }
public function oauth_authenticate ( $ force_login = NULL , $ screen_name = NULL , $ type = 'authenticate' ) { if ( ! in_array ( $ type , [ 'authenticate' , 'authorize' ] ) ) { throw new \ Exception ( 'To get the ' . $ type . ' URL, use the correct third parameter, or omit it.' ) ; } if ( $ this -> _oauth_token === null ) { throw new CodebirdCredentialsException ( 'To get the ' . $ type . ' URL, the OAuth token must be set.' ) ; } $ url = self :: $ _endpoints [ 'oauth' ] . 'oauth/' . $ type . '?oauth_token=' . $ this -> _url ( $ this -> _oauth_token ) ; if ( $ force_login ) { $ url .= "&force_login=1" ; } if ( $ screen_name ) { $ url .= "&screen_name=" . $ screen_name ; } return $ url ; }
Gets the OAuth authenticate URL for the current request token

@param optional bool   $force_login Whether to force the user to enter their login data
@param optional string $screen_name Screen name to repopulate the user name with
@param optional string $type        'authenticate' or 'authorize', to avoid duplicate code

@return string The OAuth authenticate/authorize URL
@throws \Exception
Gets the OAuth authenticate URL for the current request token