Completed
Pull Request — master (#2345)
by ྅༻ Ǭɀħ
01:36
created
includes/functions-infos.php 1 patch
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -310,6 +310,8 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
includes/functions-plugins.php 1 patch
Doc Comments   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
includes/functions-l10n.php 1 patch
Doc Comments   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -117,7 +117,6 @@  discard block
 block discarded – undo
117 117
  * @since 1.6
118 118
  *
119 119
  * @param string $pattern Text to translate
120
- * @param string $arg1, $arg2... Optional: sprintf tokens, and translation domain
121 120
  * @return string Translated text
122 121
  */
123 122
 function yourls_s( $pattern ) {
@@ -159,7 +158,6 @@  discard block
 block discarded – undo
159 158
  * @since 1.6
160 159
  *
161 160
  * @param string $pattern Text to translate
162
- * @param string $arg1, $arg2... Optional: sprintf tokens, and translation domain
163 161
  * @return string Translated text
164 162
  */
165 163
 function yourls_se( $pattern ) {
@@ -347,6 +345,7 @@  discard block
 block discarded – undo
347 345
  * @see yourls_n()
348 346
  * @see yourls_x()
349 347
  *
348
+ * @param integer $number
350 349
  */
351 350
 function yourls_nx($single, $plural, $number, $context, $domain = 'default') {
352 351
 	$translations = yourls_get_translations_for_domain( $domain );
@@ -503,7 +502,7 @@  discard block
 block discarded – undo
503 502
  * translated (.mo) file is named based on the locale.
504 503
  *
505 504
  * @since 1.6
506
- * @return bool True on success, false on failure
505
+ * @return boolean|null True on success, false on failure
507 506
  */
508 507
 function yourls_load_default_textdomain() {
509 508
 	$yourls_locale = yourls_get_locale();
@@ -683,7 +682,7 @@  discard block
 block discarded – undo
683 682
  * @since 1.6
684 683
  *
685 684
  * @param string $type Either 'mysql' or 'timestamp'.
686
- * @param int|bool $gmt Optional. Whether to use GMT timezone. Default is false.
685
+ * @param integer $gmt Optional. Whether to use GMT timezone. Default is false.
687 686
  * @return int|string String if $type is 'gmt', int if $type is 'timestamp'.
688 687
  */
689 688
 function yourls_current_time( $type, $gmt = 0 ) {
@@ -1040,7 +1039,7 @@  discard block
 block discarded – undo
1040 1039
  *
1041 1040
  * @param string $domain Unique identifier (the "domain") for retrieving translated strings
1042 1041
  * @param string $path Full path to directory containing MO files.
1043
- * @return mixed Returns nothing if locale undefined, otherwise return bool: true on success, false on failure
1042
+ * @return boolean|null Returns nothing if locale undefined, otherwise return bool: true on success, false on failure
1044 1043
  */
1045 1044
 function yourls_load_custom_textdomain( $domain, $path ) {
1046 1045
 	$locale = yourls_apply_filter( 'load_custom_textdomain', yourls_get_locale(), $domain );
Please login to merge, or discard this patch.
includes/functions-install.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
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 ) {
Please login to merge, or discard this patch.
includes/functions-formatting.php 1 patch
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,6 +129,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
  */
Please login to merge, or discard this patch.
includes/functions-html.php 1 patch
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -505,6 +505,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
includes/functions.php 1 patch
Doc Comments   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,6 +37,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
@@ -768,6 +772,7 @@  discard block
 block discarded – undo
768 772
 /**
769 773
  * Return a HTTP status code
770 774
  *
775
+ * @param integer $code
771 776
  */
772 777
 function yourls_get_HTTP_status( $code ) {
773 778
 	$code = intval( $code );
@@ -882,7 +887,7 @@  discard block
 block discarded – undo
882 887
  *
883 888
  * @since 1.4
884 889
  * @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...)
890
+ * @param string $default Default string to return if IP doesn't resolve to a country (malformed, private IP...)
886 891
  * @return string 2 letter country code (eg 'US') or $default
887 892
  */
888 893
 function yourls_geo_ip_to_countrycode( $ip = '', $default = '' ) {
@@ -1508,9 +1513,6 @@  discard block
 block discarded – undo
1508 1513
  * The result of this function call is a URL : it should be escaped before being printed as HTML
1509 1514
  *
1510 1515
  * @since 1.5
1511
- * @param string|array $param1 Either newkey or an associative_array.
1512
- * @param string       $param2 Either newvalue or oldquery or URI.
1513
- * @param string       $param3 Optional. Old query or URI.
1514 1516
  * @return string New URL query string.
1515 1517
  */
1516 1518
 function yourls_add_query_arg() {
@@ -1631,6 +1633,7 @@  discard block
 block discarded – undo
1631 1633
 /**
1632 1634
  * Create a nonce field for inclusion into a form
1633 1635
  *
1636
+ * @param string $action
1634 1637
  */
1635 1638
 function yourls_nonce_field( $action, $name = 'nonce', $user = false, $echo = true ) {
1636 1639
 	$field = '<input type="hidden" id="'.$name.'" name="'.$name.'" value="'.yourls_create_nonce( $action, $user ).'" />';
@@ -1642,6 +1645,7 @@  discard block
 block discarded – undo
1642 1645
 /**
1643 1646
  * Add a nonce to a URL. If URL omitted, adds nonce to current URL
1644 1647
  *
1648
+ * @param string $action
1645 1649
  */
1646 1650
 function yourls_nonce_url( $action, $url = false, $name = 'nonce', $user = false ) {
1647 1651
 	$nonce = yourls_create_nonce( $action, $user );
@@ -1654,6 +1658,7 @@  discard block
 block discarded – undo
1654 1658
  * Returns true if valid, dies otherwise (yourls_die() or die($return) if defined)
1655 1659
  * if $nonce is false or unspecified, it will use $_REQUEST['nonce']
1656 1660
  *
1661
+ * @param string $action
1657 1662
  */
1658 1663
 function yourls_verify_nonce( $action, $nonce = false, $user = false, $return = '' ) {
1659 1664
 	// get user
@@ -1956,6 +1961,7 @@  discard block
 block discarded – undo
1956 1961
 /**
1957 1962
  * Change protocol to match current scheme used (http or https)
1958 1963
  *
1964
+ * @param string $url
1959 1965
  */
1960 1966
 function yourls_match_current_protocol( $url, $normal = 'http://', $ssl = 'https://' ) {
1961 1967
 	if( yourls_is_ssl() )
@@ -2083,7 +2089,7 @@  discard block
 block discarded – undo
2083 2089
 /**
2084 2090
  * Return current admin page, or null if not an admin page
2085 2091
  *
2086
- * @return mixed string if admin page, null if not an admin page
2092
+ * @return string|null string if admin page, null if not an admin page
2087 2093
  * @since 1.6
2088 2094
  */
2089 2095
 function yourls_current_admin_page() {
Please login to merge, or discard this patch.
includes/Config/Config.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -50,6 +50,7 @@
 block discarded – undo
50 50
     /**
51 51
      * @since  1.7.3
52 52
      * @param  string  path to YOURLS root directory
53
+     * @param string $root
53 54
      * @return void
54 55
      */
55 56
     public function set_root($root) {
Please login to merge, or discard this patch.