PHP Класс Webiny\Component\TwitterOAuth\Bridge\League\TwitterOAuth

Наследование: implements Webiny\Component\TwitterOAuth\Bridge\TwitterOAuthInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$accessToken
$clientId string OAuth2 Client ID.
$clientSecret string Client secret for defined Client ID.

Открытые методы

Метод Описание
__construct ( string $clientId, string $clientSecret, string $redirectUri ) Base constructor.
delete ( string $url, array $headers = [], array $params = [] ) : string | array Make a DELETE request to Twitter API.
get ( string $url, array $headers = [], array $params = [] ) : string | array Make a GET request to Twitter API.
getAccessToken ( ) : Array | boolean Returns the current access token.
getAuthorizeUrl ( string | array $requestToken ) : string Get the authorize url.
getClientId ( ) : string Get client id.
getClientSecret ( ) : string Get client secret.
getRedirectUri ( ) : string Get redirect uri.
getRequestToken ( ) : array Get the request token (temporary credentials).
getUserDetails ( ) : TwitterOAuthUser Returns an instance of TwitterOAuthUser.
post ( string $url, array $postBody, array $headers = [], array $params = [] ) : string | array Make a POST request to Twitter API.
requestAccessToken ( string $requestToken, string $requestTokenSecret, string $oauthToken, string $oauthTokenVerifier ) : array[oauth_token, Once we have token, we can run the authorization which than give us the option to request the access token.
setAccessToken ( array $accessToken ) : void Sets the access token.

Описание методов

__construct() публичный Метод

Base constructor.
public __construct ( string $clientId, string $clientSecret, string $redirectUri )
$clientId string Client id.
$clientSecret string Client secret.
$redirectUri string Target url where to redirect after authentication.

delete() публичный Метод

Make a DELETE request to Twitter API.
public delete ( string $url, array $headers = [], array $params = [] ) : string | array
$url string Api url.
$headers array Request headers.
$params array Additional parameters.
Результат string | array Api response (if json) it will be returned as array.

get() публичный Метод

Make a GET request to Twitter API.
public get ( string $url, array $headers = [], array $params = [] ) : string | array
$url string Api url.
$headers array Request headers.
$params array Additional parameters.
Результат string | array Api response (if json) it will be returned as array.

getAccessToken() публичный Метод

Returns the current access token.
public getAccessToken ( ) : Array | boolean
Результат Array | boolean False is returned if the access token is not set.

getAuthorizeUrl() публичный Метод

Get the authorize url.
public getAuthorizeUrl ( string | array $requestToken ) : string
$requestToken string | array Request token returned by Twitter OAuth server.
Результат string

getClientId() публичный Метод

Get client id.
public getClientId ( ) : string
Результат string Client id.

getClientSecret() публичный Метод

Get client secret.
public getClientSecret ( ) : string
Результат string Client secret.

getRedirectUri() публичный Метод

Get redirect uri.
public getRedirectUri ( ) : string
Результат string Redirect uri.

getRequestToken() публичный Метод

Get the request token (temporary credentials).
public getRequestToken ( ) : array
Результат array Request token [oauth_token, oauth_token_secret].

getUserDetails() публичный Метод

Returns an instance of TwitterOAuthUser.
public getUserDetails ( ) : TwitterOAuthUser
Результат Webiny\Component\TwitterOAuth\TwitterOAuthUser

post() публичный Метод

Make a POST request to Twitter API.
public post ( string $url, array $postBody, array $headers = [], array $params = [] ) : string | array
$url string Api url.
$postBody array Post body.
$headers array Request headers.
$params array Additional parameters.
Результат string | array Api response (if json) it will be returned as array.

requestAccessToken() публичный Метод

Once we have token, we can run the authorization which than give us the option to request the access token.
public requestAccessToken ( string $requestToken, string $requestTokenSecret, string $oauthToken, string $oauthTokenVerifier ) : array[oauth_token,
$requestToken string Request token returned by getRequestToken method.
$requestTokenSecret string Request token secret returned by getRequestToken method.
$oauthToken string OAuth token returned by Twitter OAuth server.
$oauthTokenVerifier string OAuth token verifier returned by Twitter OAuth server.
Результат array[oauth_token,

setAccessToken() публичный Метод

Should throw an exception if it's unable to set the access token.
public setAccessToken ( array $accessToken ) : void
$accessToken array Array[oauth_token, oauth_token_secret]
Результат void

Описание свойств

$accessToken защищенное свойство

protected $accessToken

$clientId защищенное свойство

OAuth2 Client ID.
protected string $clientId
Результат string

$clientSecret защищенное свойство

Client secret for defined Client ID.
protected string $clientSecret
Результат string