@@ -348,6 +348,9 @@ discard block |
||
348 | 348 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
349 | 349 | } |
350 | 350 | |
351 | + /** |
|
352 | + * @param integer $status_code |
|
353 | + */ |
|
351 | 354 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
352 | 355 | $exit = $this->exit; |
353 | 356 | $this->exit = false; |
@@ -571,11 +574,18 @@ discard block |
||
571 | 574 | return wp_json_encode( $data ); |
572 | 575 | } |
573 | 576 | |
577 | + /** |
|
578 | + * @param string $needle |
|
579 | + */ |
|
574 | 580 | function ends_with( $haystack, $needle ) { |
575 | 581 | return $needle === substr( $haystack, -strlen( $needle ) ); |
576 | 582 | } |
577 | 583 | |
578 | 584 | // Returns the site's blog_id in the WP.com ecosystem |
585 | + |
|
586 | + /** |
|
587 | + * @return integer |
|
588 | + */ |
|
579 | 589 | function get_blog_id_for_output() { |
580 | 590 | return $this->token_details['blog_id']; |
581 | 591 | } |
@@ -598,6 +608,10 @@ discard block |
||
598 | 608 | } |
599 | 609 | |
600 | 610 | // Returns true if the specified blog ID is a restricted blog |
611 | + |
|
612 | + /** |
|
613 | + * @param integer $blog_id |
|
614 | + */ |
|
601 | 615 | function is_restricted_blog( $blog_id ) { |
602 | 616 | /** |
603 | 617 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -647,7 +661,7 @@ discard block |
||
647 | 661 | /** |
648 | 662 | * Counts the number of comments on a site, excluding certain comment types. |
649 | 663 | * |
650 | - * @param $post_id int Post ID. |
|
664 | + * @param integer $post_id int Post ID. |
|
651 | 665 | * @return array Array of counts, matching the output of https://developer.wordpress.org/reference/functions/get_comment_count/. |
652 | 666 | */ |
653 | 667 | public function wp_count_comments( $post_id ) { |
@@ -143,7 +143,7 @@ |
||
143 | 143 | /** |
144 | 144 | * |
145 | 145 | * Return Whether boolean cached threats exist or null if the state is unknown. |
146 | - * * @return boolean or null |
|
146 | + * * @return null|boolean or null |
|
147 | 147 | */ |
148 | 148 | public function has_threats() { |
149 | 149 | $scan_state = get_transient( 'jetpack_scan_state' ); |
@@ -154,7 +154,7 @@ |
||
154 | 154 | * @param string $avatar The <img/> element of the avatar. |
155 | 155 | * @param mixed $author User ID, email address, user login, comment object, user object, post object |
156 | 156 | * |
157 | - * @return The <img/> element of the avatar. |
|
157 | + * @return string <img/> element of the avatar. |
|
158 | 158 | */ |
159 | 159 | function grofiles_get_avatar( $avatar, $author ) { |
160 | 160 | $is_amp = class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request(); |
@@ -310,7 +310,7 @@ |
||
310 | 310 | /** |
311 | 311 | * Get the current user id |
312 | 312 | * |
313 | - * @return int |
|
313 | + * @return string |
|
314 | 314 | */ |
315 | 315 | public function get_user_id() { |
316 | 316 | if ( is_user_logged_in() ) { |
@@ -514,7 +514,7 @@ |
||
514 | 514 | * Send a synchronous XML-RPC subscribe to blog posts or subscribe to post comments request. |
515 | 515 | * |
516 | 516 | * @param string $email |
517 | - * @param array $post_ids (optional) defaults to 0 for blog posts only: array of post IDs to subscribe to blog's posts |
|
517 | + * @param integer $post_ids (optional) defaults to 0 for blog posts only: array of post IDs to subscribe to blog's posts |
|
518 | 518 | * @param bool $async (optional) Should the subscription be performed asynchronously? Defaults to true. |
519 | 519 | * |
520 | 520 | * @return true|WP_Error true on success |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * Convenience function for grabbing options from params->options |
119 | 119 | * |
120 | 120 | * @param string $option the option to grab. |
121 | - * @param mixed $default (optional). |
|
121 | + * @param boolean $default (optional). |
|
122 | 122 | * @return option or $default if not set |
123 | 123 | * |
124 | 124 | * @since 4.5.0 |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | /** |
711 | 711 | * Check the reasons to bail before we attempt to insert ads. |
712 | 712 | * |
713 | - * @return true if we should bail (don't insert ads) |
|
713 | + * @return boolean if we should bail (don't insert ads) |
|
714 | 714 | * |
715 | 715 | * @since 4.5.0 |
716 | 716 | */ |
@@ -47,7 +47,7 @@ |
||
47 | 47 | * @param array $args Widget args. |
48 | 48 | * @param array $instance The Widget instance. |
49 | 49 | * |
50 | - * @return bool|void |
|
50 | + * @return false|null |
|
51 | 51 | */ |
52 | 52 | public function widget( $args, $instance ) { |
53 | 53 | global $wordads; |
@@ -433,6 +433,9 @@ |
||
433 | 433 | ); |
434 | 434 | } |
435 | 435 | |
436 | + /** |
|
437 | + * @param string $column |
|
438 | + */ |
|
436 | 439 | function _build_date_range_query( $column, $range, $where ) { |
437 | 440 | global $wpdb; |
438 | 441 |
@@ -15,6 +15,9 @@ |
||
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
18 | +/** |
|
19 | + * @param string $file_pattern |
|
20 | + */ |
|
18 | 21 | function wpcom_rest_api_v2_load_plugin_files( $file_pattern ) { |
19 | 22 | $plugins = glob( dirname( __FILE__ ) . '/' . $file_pattern ); |
20 | 23 |