From 74ec8a4a1458936c62b208cc2a867bb49cbfa627 Mon Sep 17 00:00:00 2001 From: Gerhard Potgieter Date: Mon, 5 Mar 2018 14:58:28 +0200 Subject: [PATCH] PHPCS passing for abstract-wc-rest-posts-controller.php --- .../abstract-wc-rest-posts-controller.php | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/includes/abstracts/abstract-wc-rest-posts-controller.php b/includes/abstracts/abstract-wc-rest-posts-controller.php index 4a1ab5d713a..1d24d2ba4bd 100644 --- a/includes/abstracts/abstract-wc-rest-posts-controller.php +++ b/includes/abstracts/abstract-wc-rest-posts-controller.php @@ -1,14 +1,18 @@ ID, true ); @@ -364,7 +368,7 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { $total_posts = $posts_query->found_posts; if ( $total_posts < 1 ) { - // Out-of-bounds, run the query again without LIMIT for total count + // Out-of-bounds, run the query again without LIMIT for total count. unset( $query_args['paged'] ); $count_query = new WP_Query(); $count_query->query( $query_args ); @@ -478,7 +482,7 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { /** * Prepare links for the request. * - * @param WP_Post $post Post object. + * @param WP_Post $post Post object. * @param WP_REST_Request $request Request object. * @return array Links for the given post. */ @@ -499,8 +503,8 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { * Determine the allowed query_vars for a get_items() response and * prepare for WP_Query. * - * @param array $prepared_args - * @param WP_REST_Request $request + * @param array $prepared_args Prepared arguments. + * @param WP_REST_Request $request Request object. * @return array $query_args */ protected function prepare_items_query( $prepared_args = array(), $request = null ) { @@ -515,7 +519,6 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { * The dynamic portion of the hook name, $var, refers to the query_var key. * * @param mixed $prepared_args[ $var ] The query_var value. - * */ $query_args[ $var ] = apply_filters( "woocommerce_rest_query_var-{$var}", $prepared_args[ $var ] ); } @@ -526,7 +529,7 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { if ( 'include' === $query_args['orderby'] ) { $query_args['orderby'] = 'post__in'; } elseif ( 'id' === $query_args['orderby'] ) { - $query_args['orderby'] = 'ID'; // ID must be capitalized + $query_args['orderby'] = 'ID'; // ID must be capitalized. } return $query_args; @@ -708,8 +711,8 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { /** * Update post meta fields. * - * @param WP_Post $post - * @param WP_REST_Request $request + * @param WP_Post $post Post object. + * @param WP_REST_Request $request Request object. * @return bool|WP_Error */ protected function update_post_meta_fields( $post, $request ) {