Client
in package
Class Client
Tags
Table of Contents
- $authorized : bool
- $cache : Cache
- $client : Client
- $fluent : Fluent
- $strict : bool
- __call() : false|mixed
- __construct() : mixed
- Client constructor.
- getCache() : Cache
- Get the cache object
- getClient() : Client
- getFluent() : Fluent
- isAuthorized() : bool
- isStrict() : bool
- request() : bool|Collection|Item|null
- Request to Flarum the specified resource
- setStrict() : Client
- getHeaders() : array<string|int, string>
- Get request headers
- getVariablesForMethod() : array<string|int, mixed>|array<string|int, array<string|int, mixed>>
- Get body variables
Properties
$authorized
protected
bool
$authorized
= false
$cache
protected
static Cache
$cache
$client
protected
Client
$client
$fluent
protected
Fluent
$fluent
$strict
protected
bool
$strict
= true
Methods
__call()
public
__call(string $name, mixed $arguments) : false|mixed
Parameters
- $name : string
- $arguments : mixed
Tags
Return values
false|mixed —__construct()
Client constructor.
public
__construct(string $host[, array<string|int, mixed> $authorization = [] ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $host : string
-
Full FQDN hostname to your Flarum forum, eg http://example.com/forum
- $authorization : array<string|int, mixed> = []
-
Holding either "token" or "username" and "password" as keys.
- $options : array<string|int, mixed> = []
-
Custom options for the HTTP Client
Return values
mixed —getCache()
Get the cache object
public
static getCache() : Cache
Return values
Cache —getClient()
public
getClient() : Client
Return values
Client —getFluent()
public
getFluent() : Fluent
Return values
Fluent —isAuthorized()
public
isAuthorized() : bool
Return values
bool —isStrict()
public
isStrict() : bool
Return values
bool —request()
Request to Flarum the specified resource
public
request() : bool|Collection|Item|null
Tags
Return values
bool|Collection|Item|null —setStrict()
public
setStrict(bool $strict) : Client
Parameters
- $strict : bool
Return values
Client —getHeaders()
Get request headers
protected
getHeaders([array<string|int, mixed> $authorization = [] ]) : array<string|int, string>
Parameters
- $authorization : array<string|int, mixed> = []
Return values
array<string|int, string> —getVariablesForMethod()
Get body variables
protected
getVariablesForMethod() : array<string|int, mixed>|array<string|int, array<string|int, mixed>>