@@ -699,8 +699,7 @@ discard block |
||
| 699 | 699 | * Render the events |
| 700 | 700 | * |
| 701 | 701 | * @param string $url (default: '') |
| 702 | - * @param string $context (default: 'widget') or 'shortcode' |
|
| 703 | - * @return mixed bool|string false on failure, rendered HTML string on success. |
|
| 702 | + * @return false|string bool|string false on failure, rendered HTML string on success. |
|
| 704 | 703 | */ |
| 705 | 704 | public function render( $url = '', $args = array() ) { |
| 706 | 705 | |
@@ -857,8 +856,7 @@ discard block |
||
| 857 | 856 | * Wrapper function for iCalendarReader->render() |
| 858 | 857 | * |
| 859 | 858 | * @param string $url (default: '') |
| 860 | - * @param string $context (default: 'widget') or 'shortcode' |
|
| 861 | - * @return mixed bool|string false on failure, rendered HTML string on success. |
|
| 859 | + * @return false|string bool|string false on failure, rendered HTML string on success. |
|
| 862 | 860 | */ |
| 863 | 861 | function icalendar_render_events( $url = '', $args = array() ) { |
| 864 | 862 | $ical = new iCalendarReader(); |
@@ -93,14 +93,24 @@ |
||
| 93 | 93 | * So that we can test. |
| 94 | 94 | */ |
| 95 | 95 | |
| 96 | + /** |
|
| 97 | + * @param string $class |
|
| 98 | + * @param string $method |
|
| 99 | + */ |
|
| 96 | 100 | public function method_exists( $class, $method ) { |
| 97 | 101 | return method_exists( $class, $method ); |
| 98 | 102 | } |
| 99 | 103 | |
| 104 | + /** |
|
| 105 | + * @param string $class |
|
| 106 | + */ |
|
| 100 | 107 | public function class_exists( $class ) { |
| 101 | 108 | return class_exists( $class ); |
| 102 | 109 | } |
| 103 | 110 | |
| 111 | + /** |
|
| 112 | + * @param string $function |
|
| 113 | + */ |
|
| 104 | 114 | public function function_exists( $function ) { |
| 105 | 115 | return function_exists( $function ); |
| 106 | 116 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | * @param string $url_orig Original URL. |
| 9 | 9 | * @param array $url_info Pieces of original URL. |
| 10 | 10 | * |
| 11 | - * @return bool |
|
| 11 | + * @return false|string |
|
| 12 | 12 | */ |
| 13 | 13 | function jetpack_no_qtranslate_rest_url_redirect( $url_lang, $url_orig, $url_info ) { |
| 14 | 14 | if ( false !== strpos( $url_info['wp-path'], 'wp-json/jetpack' ) ) { |
@@ -201,7 +201,7 @@ |
||
| 201 | 201 | * should be notified, overriding the site setting. |
| 202 | 202 | * |
| 203 | 203 | * @param int $comment_id Comment ID. |
| 204 | - * @return true Always returns true. |
|
| 204 | + * @return boolean Always returns true. |
|
| 205 | 205 | */ |
| 206 | 206 | function wp_notify_moderator( $comment_id ) { |
| 207 | 207 | global $wpdb; |
@@ -249,6 +249,9 @@ |
||
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | + /** |
|
| 253 | + * @param string $access_token |
|
| 254 | + */ |
|
| 252 | 255 | private static function verify_token( $access_token ) { |
| 253 | 256 | $request = array( |
| 254 | 257 | 'headers' => array( |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * |
| 86 | 86 | * @param $function array A function structure to apply to the query |
| 87 | 87 | * |
| 88 | - * @return void |
|
| 88 | + * @return Jetpack_WPES_Query_Builder |
|
| 89 | 89 | */ |
| 90 | 90 | public function add_weighting_function( $function ) { |
| 91 | 91 | $this->weighting_functions[] = $function; |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | * |
| 101 | 101 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html |
| 102 | 102 | * |
| 103 | - * @param $function string name of the function |
|
| 103 | + * @param string $function string name of the function |
|
| 104 | 104 | * @param $params array functions parameters |
| 105 | 105 | * |
| 106 | - * @return void |
|
| 106 | + * @return Jetpack_WPES_Query_Builder |
|
| 107 | 107 | */ |
| 108 | 108 | public function add_function( $function, $params ) { |
| 109 | 109 | $this->functions[ $function ][] = $params; |
@@ -119,10 +119,10 @@ discard block |
||
| 119 | 119 | * |
| 120 | 120 | * @see https://www.elastic.co/guide/en/elasticsearch/guide/current/decay-functions.html |
| 121 | 121 | * |
| 122 | - * @param $function string name of the decay function - linear, exp, or gauss |
|
| 122 | + * @param string $function string name of the decay function - linear, exp, or gauss |
|
| 123 | 123 | * @param $params array The decay functions parameters, passed to ES directly |
| 124 | 124 | * |
| 125 | - * @return void |
|
| 125 | + * @return Jetpack_WPES_Query_Builder |
|
| 126 | 126 | */ |
| 127 | 127 | public function add_decay( $function, $params ) { |
| 128 | 128 | $this->decays[ $function ][] = $params; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @param $mode string name of how to score |
| 139 | 139 | * |
| 140 | - * @return void |
|
| 140 | + * @return Jetpack_WPES_Query_Builder |
|
| 141 | 141 | */ |
| 142 | 142 | public function add_score_mode_to_functions( $mode='multiply' ) { |
| 143 | 143 | $this->functions_score_mode = $mode; |
@@ -163,6 +163,9 @@ discard block |
||
| 163 | 163 | return $this; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | + /** |
|
| 167 | + * @param string $aggs_name |
|
| 168 | + */ |
|
| 166 | 169 | public function add_aggs( $aggs_name, $aggs ) { |
| 167 | 170 | $this->aggs_query = true; |
| 168 | 171 | $this->aggs[$aggs_name] = $aggs; |
@@ -100,6 +100,10 @@ discard block |
||
| 100 | 100 | ), menu_page_url( 'sharing', false ) ); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | + /** |
|
| 104 | + * @param string $service_name |
|
| 105 | + * @param string $for |
|
| 106 | + */ |
|
| 103 | 107 | static function refresh_url( $service_name, $for ) { |
| 104 | 108 | return add_query_arg( array( |
| 105 | 109 | 'action' => 'request', |
@@ -111,6 +115,10 @@ discard block |
||
| 111 | 115 | ), admin_url( 'options-general.php?page=sharing' ) ); |
| 112 | 116 | } |
| 113 | 117 | |
| 118 | + /** |
|
| 119 | + * @param string $service_name |
|
| 120 | + * @param string $id |
|
| 121 | + */ |
|
| 114 | 122 | static function disconnect_url( $service_name, $id ) { |
| 115 | 123 | return add_query_arg( array( |
| 116 | 124 | 'action' => 'delete', |
@@ -199,7 +199,7 @@ |
||
| 199 | 199 | * @param string $type Test type, async or direct. Optional, direct all tests. |
| 200 | 200 | * @param string $group Testing group to check status of. Optional, default all tests. |
| 201 | 201 | * |
| 202 | - * @return true|array True if all tests pass. Array of failed tests. |
|
| 202 | + * @return boolean True if all tests pass. Array of failed tests. |
|
| 203 | 203 | */ |
| 204 | 204 | public function pass( $type = 'all', $group = 'all' ) { |
| 205 | 205 | $results = $this->raw_results( $type, $group ); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * Return an array of allowed mime_type items used to upload a media file. |
| 86 | 86 | * |
| 87 | - * @return array mime_type array |
|
| 87 | + * @return string[] mime_type array |
|
| 88 | 88 | */ |
| 89 | 89 | static function get_allowed_mime_types( $default_mime_types ) { |
| 90 | 90 | return array_unique( array_merge( $default_mime_types, array( |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | * @param object $media_item - media post object |
| 253 | 253 | * @param file $file - file recently added |
| 254 | 254 | * @param bool $has_original_media - condition is the original media has been already added |
| 255 | - * @return bool `true` if the item has been added. Otherwise `false`. |
|
| 255 | + * @return false|null `true` if the item has been added. Otherwise `false`. |
|
| 256 | 256 | */ |
| 257 | 257 | public static function register_revision( $media_item, $file, $has_original_media ) { |
| 258 | 258 | if ( is_wp_error( $file ) || ! $has_original_media ) { |
@@ -280,6 +280,9 @@ discard block |
||
| 280 | 280 | return $original; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | + /** |
|
| 284 | + * @param string $pathname |
|
| 285 | + */ |
|
| 283 | 286 | public static function delete_file( $pathname ) { |
| 284 | 287 | if ( ! file_exists( $pathname ) || ! is_file( $pathname ) ) { |
| 285 | 288 | // let's touch a fake file to try to `really` remove the media file |
@@ -295,7 +298,7 @@ discard block |
||
| 295 | 298 | * |
| 296 | 299 | * @param number $media_id - media post ID |
| 297 | 300 | * @param string $filename - basename of the file ( name-of-file.ext ) |
| 298 | - * @return bool `true` is the file has been removed, `false` if not. |
|
| 301 | + * @return boolean|null `true` is the file has been removed, `false` if not. |
|
| 299 | 302 | */ |
| 300 | 303 | private static function delete_media_history_file( $media_id, $filename ) { |
| 301 | 304 | $attached_path = get_attached_file( $media_id ); |
@@ -365,6 +368,7 @@ discard block |
||
| 365 | 368 | * |
| 366 | 369 | * @param number $media_id - media post ID |
| 367 | 370 | * @param number [$limit] - maximun amount of items. 20 as default. |
| 371 | + * @param integer $limit |
|
| 368 | 372 | * @return array items removed from `revision_history` |
| 369 | 373 | */ |
| 370 | 374 | public static function limit_revision_history( $media_id, $limit = null) { |