@@ -30,7 +30,7 @@ |
||
30 | 30 | * @param $pattern |
31 | 31 | * @param $name |
32 | 32 | * @param $desc |
33 | - * @return int|string |
|
33 | + * @return integer|null |
|
34 | 34 | */ |
35 | 35 | function AddDeviceGroup($name, $desc, $pattern) |
36 | 36 | { |
@@ -446,6 +446,9 @@ |
||
446 | 446 | }//end _rrd_info() |
447 | 447 | |
448 | 448 | |
449 | +/** |
|
450 | + * @param integer $code |
|
451 | + */ |
|
449 | 452 | function rrd_get_color($code, $line = true) |
450 | 453 | { |
451 | 454 | global $config; |
@@ -22,6 +22,10 @@ discard block |
||
22 | 22 | require 'includes/collectd/definitions.php'; |
23 | 23 | |
24 | 24 | |
25 | +/** |
|
26 | + * @param integer $fontsize |
|
27 | + * @param integer $width |
|
28 | + */ |
|
25 | 29 | function makeTextBlock($text, $fontfile, $fontsize, $width) |
26 | 30 | { |
27 | 31 | // TODO: handle explicit line-break! |
@@ -49,6 +53,8 @@ discard block |
||
49 | 53 | * @code_msg Short text description of HTTP error code |
50 | 54 | * @title Title for fake RRD graph |
51 | 55 | * @msg Complete error message to display in place of graph content |
56 | + * @param integer $code |
|
57 | + * @param string $code_msg |
|
52 | 58 | */ |
53 | 59 | function error($code, $code_msg, $title, $msg) |
54 | 60 | { |
@@ -38,6 +38,9 @@ |
||
38 | 38 | return($db); |
39 | 39 | }// end influxdb_connect |
40 | 40 | |
41 | +/** |
|
42 | + * @param string $measurement |
|
43 | + */ |
|
41 | 44 | function influx_update($device, $measurement, $tags, $fields) |
42 | 45 | { |
43 | 46 | global $influxdb, $config; |
@@ -848,6 +848,9 @@ |
||
848 | 848 | } |
849 | 849 | } |
850 | 850 | |
851 | +/** |
|
852 | + * @param string $string |
|
853 | + */ |
|
851 | 854 | function debug($string) |
852 | 855 | { |
853 | 856 | global $debug; |
@@ -162,6 +162,9 @@ discard block |
||
162 | 162 | }//end generate_url() |
163 | 163 | |
164 | 164 | |
165 | +/** |
|
166 | + * @param string $text |
|
167 | + */ |
|
165 | 168 | function escape_quotes($text) |
166 | 169 | { |
167 | 170 | return str_replace('"', "\'", str_replace("'", "\'", $text)); |
@@ -301,6 +304,10 @@ discard block |
||
301 | 304 | }//end generate_device_link() |
302 | 305 | |
303 | 306 | |
307 | +/** |
|
308 | + * @param string $url |
|
309 | + * @param string $class |
|
310 | + */ |
|
304 | 311 | function overlib_link($url, $text, $contents, $class = null) |
305 | 312 | { |
306 | 313 | global $config; |
@@ -535,6 +542,14 @@ discard block |
||
535 | 542 | }//end generate_graph_js_state() |
536 | 543 | |
537 | 544 | |
545 | +/** |
|
546 | + * @param integer $width |
|
547 | + * @param integer $height |
|
548 | + * @param string $left_colour |
|
549 | + * @param string $right_text |
|
550 | + * @param string $right_colour |
|
551 | + * @param string $right_background |
|
552 | + */ |
|
538 | 553 | function print_percentage_bar($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background) |
539 | 554 | { |
540 | 555 | if ($percent > '100') { |
@@ -1052,6 +1067,9 @@ discard block |
||
1052 | 1067 | } |
1053 | 1068 | } |
1054 | 1069 | |
1070 | +/** |
|
1071 | + * @param string $string |
|
1072 | + */ |
|
1055 | 1073 | function shorten_interface_type($string) |
1056 | 1074 | { |
1057 | 1075 | return str_ireplace( |
@@ -1412,7 +1430,7 @@ discard block |
||
1412 | 1430 | |
1413 | 1431 | /** |
1414 | 1432 | * @param $data |
1415 | - * @return bool|mixed |
|
1433 | + * @return string|false |
|
1416 | 1434 | */ |
1417 | 1435 | function array_to_htmljson($data) |
1418 | 1436 | { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * Discover wireless client counts. Type is clients. |
47 | 47 | * Returns an array of LibreNMS\Device\Sensor objects that have been discovered |
48 | 48 | * |
49 | - * @return array Sensors |
|
49 | + * @return WirelessSensor[] Sensors |
|
50 | 50 | */ |
51 | 51 | public function discoverWirelessClients() |
52 | 52 | { |
@@ -97,6 +97,10 @@ discard block |
||
97 | 97 | return $channel & 255; // mask off the channel width information |
98 | 98 | } |
99 | 99 | |
100 | + /** |
|
101 | + * @param string $type |
|
102 | + * @param string $oid |
|
103 | + */ |
|
100 | 104 | private function discoverInstantRadio($type, $oid, $desc = 'Radio %s') |
101 | 105 | { |
102 | 106 | $data = snmpwalk_cache_oid_num($this->getDevice(), $oid, array(), 'AI-AP-MIB'); |
@@ -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( |