@@ -230,7 +230,7 @@ |
||
230 | 230 | * @param string $user persistent identifier of the user who triggered the action |
231 | 231 | * @param string $category type of modification, from the fixed vocabulary: "NEW", "OWN", "MOD", "DEL" |
232 | 232 | * @param string $message message to log into the audit log |
233 | - * @return boolean TRUE if successful. Will terminate script execution on failure. |
|
233 | + * @return boolean|null TRUE if successful. Will terminate script execution on failure. |
|
234 | 234 | */ |
235 | 235 | public static function writeAudit($user, $category, $message) { |
236 | 236 | switch ($category) { |
@@ -87,6 +87,7 @@ discard block |
||
87 | 87 | /** |
88 | 88 | * executes a query and triggers logging to the SQL audit log if it's not a SELECT |
89 | 89 | * @param string $querystring the query to be executed |
90 | + * @param string $db |
|
90 | 91 | * @return mixed the query result as mysqli_result object; or TRUE on non-return-value statements |
91 | 92 | */ |
92 | 93 | public static function exec($db, $querystring) { |
@@ -134,6 +135,8 @@ discard block |
||
134 | 135 | /** |
135 | 136 | * Checks if a raw data pointer is public data (return value FALSE) or if |
136 | 137 | * yes who the authorised admins to view it are (return array of user IDs) |
138 | + * @param string $table |
|
139 | + * @param string $row |
|
137 | 140 | */ |
138 | 141 | public static function isDataRestricted($table, $row) { |
139 | 142 | if ($table != "institution_option" && $table != "profile_option" && $table != "federation_option") |
@@ -175,6 +178,7 @@ discard block |
||
175 | 178 | |
176 | 179 | /** |
177 | 180 | * Retrieves the last auto-id of an INSERT. Needs to be called immediately after the corresponding exec() call |
181 | + * @param string $db |
|
178 | 182 | * @return int the last autoincrement-ID |
179 | 183 | */ |
180 | 184 | public static function lastID($db) { |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * named the same as device_id. The second option takes precedence. |
173 | 173 | * |
174 | 174 | * @param string $source_name The source file name |
175 | - * @param string $output_name The destination file name |
|
175 | + * @param integer $output_name The destination file name |
|
176 | 176 | * |
177 | 177 | * @return bool result of the copy operation |
178 | 178 | * @final not to be redefined |
@@ -216,8 +216,7 @@ discard block |
||
216 | 216 | * named the same as device_id. The second option takes precedence. |
217 | 217 | * |
218 | 218 | * @param string $source_name The source file name |
219 | - * @param string $output_name The destination file name |
|
220 | - * @param int $use_win_cp Set Windows charset if non-zero |
|
219 | + * @param integer $output_name The destination file name |
|
221 | 220 | * |
222 | 221 | * @final not to be redefined |
223 | 222 | */ |
@@ -262,8 +261,6 @@ discard block |
||
262 | 261 | * The second optional parameter, if nonzero, should be the character set understood by iconv |
263 | 262 | * This is required by the Windows installer and is expected to go away in the future. |
264 | 263 | * |
265 | - * @param string $source_name The source file name |
|
266 | - * @param int $use_win_cp Set Windows charset if non-zero |
|
267 | 264 | * |
268 | 265 | * @final not to be redefined |
269 | 266 | */ |
@@ -661,7 +661,7 @@ |
||
661 | 661 | * This function retrieves the federation attributes. If called with the optional parameter, only attribute values for the attribute |
662 | 662 | * name in $option_name are retrieved; otherwise, all attributes are retrieved. |
663 | 663 | * |
664 | - * @param string $option_name optionally, the name of the attribute that is to be retrieved |
|
664 | + * @param integer $option_name optionally, the name of the attribute that is to be retrieved |
|
665 | 665 | * @return array of arrays of attributes which were set for this IdP |
666 | 666 | */ |
667 | 667 | public function getAttributes($option_name = 0) { |
@@ -32,6 +32,7 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * write debug messages to the log |
34 | 34 | * |
35 | + * @param integer $level |
|
35 | 36 | */ |
36 | 37 | function debug($level, $t) { |
37 | 38 | if (Config::$DEBUG_LEVEL >= $level) { |
@@ -130,7 +131,7 @@ discard block |
||
130 | 131 | * generates a UUID |
131 | 132 | * |
132 | 133 | * @param string $prefix an extra prefix to set before the UUID |
133 | - * @return UUID (possibly prefixed) |
|
134 | + * @return string (possibly prefixed) |
|
134 | 135 | */ |
135 | 136 | function uuid($prefix = '', $deterministic_source = NULL) { |
136 | 137 | if ($deterministic_source === NULL) |
@@ -68,6 +68,7 @@ discard block |
||
68 | 68 | * Cannot be used to define a new IdP in the database! This happens via Federation::newIdP() |
69 | 69 | * |
70 | 70 | * @param integer $i_id the database row identifier |
71 | + * @return string |
|
71 | 72 | */ |
72 | 73 | public function __construct($i_id) { |
73 | 74 | debug(3, "--- BEGIN Constructing new IdP object ... ---\n"); |
@@ -247,7 +248,7 @@ discard block |
||
247 | 248 | * This function retrieves the IdP-wide attributes. If called with the optional parameter, only attribute values for the attribute |
248 | 249 | * name in $option_name are retrieved; otherwise, all attributes are retrieved. |
249 | 250 | * |
250 | - * @param string $option_name optionally, the name of the attribute that is to be retrieved |
|
251 | + * @param integer $option_name optionally, the name of the attribute that is to be retrieved |
|
251 | 252 | * @return array of arrays of attributes which were set for this IdP |
252 | 253 | */ |
253 | 254 | public function getAttributes($option_name = 0) { |
@@ -318,7 +319,7 @@ discard block |
||
318 | 319 | * Adds a new profile to this IdP. |
319 | 320 | * Only creates the DB entry for the Profile. If you want to add attributes later, see Profile::addAttribute(). |
320 | 321 | * |
321 | - * @return object new Profile object if successful, or FALSE if an error occured |
|
322 | + * @return Profile|null new Profile object if successful, or FALSE if an error occured |
|
322 | 323 | */ |
323 | 324 | public function newProfile() { |
324 | 325 | DBConnection::exec(IdP::$DB_TYPE, "INSERT INTO profile (inst_id) VALUES($this->identifier)"); |
@@ -94,7 +94,7 @@ |
||
94 | 94 | * |
95 | 95 | * @assert ("user") == Array("user:email","user:fedadmin","user:realname") |
96 | 96 | * |
97 | - * @param string $class_name optionally specifies the class of options to be listed (class is the part of the option name before the : sign) |
|
97 | + * @param integer $class_name optionally specifies the class of options to be listed (class is the part of the option name before the : sign) |
|
98 | 98 | * @return array of options |
99 | 99 | */ |
100 | 100 | public function availableOptions($class_name = 0) { |
@@ -96,6 +96,10 @@ discard block |
||
96 | 96 | define('QR_FORMAT_PNG', 1); |
97 | 97 | |
98 | 98 | class qrstr { |
99 | + |
|
100 | + /** |
|
101 | + * @param string $repl |
|
102 | + */ |
|
99 | 103 | public static function set(&$srctab, $x, $y, $repl, $replLen = false) { |
100 | 104 | $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl)); |
101 | 105 | } |
@@ -231,6 +235,11 @@ discard block |
||
231 | 235 | } |
232 | 236 | |
233 | 237 | //---------------------------------------------------------------------- |
238 | + |
|
239 | + /** |
|
240 | + * @param boolean $outfile |
|
241 | + * @param string $err |
|
242 | + */ |
|
234 | 243 | public static function log($outfile, $err) |
235 | 244 | { |
236 | 245 | if (QR_LOG_DIR !== false) { |
@@ -256,6 +265,10 @@ discard block |
||
256 | 265 | } |
257 | 266 | |
258 | 267 | //---------------------------------------------------------------------- |
268 | + |
|
269 | + /** |
|
270 | + * @param string $markerId |
|
271 | + */ |
|
259 | 272 | public static function markTime($markerId) |
260 | 273 | { |
261 | 274 | list($usec, $sec) = explode(" ", microtime()); |
@@ -410,18 +423,30 @@ discard block |
||
410 | 423 | } |
411 | 424 | |
412 | 425 | //---------------------------------------------------------------------- |
426 | + |
|
427 | + /** |
|
428 | + * @param integer $version |
|
429 | + */ |
|
413 | 430 | public static function getWidth($version) |
414 | 431 | { |
415 | 432 | return self::$capacity[$version][QRCAP_WIDTH]; |
416 | 433 | } |
417 | 434 | |
418 | 435 | //---------------------------------------------------------------------- |
436 | + |
|
437 | + /** |
|
438 | + * @param integer $version |
|
439 | + */ |
|
419 | 440 | public static function getRemainder($version) |
420 | 441 | { |
421 | 442 | return self::$capacity[$version][QRCAP_REMINDER]; |
422 | 443 | } |
423 | 444 | |
424 | 445 | //---------------------------------------------------------------------- |
446 | + |
|
447 | + /** |
|
448 | + * @param integer $size |
|
449 | + */ |
|
425 | 450 | public static function getMinimumVersion($size, $level) |
426 | 451 | { |
427 | 452 | |
@@ -535,6 +560,9 @@ discard block |
||
535 | 560 | //---------------------------------------------------------------------- |
536 | 561 | // CACHEABLE!!! |
537 | 562 | |
563 | + /** |
|
564 | + * @param integer $version |
|
565 | + */ |
|
538 | 566 | public static function getEccSpec($version, $level, array &$spec) |
539 | 567 | { |
540 | 568 | if (count($spec) < 5) { |
@@ -857,12 +885,20 @@ discard block |
||
857 | 885 | } |
858 | 886 | |
859 | 887 | //---------------------------------------------------------------------- |
888 | + |
|
889 | + /** |
|
890 | + * @param string $code |
|
891 | + */ |
|
860 | 892 | public static function unserial($code) |
861 | 893 | { |
862 | 894 | return explode("\n", gzuncompress($code)); |
863 | 895 | } |
864 | 896 | |
865 | 897 | //---------------------------------------------------------------------- |
898 | + |
|
899 | + /** |
|
900 | + * @param integer $version |
|
901 | + */ |
|
866 | 902 | public static function newFrame($version) |
867 | 903 | { |
868 | 904 | if($version < 1 || $version > QRSPEC_VERSION_MAX) |
@@ -1236,6 +1272,10 @@ discard block |
||
1236 | 1272 | } |
1237 | 1273 | |
1238 | 1274 | //---------------------------------------------------------------------- |
1275 | + |
|
1276 | + /** |
|
1277 | + * @param integer $version |
|
1278 | + */ |
|
1239 | 1279 | public function encodeBitStream($version) |
1240 | 1280 | { |
1241 | 1281 | try { |
@@ -1313,6 +1353,10 @@ discard block |
||
1313 | 1353 | } |
1314 | 1354 | |
1315 | 1355 | //---------------------------------------------------------------------- |
1356 | + |
|
1357 | + /** |
|
1358 | + * @param integer $version |
|
1359 | + */ |
|
1316 | 1360 | public function setVersion($version) |
1317 | 1361 | { |
1318 | 1362 | if($version < 0 || $version > QRSPEC_VERSION_MAX) { |
@@ -1351,6 +1395,12 @@ discard block |
||
1351 | 1395 | } |
1352 | 1396 | |
1353 | 1397 | //---------------------------------------------------------------------- |
1398 | + |
|
1399 | + /** |
|
1400 | + * @param QRinput $mode |
|
1401 | + * @param integer $size |
|
1402 | + * @param integer $data |
|
1403 | + */ |
|
1354 | 1404 | public function append($mode, $size, $data) |
1355 | 1405 | { |
1356 | 1406 | try { |
@@ -1446,6 +1496,10 @@ discard block |
||
1446 | 1496 | ]; |
1447 | 1497 | |
1448 | 1498 | //---------------------------------------------------------------------- |
1499 | + |
|
1500 | + /** |
|
1501 | + * @param integer $c |
|
1502 | + */ |
|
1449 | 1503 | public static function lookAnTable($c) |
1450 | 1504 | { |
1451 | 1505 | return (($c > 127)?-1:self::$anTable[$c]); |
@@ -1531,6 +1585,10 @@ discard block |
||
1531 | 1585 | |
1532 | 1586 | |
1533 | 1587 | //---------------------------------------------------------------------- |
1588 | + |
|
1589 | + /** |
|
1590 | + * @param integer $version |
|
1591 | + */ |
|
1534 | 1592 | public function estimateBitStreamSize($version) |
1535 | 1593 | { |
1536 | 1594 | $bits = 0; |
@@ -1648,6 +1706,10 @@ discard block |
||
1648 | 1706 | } |
1649 | 1707 | |
1650 | 1708 | //---------------------------------------------------------------------- |
1709 | + |
|
1710 | + /** |
|
1711 | + * @param QRbitstream $bstream |
|
1712 | + */ |
|
1651 | 1713 | public function appendPaddingBit(&$bstream) |
1652 | 1714 | { |
1653 | 1715 | $bits = $bstream->size(); |
@@ -1977,6 +2039,10 @@ discard block |
||
1977 | 2039 | public $modeHint; |
1978 | 2040 | |
1979 | 2041 | //---------------------------------------------------------------------- |
2042 | + |
|
2043 | + /** |
|
2044 | + * @param QRinput $input |
|
2045 | + */ |
|
1980 | 2046 | public function __construct($dataStr, $input, $modeHint) |
1981 | 2047 | { |
1982 | 2048 | $this->dataStr = $dataStr; |
@@ -1985,6 +2051,10 @@ discard block |
||
1985 | 2051 | } |
1986 | 2052 | |
1987 | 2053 | //---------------------------------------------------------------------- |
2054 | + |
|
2055 | + /** |
|
2056 | + * @param string $str |
|
2057 | + */ |
|
1988 | 2058 | public static function isdigitat($str, $pos) |
1989 | 2059 | { |
1990 | 2060 | if ($pos >= strlen($str)) |
@@ -1994,6 +2064,10 @@ discard block |
||
1994 | 2064 | } |
1995 | 2065 | |
1996 | 2066 | //---------------------------------------------------------------------- |
2067 | + |
|
2068 | + /** |
|
2069 | + * @param string $str |
|
2070 | + */ |
|
1997 | 2071 | public static function isalnumat($str, $pos) |
1998 | 2072 | { |
1999 | 2073 | if ($pos >= strlen($str)) |
@@ -2114,6 +2188,10 @@ discard block |
||
2114 | 2188 | } |
2115 | 2189 | |
2116 | 2190 | //---------------------------------------------------------------------- |
2191 | + |
|
2192 | + /** |
|
2193 | + * @return integer |
|
2194 | + */ |
|
2117 | 2195 | public function eatKanji() |
2118 | 2196 | { |
2119 | 2197 | $p = 0; |
@@ -2447,6 +2525,13 @@ discard block |
||
2447 | 2525 | public static $items = []; |
2448 | 2526 | |
2449 | 2527 | //---------------------------------------------------------------------- |
2528 | + |
|
2529 | + /** |
|
2530 | + * @param integer $symsize |
|
2531 | + * @param integer $gfpoly |
|
2532 | + * @param integer $fcr |
|
2533 | + * @param integer $prim |
|
2534 | + */ |
|
2450 | 2535 | public static function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) |
2451 | 2536 | { |
2452 | 2537 | foreach(self::$items as $rs) { |
@@ -2601,6 +2686,10 @@ discard block |
||
2601 | 2686 | } |
2602 | 2687 | |
2603 | 2688 | //---------------------------------------------------------------------- |
2689 | + |
|
2690 | + /** |
|
2691 | + * @param string $code |
|
2692 | + */ |
|
2604 | 2693 | public static function unserial($code) |
2605 | 2694 | { |
2606 | 2695 | $codeArr = []; |
@@ -2661,6 +2750,10 @@ discard block |
||
2661 | 2750 | } |
2662 | 2751 | |
2663 | 2752 | //---------------------------------------------------------------------- |
2753 | + |
|
2754 | + /** |
|
2755 | + * @param integer $length |
|
2756 | + */ |
|
2664 | 2757 | public function calcN1N3($length) |
2665 | 2758 | { |
2666 | 2759 | $demerit = 0; |
@@ -2971,6 +3064,10 @@ discard block |
||
2971 | 3064 | public $data; |
2972 | 3065 | |
2973 | 3066 | //---------------------------------------------------------------------- |
3067 | + |
|
3068 | + /** |
|
3069 | + * @param integer $mask |
|
3070 | + */ |
|
2974 | 3071 | public function encodeMask(QRinput $input, $mask) |
2975 | 3072 | { |
2976 | 3073 | if($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) { |
@@ -3052,6 +3149,11 @@ discard block |
||
3052 | 3149 | } |
3053 | 3150 | |
3054 | 3151 | //---------------------------------------------------------------------- |
3152 | + |
|
3153 | + /** |
|
3154 | + * @param integer $version |
|
3155 | + * @param integer $level |
|
3156 | + */ |
|
3055 | 3157 | public function encodeString8bit($string, $version, $level) |
3056 | 3158 | { |
3057 | 3159 | if(string == NULL) { |
@@ -3071,6 +3173,12 @@ discard block |
||
3071 | 3173 | } |
3072 | 3174 | |
3073 | 3175 | //---------------------------------------------------------------------- |
3176 | + |
|
3177 | + /** |
|
3178 | + * @param integer $version |
|
3179 | + * @param integer $level |
|
3180 | + * @param boolean $casesensitive |
|
3181 | + */ |
|
3074 | 3182 | public function encodeString($string, $version, $level, $hint, $casesensitive) |
3075 | 3183 | { |
3076 | 3184 |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * supported EAP types from the DB and stores them in the priv_ arrays. |
74 | 74 | * |
75 | 75 | * @param int $p_id identifier of the profile in the DB |
76 | - * @param IdP $idp_object optionally, the institution to which this Profile belongs. Saves the construction of the IdP instance. If omitted, an extra query and instantiation is executed to find out. |
|
76 | + * @param integer $idp_object optionally, the institution to which this Profile belongs. Saves the construction of the IdP instance. If omitted, an extra query and instantiation is executed to find out. |
|
77 | 77 | */ |
78 | 78 | public function __construct($p_id, $idp_object = 0) { |
79 | 79 | debug(3, "--- BEGIN Constructing new Profile object ... ---\n"); |
@@ -372,6 +372,8 @@ discard block |
||
372 | 372 | * |
373 | 373 | * @param string device the device identifier string |
374 | 374 | * @param string path the path where the new installer can be found |
375 | + * @param string $device |
|
376 | + * @param string $path |
|
375 | 377 | */ |
376 | 378 | public function updateCache($device, $path,$mime) { |
377 | 379 | $device = DBConnection::escape_value(Profile::$DB_TYPE, $device); |
@@ -384,9 +386,9 @@ discard block |
||
384 | 386 | /** |
385 | 387 | * Log a new download for our stats |
386 | 388 | * |
387 | - * @param device the device id string |
|
388 | - * @param area either admin or user |
|
389 | - * @return TRUE if incrementing worked, FALSE if not |
|
389 | + * @param device string device id string |
|
390 | + * @param area string admin or user |
|
391 | + * @return boolean if incrementing worked, FALSE if not |
|
390 | 392 | */ |
391 | 393 | public function incrementDownloadStats($device, $area) { |
392 | 394 | $device = DBConnection::escape_value(Profile::$DB_TYPE, $device); |
@@ -399,7 +401,7 @@ discard block |
||
399 | 401 | |
400 | 402 | /** |
401 | 403 | * Retrieve current download stats from database, either for one specific device or for all devices |
402 | - * @param string $device the device id string |
|
404 | + * @param integer $device the device id string |
|
403 | 405 | * @return mixed user downloads of this profile; if device is given, returns the counter as int, otherwise an array with devicename => counter |
404 | 406 | */ |
405 | 407 | public function getUserDownloadStats($device = 0) { |
@@ -464,7 +466,7 @@ discard block |
||
464 | 466 | * @param string $attr_name name of the attribute to set |
465 | 467 | * @param string $attr_value value of the attribute to set |
466 | 468 | * @param int $eap_type identifier of the EAP type in the database. 0 if the attribute is valid for all EAP types. |
467 | - * @param string $device identifier of the device in the databse. Omit the argument if attribute is valid for all devices. |
|
469 | + * @param integer $device identifier of the device in the databse. Omit the argument if attribute is valid for all devices. |
|
468 | 470 | */ |
469 | 471 | public function addAttribute($attr_name, $attr_value, $eap_type, $device = 0) { |
470 | 472 | $attr_name = DBConnection::escape_value(Profile::$DB_TYPE, $attr_name); |
@@ -574,7 +576,7 @@ discard block |
||
574 | 576 | /** Returns an array of the profile's attributes. |
575 | 577 | * |
576 | 578 | * @param string option_name the name of a specific option. If set, only returns option values for this option name |
577 | - * @param eapmethod the EAP type, in array ("OUTER/INNER") notation. If set, returns only attributes which are specific to that EAP type |
|
579 | + * @param eapmethod integer EAP type, in array ("OUTER/INNER") notation. If set, returns only attributes which are specific to that EAP type |
|
578 | 580 | * @param string device the device ID string. If set, returns only attributes which are specific to that device |
579 | 581 | * @return array attributes of the profile |
580 | 582 | */ |
@@ -658,7 +660,7 @@ discard block |
||
658 | 660 | /** |
659 | 661 | * list all devices marking their availabiblity and possible redirects |
660 | 662 | * |
661 | - * @param string $locale for text-based attributes, either returns values for the default value, or if specified here, in the locale specified |
|
663 | + * @param integer $locale for text-based attributes, either returns values for the default value, or if specified here, in the locale specified |
|
662 | 664 | * @return array of device ids display names and their status |
663 | 665 | */ |
664 | 666 | public function listDevices($locale = 0) { |
@@ -713,7 +715,7 @@ discard block |
||
713 | 715 | * as wel as the chosen language. |
714 | 716 | * can be called with an optional $eap argument |
715 | 717 | * |
716 | - * @param array $eap if specified, retrieves attributes specific to the given EAP type |
|
718 | + * @param integer $eap if specified, retrieves attributes specific to the given EAP type |
|
717 | 719 | * @return array list of attributes in collapsed style (index is the attrib name, value is an array of different values) |
718 | 720 | */ |
719 | 721 | public function getCollapsedAttributes($eap = 0) { |