From 7cef8ae4c946d1af7386982015002b5ee7cdf984 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Mon, 6 Jun 2016 16:50:18 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- includes/abstracts/abstract-wc-payment-gateway.php | 2 +- includes/abstracts/abstract-wc-payment-token.php | 8 ++++---- includes/abstracts/abstract-wc-settings-api.php | 2 +- .../api/class-wc-rest-product-attributes-controller.php | 3 +-- includes/api/class-wc-rest-webhooks-controller.php | 1 - includes/class-wc-countries.php | 2 +- includes/class-wc-install.php | 1 + includes/class-wc-payment-tokens.php | 2 +- includes/class-wc-shipping-rate.php | 4 +--- includes/class-wc-shipping-zones.php | 1 - includes/emails/class-wc-email.php | 2 +- includes/wc-core-functions.php | 4 +++- includes/wc-product-functions.php | 1 - includes/wc-term-functions.php | 3 +-- includes/wc-user-functions.php | 2 +- 15 files changed, 17 insertions(+), 21 deletions(-) diff --git a/includes/abstracts/abstract-wc-payment-gateway.php b/includes/abstracts/abstract-wc-payment-gateway.php index 86435eb2b66..de501071ca1 100644 --- a/includes/abstracts/abstract-wc-payment-gateway.php +++ b/includes/abstracts/abstract-wc-payment-gateway.php @@ -316,7 +316,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API { * @param int $order_id * @param float $amount * @param string $reason - * @return bool|WP_Error True or false based on success, or a WP_Error object. + * @return boolean True or false based on success, or a WP_Error object. */ public function process_refund( $order_id, $amount = null, $reason = '' ) { return false; diff --git a/includes/abstracts/abstract-wc-payment-token.php b/includes/abstracts/abstract-wc-payment-token.php index 4b542f95ff0..2389e2f5d9e 100644 --- a/includes/abstracts/abstract-wc-payment-token.php +++ b/includes/abstracts/abstract-wc-payment-token.php @@ -66,7 +66,7 @@ if ( ! defined( 'ABSPATH' ) ) { /** * Returns the payment token ID. * @since 2.6.0 - * @return ID Token ID + * @return integer Token ID */ public function get_id() { return absint( $this->_data['id'] ); @@ -198,7 +198,7 @@ if ( ! defined( 'ABSPATH' ) ) { /** * Update a payment token. * @since 2.6.0 - * @return True on success, false if validation failed and a payment token could not be updated + * @return boolean on success, false if validation failed and a payment token could not be updated */ public function update() { if ( false === $this->validate() ) { @@ -234,7 +234,7 @@ if ( ! defined( 'ABSPATH' ) ) { /** * Create a new payment token in the database. * @since 2.6.0 - * @return True on success, false if validation failed and a payment token could not be created + * @return boolean on success, false if validation failed and a payment token could not be created */ public function create() { if ( false === $this->validate() ) { @@ -273,7 +273,7 @@ if ( ! defined( 'ABSPATH' ) ) { /** * Saves a payment token to the database - does not require you to know if this is a new token or an update token. * @since 2.6.0 - * @return True on success, false if validation failed and a payment token could not be saved + * @return boolean on success, false if validation failed and a payment token could not be saved */ public function save() { if ( $this->get_id() > 0 ) { diff --git a/includes/abstracts/abstract-wc-settings-api.php b/includes/abstracts/abstract-wc-settings-api.php index 7b2ed46af10..26293f5b7b5 100644 --- a/includes/abstracts/abstract-wc-settings-api.php +++ b/includes/abstracts/abstract-wc-settings-api.php @@ -226,7 +226,7 @@ abstract class WC_Settings_API { * * @param string $key * @param mixed $empty_value - * @return mixed The value specified for the option or a default value for the option. + * @return string The value specified for the option or a default value for the option. */ public function get_option( $key, $empty_value = null ) { if ( empty( $this->settings ) ) { diff --git a/includes/api/class-wc-rest-product-attributes-controller.php b/includes/api/class-wc-rest-product-attributes-controller.php index f397719adc7..685e0d9d51a 100644 --- a/includes/api/class-wc-rest-product-attributes-controller.php +++ b/includes/api/class-wc-rest-product-attributes-controller.php @@ -494,7 +494,6 @@ class WC_REST_Product_Attributes_Controller extends WC_REST_Controller { * Prepare links for the request. * * @param object $attribute Attribute object. - * @param WP_REST_Request $request Full details about the request. * @return array Links for the given attribute. */ protected function prepare_links( $attribute ) { @@ -586,7 +585,7 @@ class WC_REST_Product_Attributes_Controller extends WC_REST_Controller { * Get attribute name. * * @param WP_REST_Request $request Full details about the request. - * @return int|WP_Error + * @return string */ protected function get_taxonomy( $request ) { if ( '' !== $this->attribute ) { diff --git a/includes/api/class-wc-rest-webhooks-controller.php b/includes/api/class-wc-rest-webhooks-controller.php index a17f0657b12..46115b96be6 100644 --- a/includes/api/class-wc-rest-webhooks-controller.php +++ b/includes/api/class-wc-rest-webhooks-controller.php @@ -387,7 +387,6 @@ class WC_REST_Webhooks_Controller extends WC_REST_Posts_Controller { /** * Prepare a single webhook output for response. * - * @param WP_Post $webhook Webhook object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response $response Response data. */ diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index 55e5c1edb7c..7343fba44f8 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -64,7 +64,7 @@ class WC_Countries { /** * Get continent code for a country code. * @since 2.6.0 - * @param $cc string + * @param string $cc string * @return string */ public function get_continent_code_for_country( $cc ) { diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index 2213e3f987b..6c49005d271 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -240,6 +240,7 @@ class WC_Install { /** * Update DB version to current. + * @param string $version */ public static function update_db_version( $version = null ) { delete_option( 'woocommerce_db_version' ); diff --git a/includes/class-wc-payment-tokens.php b/includes/class-wc-payment-tokens.php index f3ec84cc555..6b31904ec50 100644 --- a/includes/class-wc-payment-tokens.php +++ b/includes/class-wc-payment-tokens.php @@ -76,7 +76,7 @@ class WC_Payment_Tokens { * Returns an array of payment token objects associated with the passed customer ID. * @since 2.6.0 * @param int $customer_id Customer ID - * @param string $gateway Optional Gateway ID for getting tokens for a specific gateway + * @param string $gateway_id Optional Gateway ID for getting tokens for a specific gateway * @return array Array of token objects */ public static function get_customer_tokens( $customer_id, $gateway_id = '' ) { diff --git a/includes/class-wc-shipping-rate.php b/includes/class-wc-shipping-rate.php index 13412ddf492..6b4e80354b9 100644 --- a/includes/class-wc-shipping-rate.php +++ b/includes/class-wc-shipping-rate.php @@ -44,7 +44,7 @@ class WC_Shipping_Rate { * * @param string $id * @param string $label - * @param float $cost + * @param integer $cost * @param array $taxes * @param string $method_id */ @@ -87,8 +87,6 @@ class WC_Shipping_Rate { /** * Get all meta data for this rate. * @since 2.6.0 - * @param string $key - * @param string $value */ public function get_meta_data() { return $this->meta_data; diff --git a/includes/class-wc-shipping-zones.php b/includes/class-wc-shipping-zones.php index cd580090767..3820b17a797 100644 --- a/includes/class-wc-shipping-zones.php +++ b/includes/class-wc-shipping-zones.php @@ -82,7 +82,6 @@ class WC_Shipping_Zones { /** * Get shipping zone using it's ID * @since 2.6.0 - * @param int $zone_id * @return WC_Shipping_Meethod|bool */ public static function get_shipping_method( $instance_id ) { diff --git a/includes/emails/class-wc-email.php b/includes/emails/class-wc-email.php index f3d734dc69d..4de9798c97c 100644 --- a/includes/emails/class-wc-email.php +++ b/includes/emails/class-wc-email.php @@ -284,7 +284,7 @@ class WC_Email extends WC_Settings_API { /** * Get email attachments. * - * @return string|array + * @return string */ public function get_attachments() { return apply_filters( 'woocommerce_email_attachments', array(), $this->id, $this->object ); diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index a9fb6246794..ea2d495925c 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -209,6 +209,7 @@ function wc_get_template( $template_name, $args = array(), $template_path = '', * Like wc_get_template, but returns the HTML instead of outputting. * @see wc_get_template * @since 2.5.0 + * @param string $template_name */ function wc_get_template_html( $template_name, $args = array(), $template_path = '', $default_path = '' ) { ob_start(); @@ -1230,7 +1231,7 @@ function wc_help_tip( $tip, $allow_html = false ) { * Return a list of potential postcodes for wildcard searching. * @since 2.6.0 * @param string $postcode - * @return array + * @return string[] */ function wc_get_wildcard_postcodes( $postcode ) { $postcodes = array( '*', strtoupper( $postcode ), strtoupper( $postcode ) . '*' ); @@ -1252,6 +1253,7 @@ function wc_get_wildcard_postcodes( $postcode ) { * @param array $objects Array of postcode objects from Database * @param string $object_compare_key DB column name for the ID. * @param string $object_compare_key DB column name for the value. + * @param string $object_id_key * @return array Array of matching object ID and values. */ function wc_postcode_location_matcher( $postcode, $objects, $object_id_key, $object_compare_key ) { diff --git a/includes/wc-product-functions.php b/includes/wc-product-functions.php index 9637bfd3198..15b198f16ce 100644 --- a/includes/wc-product-functions.php +++ b/includes/wc-product-functions.php @@ -706,7 +706,6 @@ function wc_get_product_cat_ids( $product_id ) { /** * Gets data about an attachment, such as alt text and captions. * @since 2.6.0 - * @param int $thumbnail_id * @param object|bool $product * @return array */ diff --git a/includes/wc-term-functions.php b/includes/wc-term-functions.php index 7839a0f5604..c0513a90ef4 100644 --- a/includes/wc-term-functions.php +++ b/includes/wc-term-functions.php @@ -307,7 +307,7 @@ function add_woocommerce_term_meta( $term_id, $meta_key, $meta_value, $unique = * * @todo These functions should be deprecated with notices in a future WC version, allowing users a chance to upgrade WordPress. * @param mixed $term_id - * @param mixed $meta_key + * @param string $meta_key * @param string $meta_value (default: '') * @param bool $deprecated (default: false) * @return bool @@ -689,7 +689,6 @@ function wc_get_term_product_ids( $term_id, $taxonomy ) { /** * When a post is updated and terms recounted (called by _update_post_term_count), clear the ids. - * @param int $term_id * @param int $object_id Object ID. * @param array $terms An array of object terms. * @param array $tt_ids An array of term taxonomy IDs. diff --git a/includes/wc-user-functions.php b/includes/wc-user-functions.php index 3005692b3e1..8b668a12127 100644 --- a/includes/wc-user-functions.php +++ b/includes/wc-user-functions.php @@ -628,7 +628,7 @@ function wc_get_customer_saved_methods_list( $customer_id ) { * * @since 2.6.0 * @param int $customer_id Customer ID. - * @return WC_Order|bool Order object if successful or false. + * @return WC_Order Order object if successful or false. */ function wc_get_customer_last_order( $customer_id ) { global $wpdb;