1 | <?php |
||
9 | class RestClient |
||
10 | { |
||
11 | public $host = 'localhost'; |
||
12 | public $port = '9090'; |
||
13 | public $plugin = '/plugins/restapi/v1'; |
||
14 | public $secret = 'SuperSecret'; |
||
15 | public $useSSL = false; |
||
16 | protected $params = array(); |
||
17 | private $client; |
||
18 | public $bcastRoles = array(); |
||
19 | public $useBasicAuth = false; |
||
20 | public $basicUser = 'admin'; |
||
21 | public $basicPwd = '1234'; |
||
22 | |||
23 | function __construct() |
||
27 | |||
28 | /** |
||
29 | * Make the request and analyze the result |
||
30 | * |
||
31 | * @param string $type Request method |
||
32 | * @param string $endpoint Api request endpoint |
||
33 | * @param array $params Parameters |
||
34 | * @return array|false Array with data or error, or False when something went fully wrong |
||
35 | */ |
||
36 | protected function doRequest($type, $endpoint, $params=[]) |
||
67 | |||
68 | |||
69 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.