Skip to content

Commit

Permalink
scrutinizer patches
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Sep 7, 2014
1 parent bdd289f commit c4ef86d
Show file tree
Hide file tree
Showing 54 changed files with 134 additions and 84 deletions.
10 changes: 5 additions & 5 deletions includes/abstracts/abstract-wc-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public function get_style_inline_for_tag( $tag ) {
/**
* Apply inline styles to dynamic content.
*
* @param mixed $content
* @param string|null $content
* @return string
*/
public function style_inline( $content ) {
Expand Down Expand Up @@ -521,9 +521,9 @@ public function get_from_address() {
/**
* Send the email.
*
* @param mixed $to
* @param mixed $subject
* @param mixed $message
* @param string $to
* @param string $subject
* @param string $message
* @param string $headers
* @param string $attachments
* @return bool
Expand Down Expand Up @@ -589,7 +589,7 @@ function init_form_fields() {
* - Saves the options to the DB
*
* @since 1.0.0
* @return bool
* @return boolean|null
*/
public function process_admin_options() {

Expand Down
9 changes: 4 additions & 5 deletions includes/abstracts/abstract-wc-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ abstract class WC_Abstract_Order {
* should be used. It is possible, but the aforementioned are preferred and are the only
* methods that will be maintained going forward.
*
* @param string $id The order id. Default ''.
*/
public function __construct( $order = '' ) {

Expand Down Expand Up @@ -78,6 +77,7 @@ public function remove_order_items( $type = null ) {
* Set the payment method for the order
*
* @param WC_Payment_Gateway
* @param WC_Payment_Gateway $payment_method
*/
public function set_payment_method( $payment_method ) {

Expand Down Expand Up @@ -227,7 +227,7 @@ public function update_product( $item_id, $product, $args ) {
* Add coupon code to the order
*
* @param string $code
* @param float|int $discount_amount
* @param integer $discount_amount
* @return int|bool Item ID or false
*/
public function add_coupon( $code, $discount_amount = 0 ) {
Expand Down Expand Up @@ -810,7 +810,6 @@ public function get_status() {
/**
* Checks the order status against a passed in status.
*
* @param mixed $type Array or string of types
* @return bool
*/
public function has_status( $status ) {
Expand Down Expand Up @@ -2350,7 +2349,7 @@ public function reduce_order_stock() {
/**
* send_stock_notifications function.
*
* @param object $product
* @param WC_Product $product
* @param int $new_stock
* @param int $qty_ordered
*/
Expand Down Expand Up @@ -2432,7 +2431,7 @@ public function needs_payment() {
/**
* Checks if an order needs display the shipping address, based on shipping method
*
* @return bool
* @return boolean|null
*/
public function needs_shipping_address() {

Expand Down
4 changes: 2 additions & 2 deletions includes/abstracts/abstract-wc-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function process_payment( $order_id ) {
* @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;
Expand Down Expand Up @@ -245,7 +245,7 @@ public function payment_fields() {
* Gateways should override this to declare support (or lack of support) for a feature.
* For backward compatibility, gateways support 'products' by default, but nothing else.
*
* @param $feature string The name of a feature to test support for.
* @param string $feature string The name of a feature to test support for.
* @return bool True if the gateway supports the feature, false otherwise.
* @since 1.5.7
*/
Expand Down
10 changes: 5 additions & 5 deletions includes/abstracts/abstract-wc-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __isset( $key ) {
/**
* __get function.
*
* @param mixed $key
* @param string $key
* @return mixed
*/
public function __get( $key ) {
Expand Down Expand Up @@ -225,6 +225,7 @@ public function increase_stock( $amount = 1 ) {
/**
* set_stock_status function.
*
* @param string $status
* @return void
*/
public function set_stock_status( $status ) {
Expand All @@ -248,7 +249,7 @@ public function set_stock_status( $status ) {
*
* Backwards compat with downloadable/virtual.
*
* @param mixed $type Array or string of types
* @param string $type Array or string of types
* @return bool
*/
public function is_type( $type ) {
Expand Down Expand Up @@ -908,7 +909,7 @@ public function get_price_html_from_text() {
/**
* Functions for getting parts of a price, in html, used by get_price_html.
*
* @param mixed $from String or float to wrap with 'from' text
* @param string $from String or float to wrap with 'from' text
* @param mixed $to String or float to wrap with 'to' text
* @return string
*/
Expand Down Expand Up @@ -1227,7 +1228,7 @@ public function get_attributes() {
/**
* Returns whether or not the product has any attributes set.
*
* @return mixed
* @return boolean
*/
public function has_attributes() {

Expand Down Expand Up @@ -1354,7 +1355,6 @@ public function get_image( $size = 'shop_thumbnail', $attr = array() ) {
/**
* Get product name with SKU or ID. Used within admin.
*
* @param mixed $product
* @return string Formatted product name
*/
public function get_formatted_name() {
Expand Down
1 change: 1 addition & 0 deletions includes/abstracts/abstract-wc-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function get_cached_widget( $args ) {

/**
* Cache the widget
* @param string $content
*/
public function cache_widget( $args, $content ) {
$cache[ $args['widget_id'] ] = $content;
Expand Down
2 changes: 2 additions & 0 deletions includes/admin/class-wc-admin-post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ public function bulk_and_quick_edit_save_post( $post_id, $post ) {

/**
* Quick edit
* @param integer $post_id
*/
private function quick_edit_save( $post_id, $product ) {
global $wpdb;
Expand Down Expand Up @@ -924,6 +925,7 @@ private function quick_edit_save( $post_id, $product ) {

/**
* Bulk edit
* @param integer $post_id
*/
public function bulk_edit_save( $post_id, $product ) {

Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-wc-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static function output() {
/**
* Get a setting from the settings API.
*
* @param mixed $option
* @param mixed $option_name
* @return string
*/
public static function get_option( $option_name, $default = '' ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-wc-admin-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public static function status_logs() {
*
* @since 2.1.1
* @param string $file Path to the file
* @param array $all_headers List of headers, in the format array('HeaderKey' => 'Header Name')
* @return string
*/
public static function get_file_version( $file ) {
// We don't need to write to the file, so just open for reading.
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/settings/class-wc-settings-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function frontend_styles_setting() {
* Output a colour picker input box.
*
* @param mixed $name
* @param mixed $id
* @param string $id
* @param mixed $value
* @param string $desc (default: '')
*/
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/wc-admin-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function wc_get_screen_ids() {
*
* @access public
* @param mixed $slug Slug for the new page
* @param mixed $option Option name to store the page's ID
* @param string $option Option name to store the page's ID
* @param string $page_title (default: '') Title for the new page
* @param string $page_content (default: '') Content for the new page
* @param int $post_parent (default: 0) Parent for the new page
Expand Down Expand Up @@ -130,7 +130,7 @@ function woocommerce_update_options( $options ) {
/**
* Get a setting from the settings API.
*
* @param mixed $option
* @param mixed $option_name
* @return string
*/
function woocommerce_settings_get_option( $option_name, $default = '' ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/api/class-wc-api-customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ private function get_avatar_url( $email ) {
*
* @since 2.1
* @see WC_API_Resource::validate_request()
* @param string|int $id the customer ID
* @param integer $id the customer ID
* @param string $type the request type, unused because this method overrides the parent class
* @param string $context the context of the request, either `read`, `edit` or `delete`
* @return int|WP_Error valid user ID or WP_Error if any of the checks fails
Expand Down
1 change: 0 additions & 1 deletion includes/api/class-wc-api-orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,6 @@ public function get_order_refunds( $order_id, $fields = null ) {
*
* @since 2.2
* @param string $order_id order ID
* @param int $refund order refund ID
* @param string|null $fields fields to limit response to
* @return array
*/
Expand Down
6 changes: 3 additions & 3 deletions includes/api/class-wc-api-products.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ private function query_products( $args ) {
*
* @since 2.1
* @param WC_Product $product
* @return array
* @return WC_Product
*/
private function get_product_data( $product ) {

Expand Down Expand Up @@ -1440,7 +1440,7 @@ private function save_downloadable_files( $product_id, $downloads, $variation_id
*
* @since 2.2
* @param string $label
* @return stdClass
* @return string|null
*/
private function get_attribute_taxonomy_by_label( $label ) {
$taxonomy = null;
Expand Down Expand Up @@ -1653,7 +1653,7 @@ public function upload_product_image( $image_url ) {
* Get product image as attachment
*
* @since 2.2
* @param array $upload
* @param integer $upload
* @param int $id
* @return int
*/
Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct() {
* @access public
* @since 2.0
* @param $vars
* @return array
* @return string[]
*/
public function add_query_vars( $vars ) {
$vars[] = 'wc-api';
Expand Down Expand Up @@ -157,7 +157,7 @@ public function includes() {
* Register available API resources
*
* @since 2.1
* @param object $server the REST server
* @param WC_API_Server $server the REST server
*/
public function register_resources( $server ) {

Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ public function generate_cart_id( $product_id, $variation_id = 0, $variation = a
* Add a product to the cart.
*
* @param string $product_id contains the id of the product to add to the cart
* @param string $quantity contains the quantity of the item to add
* @param integer $quantity contains the quantity of the item to add
* @param int $variation_id
* @param array $variation attribute values
* @param array $cart_item_data extra cart item data we want to pass into the item
Expand Down Expand Up @@ -1783,7 +1783,7 @@ public function apply_cart_discounts_after_tax() {
*
* @access public
* @param mixed $values
* @param mixed $price
* @param double $price
*/
public function apply_product_discounts_after_tax( $values, $price ) {
if ( ! empty( $this->applied_coupons ) ) {
Expand All @@ -1807,7 +1807,7 @@ public function apply_product_discounts_after_tax( $values, $price ) {
*
* @access private
* @param mixed $code
* @param mixed $amount
* @param double $amount
*/
private function increase_coupon_discount_amount( $code, $amount ) {
if ( empty( $this->coupon_discount_amounts[ $code ] ) )
Expand All @@ -1821,7 +1821,7 @@ private function increase_coupon_discount_amount( $code, $amount ) {
*
* @access private
* @param mixed $code
* @param mixed $amount
* @param mixed $count
*/
private function increase_coupon_applied_count( $code, $count = 1 ) {
if ( empty( $this->coupon_applied_count[ $code ] ) )
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-countries.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function get_shipping_country_states() {
* Gets an array of countries in the EU.
*
* @access public
* @return array
* @return string[]
*/
public function get_european_union_countries() {
return array( 'AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HU', 'HR', 'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK' );
Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public function get_error_message() {
* Check if a coupon is valid. Return a reason code if invalid. Reason codes:
*
* @access public
* @return bool|WP_Error validity or a WP_Error if not valid
* @return boolean validity or a WP_Error if not valid
*/
public function is_valid() {

Expand Down Expand Up @@ -599,7 +599,7 @@ public function add_coupon_message( $msg_code ) {
* Map one of the WC_Coupon message codes to a message string
*
* @access public
* @param mixed $msg_code
* @param integer $msg_code
* @return string| Message/error string
*/
public function get_coupon_message( $msg_code ) {
Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ public function get_taxable_address() {
* Sets session data for the location.
*
* @access public
* @param mixed $country
* @param mixed $state
* @param string $country
* @param string $state
* @param string $postcode (default: '')
* @param string $city (default: '')
*/
Expand Down Expand Up @@ -448,7 +448,7 @@ public function set_address_2( $address_2 ) {
* Sets session data for the location.
*
* @access public
* @param mixed $country
* @param string $country
* @param string $state (default: '')
* @param string $postcode (default: '')
* @param string $city (default: '')
Expand Down Expand Up @@ -534,7 +534,7 @@ public function set_is_vat_exempt( $is_vat_exempt ) {
* calculated_shipping function.
*
* @access public
* @param mixed $calculated
* @param boolean $calculated
*/
public function calculated_shipping( $calculated = true ) {
$this->calculated_shipping = $calculated;
Expand Down
1 change: 1 addition & 0 deletions includes/class-wc-download-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public static function download_product() {

/**
* Download a file - hook into init function.
* @param integer $product_id
*/
public static function download( $file_path, $product_id ) {
global $is_IE;
Expand Down
3 changes: 1 addition & 2 deletions includes/class-wc-emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function email_footer() {
*
* @access public
* @param mixed $email_heading
* @param mixed $message
* @param string $message
* @return string
*/
function wrap_message( $email_heading, $message, $plain_text = false ) {
Expand Down Expand Up @@ -244,7 +244,6 @@ function send( $to, $subject, $message, $headers = "Content-Type: text/html\r\n"
* Prepare and send the customer invoice email on demand.
*
* @access public
* @param mixed $pay_for_order
* @return void
*/
function customer_invoice( $order ) {
Expand Down
Loading

0 comments on commit c4ef86d

Please sign in to comment.