1 | <?php |
||
7 | class OpenFireRestApi extends RestClient |
||
8 | { |
||
9 | |||
10 | |||
11 | public function __construct() |
||
16 | |||
17 | |||
18 | |||
19 | /** |
||
20 | * Get all registered users |
||
21 | * |
||
22 | * @return json|false Json with data or error, or False when something went fully wrong |
||
23 | */ |
||
24 | public function getUsers($opts = []) |
||
33 | |||
34 | |||
35 | /** |
||
36 | * Get information for a specified user |
||
37 | * |
||
38 | * @return json|false Json with data or error, or False when something went fully wrong |
||
39 | */ |
||
40 | public function getUser($username) |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Creates a new OpenFire user |
||
49 | * |
||
50 | * @param string $username Username |
||
51 | * @param string $password Password |
||
52 | * @param string|false $name Name (Optional) |
||
53 | * @param string|false $email Email (Optional) |
||
54 | * @param string[]|false $groups Groups (Optional) |
||
55 | * @return json|false Json with data or error, or False when something went fully wrong |
||
56 | */ |
||
57 | public function addUser($username, $password, $name=false, $email=false, $groups=false) |
||
62 | |||
63 | |||
64 | /** |
||
65 | * Deletes an OpenFire user |
||
66 | * |
||
67 | * @param string $username Username |
||
68 | * @return json|false Json with data or error, or False when something went fully wrong |
||
69 | */ |
||
70 | public function deleteUser($username) |
||
75 | |||
76 | /** |
||
77 | * Updates an OpenFire user |
||
78 | * |
||
79 | * @param string $username Username |
||
80 | * @param string|false $password Password (Optional) |
||
81 | * @param string|false $name Name (Optional) |
||
82 | * @param string|false $email Email (Optional) |
||
83 | * @param string[]|false $groups Groups (Optional) |
||
84 | * @return json|false Json with data or error, or False when something went fully wrong |
||
85 | */ |
||
86 | public function updateUser($username, $password, $name=false, $email=false, $groups=false) |
||
91 | |||
92 | |||
93 | /** |
||
94 | * Retrieve all user groups |
||
95 | * |
||
96 | * @param string $username Username |
||
97 | * @return json|false Json with data or error, or False when something went fully wrong |
||
98 | */ |
||
99 | public function userGroups($username) |
||
104 | |||
105 | /** |
||
106 | * Add user to groups |
||
107 | * |
||
108 | * @param string $username Username |
||
109 | * @param Array $groups Groups to add user |
||
110 | * @return json|false Json with data or error, or False when something went fully wrong |
||
111 | */ |
||
112 | public function addToGroups($username, $groups) |
||
117 | |||
118 | /** |
||
119 | * Add user to a group |
||
120 | * |
||
121 | * @param string $username Username |
||
122 | * @param string $groups Groups to add user |
||
|
|||
123 | * @return json|false Json with data or error, or False when something went fully wrong |
||
124 | */ |
||
125 | public function addToGroup($username, $groupName) |
||
130 | |||
131 | |||
132 | /** |
||
133 | * Delete user from a group |
||
134 | * |
||
135 | * @param string $username Username |
||
136 | * @param string $groups Groups to add user |
||
137 | * @return json|false Json with data or error, or False when something went fully wrong |
||
138 | */ |
||
139 | public function deleteFromGroup($username, $groupName) |
||
144 | |||
145 | |||
146 | /** |
||
147 | * lockout/Disable an OpenFire user |
||
148 | * |
||
149 | * @param string $username Username |
||
150 | * @return json|false Json with data or error, or False when something went fully wrong |
||
151 | */ |
||
152 | public function lockoutUser($username) |
||
157 | |||
158 | |||
159 | /** |
||
160 | * unlocks an OpenFire user |
||
161 | * |
||
162 | * @param string $username Username |
||
163 | * @return json|false Json with data or error, or False when something went fully wrong |
||
164 | */ |
||
165 | public function unlockUser($username) |
||
170 | |||
171 | |||
172 | /** |
||
173 | * List user rosters |
||
174 | * |
||
175 | * @param string $username Username |
||
176 | * @return json|false Json with data or error, or False when something went fully wrong |
||
177 | */ |
||
178 | public function userRosters($username) |
||
183 | |||
184 | |||
185 | /** |
||
186 | * Adds to this OpenFire user's roster |
||
187 | * |
||
188 | * @param string $username Username |
||
189 | * @param string $jid JID |
||
190 | * @param string|false $name Name (Optional) |
||
191 | * @param int|false $subscriptionType Subscription (Optional) |
||
192 | * @return json|false Json with data or error, or False when something went fully wrong |
||
193 | */ |
||
194 | public function addToRoster($username, $jid, $name=false, $subscriptionType=false) |
||
199 | |||
200 | |||
201 | /** |
||
202 | * Removes from this OpenFire user's roster |
||
203 | * |
||
204 | * @param string $username Username |
||
205 | * @param string $jid JID |
||
206 | * @return json|false Json with data or error, or False when something went fully wrong |
||
207 | */ |
||
208 | public function deleteFromRoster($username, $jid) |
||
213 | |||
214 | /** |
||
215 | * Updates this OpenFire user's roster |
||
216 | * |
||
217 | * @param string $username Username |
||
218 | * @param string $jid JID |
||
219 | * @param string|false $nickname Nick Name (Optional) |
||
220 | * @param int|false $subscriptionType Subscription (Optional) |
||
221 | * @return json|false Json with data or error, or False when something went fully wrong |
||
222 | */ |
||
223 | public function updateRoster($username, $jid, $nickname=false, $subscriptionType=false) |
||
228 | |||
229 | /** |
||
230 | * Get all groups |
||
231 | * |
||
232 | * @return json|false Json with data or error, or False when something went fully wrong |
||
233 | */ |
||
234 | public function getGroups() |
||
239 | |||
240 | /** |
||
241 | * Retrieve a group |
||
242 | * |
||
243 | * @param string $name Name of group |
||
244 | * @return json|false Json with data or error, or False when something went fully wrong |
||
245 | */ |
||
246 | public function getGroup($name) |
||
251 | |||
252 | /** |
||
253 | * Create a group |
||
254 | * |
||
255 | * @param string $name Name of the group |
||
256 | * @param string $description Some description of the group |
||
257 | * |
||
258 | * @return json|false Json with data or error, or False when something went fully wrong |
||
259 | */ |
||
260 | public function createGroup($name, $description = false) |
||
265 | |||
266 | /** |
||
267 | * Delete a group |
||
268 | * |
||
269 | * @param string $name Name of the Group to delete |
||
270 | * @return json|false Json with data or error, or False when something went fully wrong |
||
271 | */ |
||
272 | public function deleteGroup($name) |
||
277 | |||
278 | /** |
||
279 | * Update a group (description) |
||
280 | * |
||
281 | * @param string $name Name of group |
||
282 | * @param string $description Some description of the group |
||
283 | * |
||
284 | */ |
||
285 | public function updateGroup($name, $description) |
||
290 | |||
291 | /** |
||
292 | * Gell all active sessions |
||
293 | * |
||
294 | * @return json|false Json with data or error, or False when something went fully wrong |
||
295 | */ |
||
296 | public function getSessions() |
||
301 | |||
302 | public function getChatRoom($name) |
||
306 | |||
307 | public function getAllChatRooms() |
||
311 | |||
312 | public function createChatRoom($naturalName, $roomName, $description, $maxUsers = '30', $persistent = 'false', $publicRoom = 'false') |
||
317 | |||
318 | public function deleteChatRoom($name) |
||
322 | } |
||
323 |
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.