PHP Трейт SimpleSoftwareIO\SMS\MakesRequests

Показать файл Открыть проект

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

Свойство Тип Описание
$auth array Holds the username and password for requests.
$body array Holds the arguments for the body.
$callBuilt boolean Has the call been built yet

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

Метод Описание
buildBody ( array | string $values, null $key = null ) Builds the body part of the request and adds it to the body array.
setPassword ( string $password ) Sets the password for auth.
setUser ( string $username ) Sets the username for auth.

Защищенные методы

Метод Описание
buildCall ( $url ) Builds the API call address.
buildUrl ( array $segments = [] ) : string Builds a URL.
getAuth ( ) : array | null Returns the auth array for requests. If not set, will return null.
getBody ( ) : array Returns the body array.
getRequest ( ) : mixed Creates and sends a GET request to the requested URL.
postRequest ( ) : mixed Creates and sends a POST request to the requested URL.

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

buildBody() публичный метод

Builds the body part of the request and adds it to the body array.
public buildBody ( array | string $values, null $key = null )
$values array | string
$key null

buildCall() защищенный метод

Builds the API call address.
protected buildCall ( $url )
$url

buildUrl() защищенный метод

Builds a URL.
protected buildUrl ( array $segments = [] ) : string
$segments array
Результат string

getAuth() защищенный метод

Returns the auth array for requests. If not set, will return null.
protected getAuth ( ) : array | null
Результат array | null

getBody() защищенный метод

Returns the body array.
protected getBody ( ) : array
Результат array

getRequest() защищенный метод

Creates and sends a GET request to the requested URL.
protected getRequest ( ) : mixed
Результат mixed

postRequest() защищенный метод

Creates and sends a POST request to the requested URL.
protected postRequest ( ) : mixed
Результат mixed

setPassword() публичный метод

Sets the password for auth.
public setPassword ( string $password )
$password string

setUser() публичный метод

Sets the username for auth.
public setUser ( string $username )
$username string

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

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

Holds the username and password for requests.
protected array $auth
Результат array

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

Holds the arguments for the body.
protected array $body
Результат array

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

Has the call been built yet
protected bool $callBuilt
Результат boolean