1 | <?php |
||
9 | class Client |
||
10 | { |
||
11 | /** |
||
12 | * The api host. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $host; |
||
17 | |||
18 | /** |
||
19 | * The api port. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $port; |
||
24 | |||
25 | /** |
||
26 | * Api usernamename / email. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $username; |
||
31 | |||
32 | /** |
||
33 | * Api username password. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $password; |
||
38 | |||
39 | /** |
||
40 | * Api authentication token. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $token; |
||
45 | |||
46 | /** |
||
47 | * Domus branch id to login. |
||
48 | * |
||
49 | * @var int |
||
50 | */ |
||
51 | protected $branchId; |
||
52 | |||
53 | /** |
||
54 | * The api client handler. |
||
55 | * |
||
56 | * @var mixed |
||
57 | */ |
||
58 | protected $handler; |
||
59 | |||
60 | /** |
||
61 | * Create a new api client instance. |
||
62 | * |
||
63 | * @param string $host |
||
64 | * @param string $port |
||
65 | * @param string $username |
||
66 | * @param string $password |
||
67 | * |
||
68 | * @throws InvalidHostException |
||
69 | */ |
||
70 | 138 | public function __construct($host, $port, $username, $password) |
|
77 | |||
78 | /** |
||
79 | * Get the api uthetication token. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | 132 | public function getToken() |
|
91 | |||
92 | /** |
||
93 | * Api authentication. |
||
94 | * |
||
95 | * @return self |
||
96 | */ |
||
97 | 132 | protected function auth() |
|
107 | |||
108 | /** |
||
109 | * Set the branch of endpoint operation. |
||
110 | * |
||
111 | * @param int $branchId |
||
112 | * |
||
113 | * @return self |
||
114 | */ |
||
115 | 129 | public function setBranch($branchId) |
|
129 | |||
130 | /** |
||
131 | * Make the endpoint full url. |
||
132 | * |
||
133 | * @param string $endpoint |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | 135 | public function makeUrl($endpoint) |
|
144 | |||
145 | /** |
||
146 | * Sets the client handler. |
||
147 | * |
||
148 | * @param mixed $handler |
||
149 | */ |
||
150 | 132 | public function setHandler($handler) |
|
154 | |||
155 | /** |
||
156 | * Gets the client handler. |
||
157 | * |
||
158 | * @param mixed $handler |
||
|
|||
159 | */ |
||
160 | 126 | public function getHandler() |
|
164 | |||
165 | /** |
||
166 | * Get the branch id. |
||
167 | * |
||
168 | * @return int |
||
169 | */ |
||
170 | 3 | public function getBranchId() |
|
174 | |||
175 | /** |
||
176 | * Call a dinamyc api endpoint. |
||
177 | * |
||
178 | * @param string $method |
||
179 | * @param array $args |
||
180 | * |
||
181 | * @throws InvalidApiEndPointException |
||
182 | * |
||
183 | * @return mixed |
||
184 | */ |
||
185 | 126 | public function __call($method, array $args) |
|
192 | } |
||
193 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.