@@ -146,7 +146,7 @@ |
||
146 | 146 | * |
147 | 147 | * @param string $filename |
148 | 148 | * @param string $marker |
149 | - * @param array $insertion |
|
149 | + * @param string[] $insertion |
|
150 | 150 | * @return bool True on write success, false on failure. |
151 | 151 | */ |
152 | 152 | function yourls_insert_with_markers( $filename, $marker, $insertion ) { |
@@ -129,6 +129,8 @@ discard block |
||
129 | 129 | * |
130 | 130 | * Stolen from WP's _deep_replace |
131 | 131 | * |
132 | + * @param string[] $search |
|
133 | + * @param string $subject |
|
132 | 134 | */ |
133 | 135 | function yourls_deep_replace( $search, $subject ){ |
134 | 136 | $found = true; |
@@ -309,7 +311,7 @@ discard block |
||
309 | 311 | * @since 1.6 |
310 | 312 | * |
311 | 313 | * @param string $string The text which is to be encoded. |
312 | - * @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. |
|
314 | + * @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. |
|
313 | 315 | * @param boolean $double_encode Optional. Whether to encode existing html entities. Default is false. |
314 | 316 | * @return string The encoded text with HTML entities. |
315 | 317 | */ |
@@ -505,6 +505,9 @@ discard block |
||
505 | 505 | /** |
506 | 506 | * Return an "Add" row for the main table |
507 | 507 | * |
508 | + * @param string $url |
|
509 | + * @param integer $clicks |
|
510 | + * @param integer $timestamp |
|
508 | 511 | * @return string HTML of the edit row |
509 | 512 | */ |
510 | 513 | function yourls_table_add_row( $keyword, $url, $title = '', $ip, $clicks, $timestamp ) { |
@@ -823,6 +826,7 @@ discard block |
||
823 | 826 | /** |
824 | 827 | * Wrapper function to display admin notices |
825 | 828 | * |
829 | + * @param string $message |
|
826 | 830 | */ |
827 | 831 | function yourls_add_notice( $message, $style = 'notice' ) { |
828 | 832 | // Escape single quotes in $message to avoid breaking the anonymous function |
@@ -833,6 +837,7 @@ discard block |
||
833 | 837 | /** |
834 | 838 | * Return a formatted notice |
835 | 839 | * |
840 | + * @param string $message |
|
836 | 841 | */ |
837 | 842 | function yourls_notice_box( $message, $style = 'notice' ) { |
838 | 843 | return <<<HTML |
@@ -37,6 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * Is a URL a short URL? Accept either 'http://sho.rt/abc' or 'abc' |
39 | 39 | * |
40 | + * @param string $shorturl |
|
40 | 41 | */ |
41 | 42 | function yourls_is_shorturl( $shorturl ) { |
42 | 43 | // TODO: make sure this function evolves with the feature set. |
@@ -140,6 +141,7 @@ discard block |
||
140 | 141 | /** |
141 | 142 | * SQL query to insert a new link in the DB. Returns boolean for success or failure of the inserting |
142 | 143 | * |
144 | + * @param string $url |
|
143 | 145 | */ |
144 | 146 | function yourls_insert_link_in_db( $url, $keyword, $title = '' ) { |
145 | 147 | global $ydb; |
@@ -380,6 +382,7 @@ discard block |
||
380 | 382 | /** |
381 | 383 | * Update a title link (no checks for duplicates etc..) |
382 | 384 | * |
385 | + * @param string $title |
|
383 | 386 | */ |
384 | 387 | function yourls_edit_link_title( $keyword, $title ) { |
385 | 388 | // Allow plugins to short-circuit the whole function |
@@ -482,6 +485,7 @@ discard block |
||
482 | 485 | /** |
483 | 486 | * Return (string) selected information associated with a keyword. Optional $notfound = string default message if nothing found |
484 | 487 | * |
488 | + * @param string $field |
|
485 | 489 | */ |
486 | 490 | function yourls_get_keyword_info( $keyword, $field, $notfound = false ) { |
487 | 491 | |
@@ -704,6 +708,7 @@ discard block |
||
704 | 708 | /** |
705 | 709 | * Redirect to another page |
706 | 710 | * |
711 | + * @param string $location |
|
707 | 712 | */ |
708 | 713 | function yourls_redirect( $location, $code = 301 ) { |
709 | 714 | yourls_do_action( 'pre_redirect', $location, $code ); |
@@ -768,6 +773,7 @@ discard block |
||
768 | 773 | /** |
769 | 774 | * Return a HTTP status code |
770 | 775 | * |
776 | + * @param integer $code |
|
771 | 777 | */ |
772 | 778 | function yourls_get_HTTP_status( $code ) { |
773 | 779 | $code = intval( $code ); |
@@ -882,7 +888,7 @@ discard block |
||
882 | 888 | * |
883 | 889 | * @since 1.4 |
884 | 890 | * @param string $ip IP or, if empty string, will be current user IP |
885 | - * @param string $defaut Default string to return if IP doesn't resolve to a country (malformed, private IP...) |
|
891 | + * @param string $default Default string to return if IP doesn't resolve to a country (malformed, private IP...) |
|
886 | 892 | * @return string 2 letter country code (eg 'US') or $default |
887 | 893 | */ |
888 | 894 | function yourls_geo_ip_to_countrycode( $ip = '', $default = '' ) { |
@@ -1510,9 +1516,6 @@ discard block |
||
1510 | 1516 | * The result of this function call is a URL : it should be escaped before being printed as HTML |
1511 | 1517 | * |
1512 | 1518 | * @since 1.5 |
1513 | - * @param string|array $param1 Either newkey or an associative_array. |
|
1514 | - * @param string $param2 Either newvalue or oldquery or URI. |
|
1515 | - * @param string $param3 Optional. Old query or URI. |
|
1516 | 1519 | * @return string New URL query string. |
1517 | 1520 | */ |
1518 | 1521 | function yourls_add_query_arg() { |
@@ -1633,6 +1636,7 @@ discard block |
||
1633 | 1636 | /** |
1634 | 1637 | * Create a nonce field for inclusion into a form |
1635 | 1638 | * |
1639 | + * @param string $action |
|
1636 | 1640 | */ |
1637 | 1641 | function yourls_nonce_field( $action, $name = 'nonce', $user = false, $echo = true ) { |
1638 | 1642 | $field = '<input type="hidden" id="'.$name.'" name="'.$name.'" value="'.yourls_create_nonce( $action, $user ).'" />'; |
@@ -1644,6 +1648,7 @@ discard block |
||
1644 | 1648 | /** |
1645 | 1649 | * Add a nonce to a URL. If URL omitted, adds nonce to current URL |
1646 | 1650 | * |
1651 | + * @param string $action |
|
1647 | 1652 | */ |
1648 | 1653 | function yourls_nonce_url( $action, $url = false, $name = 'nonce', $user = false ) { |
1649 | 1654 | $nonce = yourls_create_nonce( $action, $user ); |
@@ -1656,6 +1661,7 @@ discard block |
||
1656 | 1661 | * Returns true if valid, dies otherwise (yourls_die() or die($return) if defined) |
1657 | 1662 | * if $nonce is false or unspecified, it will use $_REQUEST['nonce'] |
1658 | 1663 | * |
1664 | + * @param string $action |
|
1659 | 1665 | */ |
1660 | 1666 | function yourls_verify_nonce( $action, $nonce = false, $user = false, $return = '' ) { |
1661 | 1667 | // get user |
@@ -1958,6 +1964,7 @@ discard block |
||
1958 | 1964 | /** |
1959 | 1965 | * Change protocol to match current scheme used (http or https) |
1960 | 1966 | * |
1967 | + * @param string $url |
|
1961 | 1968 | */ |
1962 | 1969 | function yourls_match_current_protocol( $url, $normal = 'http://', $ssl = 'https://' ) { |
1963 | 1970 | if( yourls_is_ssl() ) |
@@ -2085,7 +2092,7 @@ discard block |
||
2085 | 2092 | /** |
2086 | 2093 | * Return current admin page, or null if not an admin page |
2087 | 2094 | * |
2088 | - * @return mixed string if admin page, null if not an admin page |
|
2095 | + * @return string|null string if admin page, null if not an admin page |
|
2089 | 2096 | * @since 1.6 |
2090 | 2097 | */ |
2091 | 2098 | function yourls_current_admin_page() { |