@@ -23,6 +23,9 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | + /** |
|
27 | + * @param string $functionname |
|
28 | + */ |
|
26 | 29 | static function builtin_function_exists($functionname) { |
27 | 30 | if (function_exists('get_defined_functions')) { |
28 | 31 | static $get_defined_functions = array(); |
@@ -35,6 +38,10 @@ discard block |
||
35 | 38 | } |
36 | 39 | |
37 | 40 | |
41 | + /** |
|
42 | + * @param string $version1 |
|
43 | + * @param string $version2 |
|
44 | + */ |
|
38 | 45 | static function version_compare_replacement_sub($version1, $version2, $operator='') { |
39 | 46 | // If you specify the third optional operator argument, you can test for a particular relationship. |
40 | 47 | // The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively. |
@@ -95,6 +102,9 @@ discard block |
||
95 | 102 | } |
96 | 103 | |
97 | 104 | |
105 | + /** |
|
106 | + * @param string $version2 |
|
107 | + */ |
|
98 | 108 | static function version_compare_replacement($version1, $version2, $operator='') { |
99 | 109 | if (function_exists('version_compare')) { |
100 | 110 | // built into PHP v4.1.0+ |
@@ -212,6 +222,9 @@ discard block |
||
212 | 222 | return array($newwidth, $newheight); |
213 | 223 | } |
214 | 224 | |
225 | + /** |
|
226 | + * @param string $string |
|
227 | + */ |
|
215 | 228 | static function HexCharDisplay($string) { |
216 | 229 | $len = strlen($string); |
217 | 230 | $output = ''; |
@@ -292,6 +305,10 @@ discard block |
||
292 | 305 | } |
293 | 306 | |
294 | 307 | |
308 | + /** |
|
309 | + * @param integer $width |
|
310 | + * @param integer $height |
|
311 | + */ |
|
295 | 312 | static function ScaleToFitInBox($width, $height, $maxwidth=null, $maxheight=null, $allow_enlarge=true, $allow_reduce=true) { |
296 | 313 | $maxwidth = (is_null($maxwidth) ? $width : $maxwidth); |
297 | 314 | $maxheight = (is_null($maxheight) ? $height : $maxheight); |
@@ -380,6 +397,12 @@ discard block |
||
380 | 397 | } |
381 | 398 | |
382 | 399 | |
400 | + /** |
|
401 | + * @param integer $src_x |
|
402 | + * @param integer $src_y |
|
403 | + * @param integer $src_w |
|
404 | + * @param integer $src_h |
|
405 | + */ |
|
383 | 406 | static function ImageCopyRespectAlpha(&$dst_im, &$src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $opacity_pct=100) { |
384 | 407 | $opacipct = $opacity_pct / 100; |
385 | 408 | for ($x = $src_x; $x < $src_w; $x++) { |
@@ -404,6 +427,10 @@ discard block |
||
404 | 427 | } |
405 | 428 | |
406 | 429 | |
430 | + /** |
|
431 | + * @param integer $old_width |
|
432 | + * @param integer $old_height |
|
433 | + */ |
|
407 | 434 | static function ProportionalResize($old_width, $old_height, $new_width=false, $new_height=false) { |
408 | 435 | $old_aspect_ratio = $old_width / $old_height; |
409 | 436 | if (($new_width === false) && ($new_height === false)) { |
@@ -427,6 +454,9 @@ discard block |
||
427 | 454 | } |
428 | 455 | |
429 | 456 | |
457 | + /** |
|
458 | + * @param string $function |
|
459 | + */ |
|
430 | 460 | static function FunctionIsDisabled($function) { |
431 | 461 | static $DisabledFunctions = null; |
432 | 462 | if (is_null($DisabledFunctions)) { |
@@ -447,6 +477,11 @@ discard block |
||
447 | 477 | } |
448 | 478 | |
449 | 479 | |
480 | + /** |
|
481 | + * @param string $command |
|
482 | + * |
|
483 | + * @return string |
|
484 | + */ |
|
450 | 485 | static function SafeExec($command) { |
451 | 486 | static $AllowedExecFunctions = array(); |
452 | 487 | if (empty($AllowedExecFunctions)) { |
@@ -623,6 +658,10 @@ discard block |
||
623 | 658 | return false; |
624 | 659 | } |
625 | 660 | |
661 | + /** |
|
662 | + * @param string $needle |
|
663 | + * @param string[] $haystack |
|
664 | + */ |
|
626 | 665 | static function CaseInsensitiveInArray($needle, $haystack) { |
627 | 666 | $needle = strtolower($needle); |
628 | 667 | foreach ($haystack as $key => $value) { |
@@ -635,6 +674,9 @@ discard block |
||
635 | 674 | return false; |
636 | 675 | } |
637 | 676 | |
677 | + /** |
|
678 | + * @param string $file |
|
679 | + */ |
|
638 | 680 | static function URLreadFsock($host, $file, &$errstr, $successonly=true, $port=80, $timeout=10) { |
639 | 681 | if (!function_exists('fsockopen') || phpthumb_functions::FunctionIsDisabled('fsockopen')) { |
640 | 682 | $errstr = 'fsockopen() unavailable'; |
@@ -723,7 +723,7 @@ |
||
723 | 723 | * xos_opal_Theme::renderMetas() |
724 | 724 | * |
725 | 725 | * @param mixed $type |
726 | - * @param mixed $return |
|
726 | + * @param boolean $return |
|
727 | 727 | * @return bool|string |
728 | 728 | */ |
729 | 729 | public function renderMetas($type = null, $return = false) |
@@ -1350,7 +1350,7 @@ |
||
1350 | 1350 | * Load a {@link XoopsObject} object from the database |
1351 | 1351 | * |
1352 | 1352 | * @access protected |
1353 | - * @param mixed $id ID |
|
1353 | + * @param integer|null $id ID |
|
1354 | 1354 | * @param array $fields fields to fetch |
1355 | 1355 | * @return XoopsObject {@link XoopsObject} |
1356 | 1356 | */ |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | * Decodes a JWT string into a PHP object. |
49 | 49 | * |
50 | 50 | * @param string $jwt The JWT |
51 | - * @param string|array $key The key, or map of keys. |
|
51 | + * @param string $key The key, or map of keys. |
|
52 | 52 | * If the algorithm used is asymmetric, this is the public key |
53 | - * @param array $allowed_algs List of supported verification algorithms |
|
53 | + * @param string[] $allowed_algs List of supported verification algorithms |
|
54 | 54 | * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256' |
55 | 55 | * |
56 | 56 | * @return object The JWT's payload as a PHP object |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * Sign a string with a given key and algorithm. |
175 | 175 | * |
176 | 176 | * @param string $msg The message to sign |
177 | - * @param string|resource $key The secret key |
|
177 | + * @param string $key The secret key |
|
178 | 178 | * @param string $alg The signing algorithm. |
179 | 179 | * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256' |
180 | 180 | * |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param integer $inline Nesting level where you switch to inline YAML |
45 | 45 | * @param integer $indent Number of spaces to indent for nested nodes |
46 | 46 | * |
47 | - * @return string|bool YAML string or false on error |
|
47 | + * @return string|false YAML string or false on error |
|
48 | 48 | */ |
49 | 49 | public static function dump($var, $inline = 4, $indent = 4) |
50 | 50 | { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param integer $inline Nesting level where you switch to inline YAML |
129 | 129 | * @param integer $indent Number of spaces to indent for nested nodes |
130 | 130 | * |
131 | - * @return string|boolean YAML string or false on error |
|
131 | + * @return string|false YAML string or false on error |
|
132 | 132 | */ |
133 | 133 | public static function dumpWrapped($var, $inline = 4, $indent = 4) |
134 | 134 | { |
@@ -72,6 +72,10 @@ discard block |
||
72 | 72 | * @param $isCaseFolding |
73 | 73 | * @returns void |
74 | 74 | ****************************************************************************/ |
75 | + |
|
76 | + /** |
|
77 | + * @param boolean $isCaseFolding |
|
78 | + */ |
|
75 | 79 | public function setCaseFolding($isCaseFolding) |
76 | 80 | { |
77 | 81 | assert(is_bool($isCaseFolding)); |
@@ -338,8 +342,8 @@ discard block |
||
338 | 342 | * The default tag handler method for a tag with no handler |
339 | 343 | * |
340 | 344 | * @abstract |
341 | - * @param $parser |
|
342 | - * @param $tagName |
|
345 | + * @param integer $parser |
|
346 | + * @param string $tagName |
|
343 | 347 | * @param $attributesArray |
344 | 348 | */ |
345 | 349 | public function handleBeginElementDefault($parser, $tagName, $attributesArray) |
@@ -350,8 +354,8 @@ discard block |
||
350 | 354 | * The default tag handler method for a tag with no handler |
351 | 355 | * |
352 | 356 | * @abstract |
353 | - * @param $parser |
|
354 | - * @param $tagName |
|
357 | + * @param integer $parser |
|
358 | + * @param string $tagName |
|
355 | 359 | */ |
356 | 360 | public function handleEndElementDefault($parser, $tagName) |
357 | 361 | { |
@@ -361,8 +365,8 @@ discard block |
||
361 | 365 | * The default tag handler method for a tag with no handler |
362 | 366 | * |
363 | 367 | * @abstract |
364 | - * @param $parser |
|
365 | - * @param $data |
|
368 | + * @param integer $parser |
|
369 | + * @param string $data |
|
366 | 370 | */ |
367 | 371 | public function handleCharacterDataDefault($parser, $data) |
368 | 372 | { |
@@ -371,7 +375,7 @@ discard block |
||
371 | 375 | /** |
372 | 376 | * Sets error messages |
373 | 377 | * |
374 | - * @param $error string an error message |
|
378 | + * @param string $error string an error message |
|
375 | 379 | */ |
376 | 380 | public function setErrors($error) |
377 | 381 | { |
@@ -345,6 +345,12 @@ discard block |
||
345 | 345 | } |
346 | 346 | |
347 | 347 | // public: |
348 | + |
|
349 | + /** |
|
350 | + * @param string $param |
|
351 | + * |
|
352 | + * @return integer |
|
353 | + */ |
|
348 | 354 | function getParameter($param) { |
349 | 355 | //if (property_exists('phpThumb', $param)) { |
350 | 356 | return $this->$param; |
@@ -1119,6 +1125,10 @@ discard block |
||
1119 | 1125 | |
1120 | 1126 | /* True if the provided path points inside one of open_basedirs (or if open_basedirs are disabled) */ |
1121 | 1127 | // http://support.silisoftware.com/phpBB3/viewtopic.php?t=961 |
1128 | + |
|
1129 | + /** |
|
1130 | + * @param string $path |
|
1131 | + */ |
|
1122 | 1132 | function isInOpenBasedir($path) { |
1123 | 1133 | static $open_basedirs = null; |
1124 | 1134 | if (is_null($open_basedirs)) { |
@@ -1136,6 +1146,10 @@ discard block |
||
1136 | 1146 | |
1137 | 1147 | /* Resolves all symlinks in $path, checking that each continuous part ends in an allowed zone. Returns null, if any component leads outside of allowed zone. */ |
1138 | 1148 | // http://support.silisoftware.com/phpBB3/viewtopic.php?t=961 |
1149 | + |
|
1150 | + /** |
|
1151 | + * @return string |
|
1152 | + */ |
|
1139 | 1153 | function resolvePath($path, $allowed_dirs) { |
1140 | 1154 | $this->DebugMessage('resolvePath: '.$path.' (allowed_dirs: '.print_r($allowed_dirs, true).')', __FILE__, __LINE__); |
1141 | 1155 | |
@@ -4109,6 +4123,9 @@ discard block |
||
4109 | 4123 | return $this->ErrorImage(implode("\n", $DebugOutput), 700, 500, true); |
4110 | 4124 | } |
4111 | 4125 | |
4126 | + /** |
|
4127 | + * @param string $text |
|
4128 | + */ |
|
4112 | 4129 | function FatalError($text) { |
4113 | 4130 | if (is_null($this->fatalerror)) { |
4114 | 4131 | $this->fatalerror = $text; |
@@ -4116,6 +4133,9 @@ discard block |
||
4116 | 4133 | return true; |
4117 | 4134 | } |
4118 | 4135 | |
4136 | + /** |
|
4137 | + * @param string $text |
|
4138 | + */ |
|
4119 | 4139 | function ErrorImage($text, $width=0, $height=0, $forcedisplay=false) { |
4120 | 4140 | $width = ($width ? $width : $this->config_error_image_width); |
4121 | 4141 | $height = ($height ? $height : $this->config_error_image_height); |
@@ -4362,6 +4382,9 @@ discard block |
||
4362 | 4382 | return true; |
4363 | 4383 | } |
4364 | 4384 | |
4385 | + /** |
|
4386 | + * @param string $message |
|
4387 | + */ |
|
4365 | 4388 | function DebugTimingMessage($message, $file='', $line='', $timestamp=0) { |
4366 | 4389 | if (!$timestamp) { |
4367 | 4390 | $timestamp = array_sum(explode(' ', microtime())); |
@@ -332,7 +332,7 @@ |
||
332 | 332 | * @param array $thread |
333 | 333 | * @param int $key |
334 | 334 | * @param array $replies |
335 | - * @param string|int $prefix |
|
335 | + * @param integer $prefix |
|
336 | 336 | * @param bool $admin_view |
337 | 337 | * @param integer $depth |
338 | 338 | * @access private |
@@ -116,7 +116,7 @@ |
||
116 | 116 | class Database |
117 | 117 | { |
118 | 118 | /** |
119 | - * @return object |
|
119 | + * @return XoopsDatabase|null |
|
120 | 120 | */ |
121 | 121 | public function getInstance() |
122 | 122 | { |