Cleanup of PHPDoc for interfaces, fixes #13808

This commit is contained in:
Michael Pretty 2017-03-28 13:52:32 -04:00
parent 6d9abd0c65
commit 6660379f19
9 changed files with 37 additions and 36 deletions

View File

@ -26,7 +26,7 @@ interface WC_Abstract_Order_Data_Store_Interface {
/**
* Remove all line items (products, coupons, shipping, taxes) from the order.
*
* @param WC_Order
* @param WC_Order $order
* @param string $type Order item type. Default null.
*/
public function delete_items( $order, $type = null );
@ -34,7 +34,7 @@ interface WC_Abstract_Order_Data_Store_Interface {
/**
* Get token ids for an order.
*
* @param WC_Order
* @param WC_Order $order
* @return array
*/
public function get_payment_token_ids( $order );
@ -42,7 +42,7 @@ interface WC_Abstract_Order_Data_Store_Interface {
/**
* Update token ids for an order.
*
* @param WC_Order
* @param WC_Order $order
* @param array $token_ids
*/
public function update_payment_token_ids( $order, $token_ids );

View File

@ -15,22 +15,22 @@ if ( ! defined( 'ABSPATH' ) ) {
interface WC_Coupon_Data_Store_Interface {
/**
* Increase usage count for current coupon.
* @param WC_Coupon
* @param WC_Coupon &$coupon
* @param string $used_by Either user ID or billing email
*/
public function increase_usage_count( &$coupon, $used_by = '' );
/**
* Decrease usage count for current coupon.
* @param WC_Coupon
* @param WC_Coupon &$coupon
* @param string $used_by Either user ID or billing email
*/
public function decrease_usage_count( &$coupon, $used_by = '' );
/**
* Get the number of uses for a coupon by user ID.
* @param WC_Coupon
* @param id $user_id
* @param WC_Coupon &$coupon
* @param int $user_id
* @return int
*/
public function get_usage_by_user_id( &$coupon, $user_id );

View File

@ -17,7 +17,7 @@ interface WC_Customer_Data_Store_Interface {
/**
* Gets the customers last order.
*
* @param WC_Customer
* @param WC_Customer &$customer
* @return WC_Order|false
*/
public function get_last_order( &$customer );
@ -25,7 +25,7 @@ interface WC_Customer_Data_Store_Interface {
/**
* Return the number of orders this customer has.
*
* @param WC_Customer
* @param WC_Customer &$customer
* @return integer
*/
public function get_order_count( &$customer );
@ -33,7 +33,7 @@ interface WC_Customer_Data_Store_Interface {
/**
* Return how much money this customer has spent.
*
* @param WC_Customer
* @param WC_Customer &$customer
* @return float
*/
public function get_total_spent( &$customer );

View File

@ -13,25 +13,25 @@ if ( ! defined( 'ABSPATH' ) ) {
interface WC_Object_Data_Store_Interface {
/**
* Method to create a new record of a WC_Data based object.
* @param WC_Data
* @param WC_Data &$data
*/
public function create( &$data );
/**
* Method to read a record. Creates a new WC_Data based object.
* @param WC_Data
* @param WC_Data &$data
*/
public function read( &$data );
/**
* Updates a record in the database.
* @param WC_Data
* @param WC_Data &$data
*/
public function update( &$data );
/**
* Deletes a record from the database.
* @param WC_Data
* @param WC_Data &$data
* @param array $args Array of args to pass to the delete method.
* @return bool result
*/
@ -39,31 +39,31 @@ interface WC_Object_Data_Store_Interface {
/**
* Returns an array of meta for an object.
* @param WC_Data
* @param WC_Data &$data
* @return array
*/
public function read_meta( &$data );
/**
* Deletes meta based on meta ID.
* @param WC_Data
* @param stdClass (containing at least ->id)
* @param WC_Data &$data
* @param object $meta (containing at least ->id)
* @return array
*/
public function delete_meta( &$data, $meta );
/**
* Add new piece of meta.
* @param WC_Data
* @param stdClass (containing ->key and ->value)
* @return meta ID
* @param WC_Data &$data
* @param object $meta (containing ->key and ->value)
* @return int meta ID
*/
public function add_meta( &$data, $meta );
/**
* Update meta.
* @param WC_Data
* @param stdClass (containing ->id, ->key and ->value)
* @param WC_Data &$data
* @param object $meta (containing ->id, ->key and ->value)
*/
public function update_meta( &$data, $meta );
}

View File

@ -16,7 +16,7 @@ interface WC_Order_Data_Store_Interface {
/**
* Get amount already refunded.
*
* @param WC_Order
* @param WC_Order $order
* @return string
*/
public function get_total_refunded( $order );
@ -24,7 +24,7 @@ interface WC_Order_Data_Store_Interface {
/**
* Get the total tax refunded.
*
* @param WC_Order
* @param WC_Order $order
* @return float
*/
public function get_total_tax_refunded( $order );
@ -32,7 +32,7 @@ interface WC_Order_Data_Store_Interface {
/**
* Get the total shipping refunded.
*
* @param WC_Order
* @param WC_Order $order
* @return float
*/
public function get_total_shipping_refunded( $order );
@ -63,7 +63,7 @@ interface WC_Order_Data_Store_Interface {
/**
* Get unpaid orders after a certain date,
* @param int timestamp $date
* @param int $date timestamp
* @return array
*/
public function get_unpaid_orders( $date );

View File

@ -25,7 +25,7 @@ interface WC_Payment_Token_Data_Store_Interface {
/**
* Returns an stdObject of a token for a user's default token.
* Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
* @param id $user_id
* @param int $user_id
* @return object
*/
public function get_users_default_token( $user_id );
@ -33,14 +33,14 @@ interface WC_Payment_Token_Data_Store_Interface {
/**
* Returns an stdObject of a token.
* Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
* @param id $token_id
* @param int $token_id
* @return object
*/
public function get_token_by_id( $token_id );
/**
* Returns metadata for a specific payment token.
* @param id $token_id
* @param int $token_id
* @return array
*/
public function get_metadata( $token_id );
@ -49,7 +49,7 @@ interface WC_Payment_Token_Data_Store_Interface {
* Get a token's type by ID.
*
* @since 3.0.0
* @param id $token_id
* @param int $token_id
* @return string
*/
public function get_token_type_by_id( $token_id );
@ -58,7 +58,8 @@ interface WC_Payment_Token_Data_Store_Interface {
* Update's a tokens default status in the database. Used for quickly
* looping through tokens and setting their statuses instead of creating a bunch
* of objects.
* @param id $token_id
* @param int $token_id
* @param bool $status
* @return string
*/
public function set_default_status( $token_id, $status = true );

View File

@ -95,7 +95,7 @@ interface WC_Product_Data_Store_Interface {
*
* Uses queries rather than update_post_meta so we can do this in one query (to avoid stock issues).
*
* @param int
* @param int $product_id_with_stock
* @param int|null $stock_quantity
* @param string $operation set, increase and decrease.
*/
@ -107,7 +107,7 @@ interface WC_Product_Data_Store_Interface {
* Uses queries rather than update_post_meta so we can do this in one query for performance.
*
* @since 3.0.0 this supports set, increase and decrease.
* @param int
* @param int $product_id
* @param int|null $quantity
* @param string $operation set, increase and decrease.
*/
@ -115,7 +115,7 @@ interface WC_Product_Data_Store_Interface {
/**
* Get shipping class ID by slug.
* @param $slug string
* @param string $slug
* @return int|false
*/
public function get_shipping_class_id_by_slug( $slug );

View File

@ -66,7 +66,7 @@ interface WC_Product_Variable_Data_Store_Interface {
* Delete variations of a product.
*
* @param int $product_id
* @param $force_delete False to trash.
* @param bool $force_delete False to trash.
*/
public function delete_variations( $product_id, $force_delete = false );

View File

@ -23,7 +23,7 @@ interface WC_Shipping_Zone_Data_Store_Interface {
/**
* Get count of methods for a zone.
* @param int Zone ID
* @param int $zone_id Zone ID
* @return int Method Count
*/
public function get_method_count( $zone_id );