@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Generate SQL from Rule |
28 | 28 | * @param string $rule Rule to generate SQL for |
29 | - * @return string|boolean |
|
29 | + * @return false|string |
|
30 | 30 | */ |
31 | 31 | function GenSQL($rule) |
32 | 32 | { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | /** |
148 | 148 | * Run all rules for a device |
149 | 149 | * @param int $device Device-ID |
150 | - * @return void |
|
150 | + * @return false|null |
|
151 | 151 | */ |
152 | 152 | function RunRules($device) |
153 | 153 | { |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | * "Safely" run eval |
426 | 426 | * @param string $code Code to run |
427 | 427 | * @param array $obj Object with variables |
428 | - * @return string|mixed |
|
428 | + * @return string |
|
429 | 429 | */ |
430 | 430 | function RunJail($code, $obj) |
431 | 431 | { |
@@ -208,6 +208,11 @@ discard block |
||
208 | 208 | }//end connect_alert() |
209 | 209 | |
210 | 210 | |
211 | + /** |
|
212 | + * @param string $buff |
|
213 | + * |
|
214 | + * @return string |
|
215 | + */ |
|
211 | 216 | private function read($buff) |
212 | 217 | { |
213 | 218 | $r = fread($this->socket[$buff], 64); |
@@ -381,6 +386,10 @@ discard block |
||
381 | 386 | }//end handleCommand() |
382 | 387 | |
383 | 388 | |
389 | + /** |
|
390 | + * @param string $command |
|
391 | + * @param string $params |
|
392 | + */ |
|
384 | 393 | private function proceedCommand($command, $params) |
385 | 394 | { |
386 | 395 | $command = strtolower($command); |
@@ -405,6 +414,9 @@ discard block |
||
405 | 414 | }//end respond() |
406 | 415 | |
407 | 416 | |
417 | + /** |
|
418 | + * @param string $param |
|
419 | + */ |
|
408 | 420 | private function getChan($param) |
409 | 421 | { |
410 | 422 | $data = explode('PRIVMSG ', $this->data, 3); |
@@ -419,6 +431,11 @@ discard block |
||
419 | 431 | return str_replace(':', '', $arrData[0]); |
420 | 432 | }//end getUser() |
421 | 433 | |
434 | + /** |
|
435 | + * @param string $param |
|
436 | + * |
|
437 | + * @return string |
|
438 | + */ |
|
422 | 439 | private function getUserHost($param) |
423 | 440 | { |
424 | 441 | $arrData = explode(' ', $param, 2); |
@@ -564,6 +581,9 @@ discard block |
||
564 | 581 | }//end hostAuth |
565 | 582 | |
566 | 583 | |
584 | + /** |
|
585 | + * @param string $params |
|
586 | + */ |
|
567 | 587 | private function ircRaw($params) |
568 | 588 | { |
569 | 589 | return fputs($this->socket['irc'], $params."\r\n"); |
@@ -869,6 +889,10 @@ discard block |
||
869 | 889 | return $this->respond($msg); |
870 | 890 | }//end _status() |
871 | 891 | |
892 | + /** |
|
893 | + * @param string $fg_color |
|
894 | + * @param string $other |
|
895 | + */ |
|
872 | 896 | private function _color($text, $fg_color, $bg_color = null, $other = null) |
873 | 897 | { |
874 | 898 | $colors = array( |
@@ -175,8 +175,8 @@ |
||
175 | 175 | /** |
176 | 176 | * Extract the mib name from a file |
177 | 177 | * |
178 | - * @param $file |
|
179 | - * @return mixed |
|
178 | + * @param string $file |
|
179 | + * @return string |
|
180 | 180 | * @throws Exception |
181 | 181 | */ |
182 | 182 | private function extractMibName($file) |
@@ -403,6 +403,9 @@ |
||
403 | 403 | return str_replace('~C0mmA~', ',', $matches[0][0]); |
404 | 404 | } |
405 | 405 | |
406 | + /** |
|
407 | + * @param string $sid |
|
408 | + */ |
|
406 | 409 | protected function getUseridFromSid($sid) |
407 | 410 | { |
408 | 411 | return preg_replace('/.*-(\d+)$/', '$1', $sid); |
@@ -317,6 +317,9 @@ discard block |
||
317 | 317 | return 'S-'.$revLevel.'-'.$authIdent.'-'.implode('-', $subAuths); |
318 | 318 | } |
319 | 319 | |
320 | + /** |
|
321 | + * @param string $attr |
|
322 | + */ |
|
320 | 323 | protected function authLdapSessionCacheGet($attr) |
321 | 324 | { |
322 | 325 | $ttl = 300; |
@@ -345,6 +348,9 @@ discard block |
||
345 | 348 | } |
346 | 349 | |
347 | 350 | |
351 | + /** |
|
352 | + * @param string $attr |
|
353 | + */ |
|
348 | 354 | protected function authLdapSessionCacheSet($attr, $value) |
349 | 355 | { |
350 | 356 | $_SESSION['auth_ldap'][$attr]['value'] = $value; |
@@ -28,6 +28,9 @@ discard block |
||
28 | 28 | }//end string_to_oid() |
29 | 29 | |
30 | 30 | |
31 | +/** |
|
32 | + * @param string $setting |
|
33 | + */ |
|
31 | 34 | function prep_snmp_setting($device, $setting) |
32 | 35 | { |
33 | 36 | global $config; |
@@ -287,6 +290,9 @@ discard block |
||
287 | 290 | return false; |
288 | 291 | }//end snmp_check() |
289 | 292 | |
293 | +/** |
|
294 | + * @param string $options |
|
295 | + */ |
|
290 | 296 | function snmp_walk($device, $oid, $options = null, $mib = null, $mibdir = null) |
291 | 297 | { |
292 | 298 | $time_start = microtime(true); |
@@ -370,6 +376,9 @@ discard block |
||
370 | 376 | }//end snmp_cache_ifIndex() |
371 | 377 | |
372 | 378 | |
379 | +/** |
|
380 | + * @param string $mibdir |
|
381 | + */ |
|
373 | 382 | function snmpwalk_cache_oid($device, $oid, $array, $mib = null, $mibdir = null, $snmpflags = '-OQUs') |
374 | 383 | { |
375 | 384 | $data = snmp_walk($device, $oid, $snmpflags, $mib, $mibdir); |
@@ -441,6 +450,9 @@ discard block |
||
441 | 450 | }//end snmpwalk_cache_oid_num() |
442 | 451 | |
443 | 452 | |
453 | +/** |
|
454 | + * @param string $mib |
|
455 | + */ |
|
444 | 456 | function snmpwalk_cache_multi_oid($device, $oid, $array, $mib = null, $mibdir = null, $snmpflags = '-OQUs') |
445 | 457 | { |
446 | 458 | global $cache; |
@@ -896,6 +908,10 @@ discard block |
||
896 | 908 | * Load the given MIB into the database. |
897 | 909 | * @return count of objects loaded |
898 | 910 | */ |
911 | +/** |
|
912 | + * @param string $mib |
|
913 | + * @param string $module |
|
914 | + */ |
|
899 | 915 | function snmp_mib_load($mib, $module, $included_by, $mibdir = null, $device = array()) |
900 | 916 | { |
901 | 917 | $mibs = array(); |
@@ -1163,6 +1179,9 @@ discard block |
||
1163 | 1179 | * Validate MIBs and store the device->mib mapping in the database. |
1164 | 1180 | * See includes/discovery/os/ruckuswireless.inc.php for an example of usage. |
1165 | 1181 | */ |
1182 | +/** |
|
1183 | + * @param string $included_by |
|
1184 | + */ |
|
1166 | 1185 | function register_mibs($device, $mibs, $included_by) |
1167 | 1186 | { |
1168 | 1187 | if (!is_mib_poller_enabled($device)) { |
@@ -257,6 +257,9 @@ |
||
257 | 257 | return $data; |
258 | 258 | } |
259 | 259 | |
260 | +/** |
|
261 | + * @param string $options |
|
262 | + */ |
|
260 | 263 | function snmp_walk($device, $oid, $options = null, $mib = null, $mibdir = null) |
261 | 264 | { |
262 | 265 | $community = $device['community']; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param array $device Device array |
73 | 73 | * @param string $key Name of setting to fetch |
74 | 74 | * @param string $global_prefix specify where the global setting lives in the global config |
75 | - * @param mixed $default will be returned if the setting is not set on the device or globally |
|
75 | + * @param string $default will be returned if the setting is not set on the device or globally |
|
76 | 76 | * @return mixed |
77 | 77 | */ |
78 | 78 | public static function getDeviceSetting($device, $key, $global_prefix = null, $default = null) |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @param string $os The os name |
128 | 128 | * @param string $key period separated config variable name |
129 | - * @param array $default optional array to return if the setting is not set |
|
129 | + * @param boolean $default optional array to return if the setting is not set |
|
130 | 130 | * @return array |
131 | 131 | */ |
132 | 132 | public static function getCombined($os, $key, $default = array()) |
@@ -1471,6 +1471,9 @@ |
||
1471 | 1471 | } |
1472 | 1472 | } |
1473 | 1473 | |
1474 | +/** |
|
1475 | + * @param string $state |
|
1476 | + */ |
|
1474 | 1477 | function parse_entity_state($state, $value) |
1475 | 1478 | { |
1476 | 1479 | $data = array( |