A command to be sent to the Matrix server.
More...
|
| __construct (protected matrix_client $client, string $method, string $endpoint, protected array $params=[], protected array $query=[], protected bool $ignorehttperrors=false, protected bool $requireauthorization=true, protected bool $sendasjson=true,) |
| Create a new Command.
|
|
| get_all_params () |
| Get all parameters, including those set in the URL.
|
|
| get_options () |
| Get the Guzzle options to pass into the request.
|
|
| get_remaining_params () |
| Get the parameters provided to the command which are not used in the URL.
|
|
| require_authorization () |
| Whether authorization is required.
|
|
| should_ignore_http_errors () |
| Whether to ignore http errors on the response.
|
|
| should_send_params_as_json () |
| Whether to send remaining parameters as JSON.
|
|
|
| get_url (string $endpoint) |
| Get the URL of the endpoint on the server.
|
|
|
array array null bool bool bool array array null array | $remainingparams = [] |
| $command The raw command data
|
|
A command to be sent to the Matrix server.
This class is a wrapper around the PSR-7 Request Interface implementation provided by Guzzle.
It takes a set of common parameters and configurations and turns them into a Request that can be called against a live server.
- Copyright
- Andrew Nicols andre.nosp@m.w@ni.nosp@m.cols..nosp@m.co.u.nosp@m.k
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
communication_matrix\local\command::__construct |
( |
protected matrix_client | $client, |
|
|
string | $method, |
|
|
string | $endpoint, |
|
|
protected array | $params = [], |
|
|
protected array | $query = [], |
|
|
protected bool | $ignorehttperrors = false, |
|
|
protected bool | $requireauthorization = true, |
|
|
protected bool | $sendasjson = true ) |
Create a new Command.
- Parameters
-
matrix_client | $client | The URL for this method |
string | $method | (GET|POST|PUT|DELETE) |
string | $endpoint | The URL |
array | $params | Any parameters to pass |
array | $query | Any query parameters to set on the URL |
bool | $ignorehttperrors | Whether to ignore HTTP Errors |
bool | $requireauthorization | Whether authorization is required for this request |
bool | $sendasjson | Whether to send params as JSON |
◆ get_all_params()
communication_matrix\local\command::get_all_params |
( |
| ) |
|
Get all parameters, including those set in the URL.
- Return values
-
◆ get_options()
communication_matrix\local\command::get_options |
( |
| ) |
|
Get the Guzzle options to pass into the request.
- Return values
-
◆ get_remaining_params()
communication_matrix\local\command::get_remaining_params |
( |
| ) |
|
Get the parameters provided to the command which are not used in the URL.
These are typically passed to the server as query or body parameters instead.
- Return values
-
◆ get_url()
communication_matrix\local\command::get_url |
( |
string | $endpoint | ) |
|
|
protected |
Get the URL of the endpoint on the server.
- Parameters
-
- Return values
-
◆ require_authorization()
communication_matrix\local\command::require_authorization |
( |
| ) |
|
Whether authorization is required.
Based on the 'authorization' attribute set in a raw command.
- Return values
-
◆ should_ignore_http_errors()
communication_matrix\local\command::should_ignore_http_errors |
( |
| ) |
|
Whether to ignore http errors on the response.
Based on the 'ignore_http_errors' attribute set in a raw command.
- Return values
-
◆ should_send_params_as_json()
communication_matrix\local\command::should_send_params_as_json |
( |
| ) |
|
Whether to send remaining parameters as JSON.
- Return values
-
◆ $remainingparams
array array null bool bool bool array array null array communication_matrix\local\command::$remainingparams = [] |
|
protected |
$command The raw command data
$params The parameters passed into the command $sendasjson Whether to send params as JSON $requireauthorization Whether authorization is required for this request $ignorehttperrors Whether to ignore HTTP Errors $query Any query parameters to set on the URL Any parameters not used in the URI which are to be passed to the server via body or query params
The documentation for this class was generated from the following file:
- communication/provider/matrix/classes/local/command.php