Merge pull request #11055 from woothemes/scrutinizer-patch-1

Scrutinizer Auto-Fixes
This commit is contained in:
Mike Jolley 2016-06-06 17:50:54 +01:00
commit 1b545aa605
15 changed files with 17 additions and 21 deletions

View File

@ -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;

View File

@ -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 ) {

View File

@ -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 ) ) {

View File

@ -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 ) {

View File

@ -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.
*/

View File

@ -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 ) {

View File

@ -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' );

View File

@ -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 = '' ) {

View File

@ -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;

View File

@ -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 ) {

View File

@ -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 );

View File

@ -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 ) {

View File

@ -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
*/

View File

@ -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.

View File

@ -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;