@@ -4,7 +4,6 @@ |
||
4 | 4 | * Pick the right DB class and return an instance |
5 | 5 | * |
6 | 6 | * @since 1.7 |
7 | - * @param string $extension Optional: user defined choice |
|
8 | 7 | * @return class $ydb DB class instance |
9 | 8 | */ |
10 | 9 | function yourls_set_DB_driver( ) { |
@@ -67,6 +67,9 @@ discard block |
||
67 | 67 | * Returns array of host and port. If port is omitted, returns $default |
68 | 68 | */ |
69 | 69 | |
70 | + /** |
|
71 | + * @param string $host |
|
72 | + */ |
|
70 | 73 | function get_host_port( $host, $default = false ) |
71 | 74 | { |
72 | 75 | $port = $default; |
@@ -294,6 +297,10 @@ discard block |
||
294 | 297 | * store_cache |
295 | 298 | */ |
296 | 299 | |
300 | + /** |
|
301 | + * @param string $query |
|
302 | + * @param boolean $is_insert |
|
303 | + */ |
|
297 | 304 | function store_cache($query,$is_insert) |
298 | 305 | { |
299 | 306 | |
@@ -330,6 +337,9 @@ discard block |
||
330 | 337 | * get_cache |
331 | 338 | */ |
332 | 339 | |
340 | + /** |
|
341 | + * @param string $query |
|
342 | + */ |
|
333 | 343 | function get_cache($query) |
334 | 344 | { |
335 | 345 | |
@@ -551,6 +561,9 @@ discard block |
||
551 | 561 | return round($this->timer_get_cur() - $this->timers[$timer_name],2); |
552 | 562 | } |
553 | 563 | |
564 | + /** |
|
565 | + * @param integer $timer_name |
|
566 | + */ |
|
554 | 567 | function timer_update_global($timer_name) |
555 | 568 | { |
556 | 569 | if ( $this->do_profile ) |
@@ -108,6 +108,8 @@ discard block |
||
108 | 108 | * |
109 | 109 | * Stolen from WP's _deep_replace |
110 | 110 | * |
111 | + * @param string[] $search |
|
112 | + * @param string $subject |
|
111 | 113 | */ |
112 | 114 | function yourls_deep_replace( $search, $subject ){ |
113 | 115 | $found = true; |
@@ -163,7 +165,6 @@ discard block |
||
163 | 165 | * escape function using filter 'custom_escape_real' |
164 | 166 | * |
165 | 167 | * @since 1.7 |
166 | - * @param string $a string to be escaped |
|
167 | 168 | * @return string escaped string |
168 | 169 | */ |
169 | 170 | function yourls_escape_real( $string ) { |
@@ -325,7 +326,7 @@ discard block |
||
325 | 326 | * @since 1.6 |
326 | 327 | * |
327 | 328 | * @param string $string The text which is to be encoded. |
328 | - * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES. |
|
329 | + * @param integer $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES. |
|
329 | 330 | * @param boolean $double_encode Optional. Whether to encode existing html entities. Default is false. |
330 | 331 | * @return string The encoded text with HTML entities. |
331 | 332 | */ |
@@ -480,6 +480,8 @@ discard block |
||
480 | 480 | /** |
481 | 481 | * Return an "Add" row for the main table |
482 | 482 | * |
483 | + * @param integer $clicks |
|
484 | + * @param integer $timestamp |
|
483 | 485 | * @return string HTML of the edit row |
484 | 486 | */ |
485 | 487 | function yourls_table_add_row( $keyword, $url, $title = '', $ip, $clicks, $timestamp ) { |
@@ -798,6 +800,7 @@ discard block |
||
798 | 800 | /** |
799 | 801 | * Wrapper function to display admin notices |
800 | 802 | * |
803 | + * @param string $message |
|
801 | 804 | */ |
802 | 805 | function yourls_add_notice( $message, $style = 'notice' ) { |
803 | 806 | // Escape single quotes in $message to avoid breaking the anonymous function |
@@ -808,6 +811,7 @@ discard block |
||
808 | 811 | /** |
809 | 812 | * Return a formatted notice |
810 | 813 | * |
814 | + * @param string $message |
|
811 | 815 | */ |
812 | 816 | function yourls_notice_box( $message, $style = 'notice' ) { |
813 | 817 | return <<<HTML |
@@ -310,6 +310,8 @@ |
||
310 | 310 | /** |
311 | 311 | * Return javascript code that will display the Google Chart |
312 | 312 | * |
313 | + * @param string $graph_type |
|
314 | + * @param string $data |
|
313 | 315 | */ |
314 | 316 | function yourls_google_viz_code( $graph_type, $data, $options, $id ) { |
315 | 317 | $function_name = 'yourls_graph' . $id; |
@@ -136,7 +136,7 @@ |
||
136 | 136 | * |
137 | 137 | * @param string $filename |
138 | 138 | * @param string $marker |
139 | - * @param array $insertion |
|
139 | + * @param string[] $insertion |
|
140 | 140 | * @return bool True on write success, false on failure. |
141 | 141 | */ |
142 | 142 | function yourls_insert_with_markers( $filename, $marker, $insertion ) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @global array $yourls_filters storage for all of the filters |
80 | 80 | * @param string $hook hook to which the function is attached |
81 | - * @param string|array $function used for creating unique id |
|
81 | + * @param callable $function used for creating unique id |
|
82 | 82 | * @param int|bool $priority used in counting how many hooks were applied. If === false and $function is an object reference, we return the unique id only if it already has one, false otherwise. |
83 | 83 | * @return string unique ID for usage as array key |
84 | 84 | */ |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | * Activate a plugin |
459 | 459 | * |
460 | 460 | * @param string $plugin Plugin filename (full or relative to plugins directory) |
461 | - * @return mixed string if error or true if success |
|
461 | + * @return string|boolean string if error or true if success |
|
462 | 462 | */ |
463 | 463 | function yourls_activate_plugin( $plugin ) { |
464 | 464 | // validate file |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | * Deactivate a plugin |
498 | 498 | * |
499 | 499 | * @param string $plugin Plugin filename (full relative to plugins directory) |
500 | - * @return mixed string if error or true if success |
|
500 | + * @return string|boolean string if error or true if success |
|
501 | 501 | */ |
502 | 502 | function yourls_deactivate_plugin( $plugin ) { |
503 | 503 | $plugin = yourls_plugin_basename( $plugin ); |
@@ -561,6 +561,9 @@ discard block |
||
561 | 561 | |
562 | 562 | /** |
563 | 563 | * Register a plugin administration page |
564 | + * @param string $slug |
|
565 | + * @param string $title |
|
566 | + * @param string $function |
|
564 | 567 | */ |
565 | 568 | function yourls_register_plugin_page( $slug, $title, $function ) { |
566 | 569 | global $ydb; |
@@ -261,6 +261,9 @@ discard block |
||
261 | 261 | } // function_exists |
262 | 262 | |
263 | 263 | if( !function_exists('_setup_segments') ) { |
264 | +/** |
|
265 | + * @param GeoIP $gi |
|
266 | + */ |
|
264 | 267 | function _setup_segments($gi){ |
265 | 268 | $gi->databaseType = GEOIP_COUNTRY_EDITION; |
266 | 269 | $gi->record_length = STANDARD_RECORD_LENGTH; |
@@ -384,6 +387,10 @@ discard block |
||
384 | 387 | } // function_exists |
385 | 388 | |
386 | 389 | if( !function_exists( 'geoip_open' ) ) { |
390 | +/** |
|
391 | + * @param string $filename |
|
392 | + * @param integer $flags |
|
393 | + */ |
|
387 | 394 | function geoip_open($filename, $flags) { |
388 | 395 | $gi = new GeoIP; |
389 | 396 | $gi->flags = $flags; |
@@ -666,6 +673,9 @@ discard block |
||
666 | 673 | } // function_exists |
667 | 674 | |
668 | 675 | if( !function_exists( '_get_org_v6' ) ) { |
676 | +/** |
|
677 | + * @param string $ipnum |
|
678 | + */ |
|
669 | 679 | function _get_org_v6($gi,$ipnum){ |
670 | 680 | $seek_org = _geoip_seek_country_v6($gi,$ipnum); |
671 | 681 | if ($seek_org == $gi->databaseSegments) { |
@@ -676,6 +686,9 @@ discard block |
||
676 | 686 | } // function_exists |
677 | 687 | |
678 | 688 | if( !function_exists( '_get_org' ) ) { |
689 | +/** |
|
690 | + * @param integer $ipnum |
|
691 | + */ |
|
679 | 692 | function _get_org($gi,$ipnum){ |
680 | 693 | $seek_org = _geoip_seek_country($gi,$ipnum); |
681 | 694 | if ($seek_org == $gi->databaseSegments) { |
@@ -714,6 +727,9 @@ discard block |
||
714 | 727 | } // function_exists |
715 | 728 | |
716 | 729 | if( !function_exists( '_get_region' ) ) { |
730 | +/** |
|
731 | + * @param integer $ipnum |
|
732 | + */ |
|
717 | 733 | function _get_region($gi,$ipnum){ |
718 | 734 | if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){ |
719 | 735 | $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0; |
@@ -363,6 +363,7 @@ discard block |
||
363 | 363 | /** |
364 | 364 | * Update a title link (no checks for duplicates etc..) |
365 | 365 | * |
366 | + * @param string $title |
|
366 | 367 | */ |
367 | 368 | function yourls_edit_link_title( $keyword, $title ) { |
368 | 369 | // Allow plugins to short-circuit the whole function |
@@ -458,6 +459,7 @@ discard block |
||
458 | 459 | /** |
459 | 460 | * Return (string) selected information associated with a keyword. Optional $notfound = string default message if nothing found |
460 | 461 | * |
462 | + * @param string $field |
|
461 | 463 | */ |
462 | 464 | function yourls_get_keyword_info( $keyword, $field, $notfound = false ) { |
463 | 465 | |
@@ -677,6 +679,7 @@ discard block |
||
677 | 679 | /** |
678 | 680 | * Redirect to another page |
679 | 681 | * |
682 | + * @param string $location |
|
680 | 683 | */ |
681 | 684 | function yourls_redirect( $location, $code = 301 ) { |
682 | 685 | yourls_do_action( 'pre_redirect', $location, $code ); |
@@ -741,6 +744,7 @@ discard block |
||
741 | 744 | /** |
742 | 745 | * Return a HTTP status code |
743 | 746 | * |
747 | + * @param integer $code |
|
744 | 748 | */ |
745 | 749 | function yourls_get_HTTP_status( $code ) { |
746 | 750 | $code = intval( $code ); |
@@ -853,7 +857,7 @@ discard block |
||
853 | 857 | * |
854 | 858 | * @since 1.4 |
855 | 859 | * @param string $ip IP or, if empty string, will be current user IP |
856 | - * @param string $defaut Default string to return if IP doesn't resolve to a country (malformed, private IP...) |
|
860 | + * @param string $default Default string to return if IP doesn't resolve to a country (malformed, private IP...) |
|
857 | 861 | * @return string 2 letter country code (eg 'US') or $default |
858 | 862 | */ |
859 | 863 | function yourls_geo_ip_to_countrycode( $ip = '', $default = '' ) { |
@@ -967,7 +971,7 @@ discard block |
||
967 | 971 | * Pretty much stolen from WordPress |
968 | 972 | * |
969 | 973 | * @since 1.4 |
970 | - * @param string $option Option name. Expected to not be SQL-escaped. |
|
974 | + * @param string $option_name Option name. Expected to not be SQL-escaped. |
|
971 | 975 | * @param mixed $default Optional value to return if option doesn't exist. Default false. |
972 | 976 | * @return mixed Value set for the option. |
973 | 977 | */ |
@@ -1039,7 +1043,7 @@ discard block |
||
1039 | 1043 | * Pretty much stolen from WordPress |
1040 | 1044 | * |
1041 | 1045 | * @since 1.4 |
1042 | - * @param string $option Option name. Expected to not be SQL-escaped. |
|
1046 | + * @param string $option_name Option name. Expected to not be SQL-escaped. |
|
1043 | 1047 | * @param mixed $newvalue Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. |
1044 | 1048 | * @return bool False if value was not updated, true otherwise. |
1045 | 1049 | */ |
@@ -1087,7 +1091,6 @@ discard block |
||
1087 | 1091 | * Pretty much stolen from WordPress |
1088 | 1092 | * |
1089 | 1093 | * @since 1.4 |
1090 | - * @param string $option Name of option to add. Expected to not be SQL-escaped. |
|
1091 | 1094 | * @param mixed $value Optional option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. |
1092 | 1095 | * @return bool False if option was not added and true otherwise. |
1093 | 1096 | */ |
@@ -1125,7 +1128,6 @@ discard block |
||
1125 | 1128 | * Pretty much stolen from WordPress |
1126 | 1129 | * |
1127 | 1130 | * @since 1.4 |
1128 | - * @param string $option Option name to delete. Expected to not be SQL-escaped. |
|
1129 | 1131 | * @return bool True, if option is successfully deleted. False on failure. |
1130 | 1132 | */ |
1131 | 1133 | function yourls_delete_option( $name ) { |
@@ -1492,9 +1494,6 @@ discard block |
||
1492 | 1494 | * The result of this function call is a URL : it should be escaped before being printed as HTML |
1493 | 1495 | * |
1494 | 1496 | * @since 1.5 |
1495 | - * @param string|array $param1 Either newkey or an associative_array. |
|
1496 | - * @param string $param2 Either newvalue or oldquery or URI. |
|
1497 | - * @param string $param3 Optional. Old query or URI. |
|
1498 | 1497 | * @return string New URL query string. |
1499 | 1498 | */ |
1500 | 1499 | function yourls_add_query_arg() { |
@@ -1615,6 +1614,7 @@ discard block |
||
1615 | 1614 | /** |
1616 | 1615 | * Create a nonce field for inclusion into a form |
1617 | 1616 | * |
1617 | + * @param string $action |
|
1618 | 1618 | */ |
1619 | 1619 | function yourls_nonce_field( $action, $name = 'nonce', $user = false, $echo = true ) { |
1620 | 1620 | $field = '<input type="hidden" id="'.$name.'" name="'.$name.'" value="'.yourls_create_nonce( $action, $user ).'" />'; |
@@ -1626,6 +1626,7 @@ discard block |
||
1626 | 1626 | /** |
1627 | 1627 | * Add a nonce to a URL. If URL omitted, adds nonce to current URL |
1628 | 1628 | * |
1629 | + * @param string $action |
|
1629 | 1630 | */ |
1630 | 1631 | function yourls_nonce_url( $action, $url = false, $name = 'nonce', $user = false ) { |
1631 | 1632 | $nonce = yourls_create_nonce( $action, $user ); |
@@ -1638,6 +1639,7 @@ discard block |
||
1638 | 1639 | * Returns true if valid, dies otherwise (yourls_die() or die($return) if defined) |
1639 | 1640 | * if $nonce is false or unspecified, it will use $_REQUEST['nonce'] |
1640 | 1641 | * |
1642 | + * @param string $action |
|
1641 | 1643 | */ |
1642 | 1644 | function yourls_verify_nonce( $action, $nonce = false, $user = false, $return = '' ) { |
1643 | 1645 | // get user |
@@ -1926,6 +1928,7 @@ discard block |
||
1926 | 1928 | /** |
1927 | 1929 | * Change protocol to match current scheme used (http or https) |
1928 | 1930 | * |
1931 | + * @param string $url |
|
1929 | 1932 | */ |
1930 | 1933 | function yourls_match_current_protocol( $url, $normal = 'http://', $ssl = 'https://' ) { |
1931 | 1934 | if( yourls_is_ssl() ) |
@@ -2053,7 +2056,7 @@ discard block |
||
2053 | 2056 | /** |
2054 | 2057 | * Return current admin page, or null if not an admin page |
2055 | 2058 | * |
2056 | - * @return mixed string if admin page, null if not an admin page |
|
2059 | + * @return string|null string if admin page, null if not an admin page |
|
2057 | 2060 | * @since 1.6 |
2058 | 2061 | */ |
2059 | 2062 | function yourls_current_admin_page() { |