@@ -15,125 +15,125 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | interface WC_Product_Data_Store_Interface { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns an array of on sale products, as an array of objects with an |
|
| 20 | - * ID and parent_id present. Example: $return[0]->id, $return[0]->parent_id. |
|
| 21 | - * |
|
| 22 | - * @return array |
|
| 23 | - */ |
|
| 24 | - public function get_on_sale_products(); |
|
| 18 | + /** |
|
| 19 | + * Returns an array of on sale products, as an array of objects with an |
|
| 20 | + * ID and parent_id present. Example: $return[0]->id, $return[0]->parent_id. |
|
| 21 | + * |
|
| 22 | + * @return array |
|
| 23 | + */ |
|
| 24 | + public function get_on_sale_products(); |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Returns a list of product IDs ( id as key => parent as value) that are |
|
| 28 | - * featured. Uses get_posts instead of wc_get_products since we want |
|
| 29 | - * some extra meta queries and ALL products (posts_per_page = -1). |
|
| 30 | - * |
|
| 31 | - * @return array |
|
| 32 | - */ |
|
| 33 | - public function get_featured_product_ids(); |
|
| 26 | + /** |
|
| 27 | + * Returns a list of product IDs ( id as key => parent as value) that are |
|
| 28 | + * featured. Uses get_posts instead of wc_get_products since we want |
|
| 29 | + * some extra meta queries and ALL products (posts_per_page = -1). |
|
| 30 | + * |
|
| 31 | + * @return array |
|
| 32 | + */ |
|
| 33 | + public function get_featured_product_ids(); |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Check if product sku is found for any other product IDs. |
|
| 37 | - * |
|
| 38 | - * @param int $product_id Product ID. |
|
| 39 | - * @param string $sku SKU. |
|
| 40 | - * @return bool |
|
| 41 | - */ |
|
| 42 | - public function is_existing_sku( $product_id, $sku ); |
|
| 35 | + /** |
|
| 36 | + * Check if product sku is found for any other product IDs. |
|
| 37 | + * |
|
| 38 | + * @param int $product_id Product ID. |
|
| 39 | + * @param string $sku SKU. |
|
| 40 | + * @return bool |
|
| 41 | + */ |
|
| 42 | + public function is_existing_sku( $product_id, $sku ); |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Return product ID based on SKU. |
|
| 46 | - * |
|
| 47 | - * @param string $sku SKU. |
|
| 48 | - * @return int |
|
| 49 | - */ |
|
| 50 | - public function get_product_id_by_sku( $sku ); |
|
| 44 | + /** |
|
| 45 | + * Return product ID based on SKU. |
|
| 46 | + * |
|
| 47 | + * @param string $sku SKU. |
|
| 48 | + * @return int |
|
| 49 | + */ |
|
| 50 | + public function get_product_id_by_sku( $sku ); |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Returns an array of IDs of products that have sales starting soon. |
|
| 54 | - * |
|
| 55 | - * @return array |
|
| 56 | - */ |
|
| 57 | - public function get_starting_sales(); |
|
| 52 | + /** |
|
| 53 | + * Returns an array of IDs of products that have sales starting soon. |
|
| 54 | + * |
|
| 55 | + * @return array |
|
| 56 | + */ |
|
| 57 | + public function get_starting_sales(); |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * Returns an array of IDs of products that have sales which are due to end. |
|
| 61 | - * |
|
| 62 | - * @return array |
|
| 63 | - */ |
|
| 64 | - public function get_ending_sales(); |
|
| 59 | + /** |
|
| 60 | + * Returns an array of IDs of products that have sales which are due to end. |
|
| 61 | + * |
|
| 62 | + * @return array |
|
| 63 | + */ |
|
| 64 | + public function get_ending_sales(); |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Find a matching (enabled) variation within a variable product. |
|
| 68 | - * |
|
| 69 | - * @param WC_Product $product Variable product object. |
|
| 70 | - * @param array $match_attributes Array of attributes we want to try to match. |
|
| 71 | - * @return int Matching variation ID or 0. |
|
| 72 | - */ |
|
| 73 | - public function find_matching_product_variation( $product, $match_attributes = array() ); |
|
| 66 | + /** |
|
| 67 | + * Find a matching (enabled) variation within a variable product. |
|
| 68 | + * |
|
| 69 | + * @param WC_Product $product Variable product object. |
|
| 70 | + * @param array $match_attributes Array of attributes we want to try to match. |
|
| 71 | + * @return int Matching variation ID or 0. |
|
| 72 | + */ |
|
| 73 | + public function find_matching_product_variation( $product, $match_attributes = array() ); |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Make sure all variations have a sort order set so they can be reordered correctly. |
|
| 77 | - * |
|
| 78 | - * @param int $parent_id Parent ID. |
|
| 79 | - */ |
|
| 80 | - public function sort_all_product_variations( $parent_id ); |
|
| 75 | + /** |
|
| 76 | + * Make sure all variations have a sort order set so they can be reordered correctly. |
|
| 77 | + * |
|
| 78 | + * @param int $parent_id Parent ID. |
|
| 79 | + */ |
|
| 80 | + public function sort_all_product_variations( $parent_id ); |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * Return a list of related products (using data like categories and IDs). |
|
| 84 | - * |
|
| 85 | - * @param array $cats_array List of categories IDs. |
|
| 86 | - * @param array $tags_array List of tags IDs. |
|
| 87 | - * @param array $exclude_ids Excluded IDs. |
|
| 88 | - * @param int $limit Limit of results. |
|
| 89 | - * @param int $product_id Product ID. |
|
| 90 | - * @return array |
|
| 91 | - */ |
|
| 92 | - public function get_related_products( $cats_array, $tags_array, $exclude_ids, $limit, $product_id ); |
|
| 82 | + /** |
|
| 83 | + * Return a list of related products (using data like categories and IDs). |
|
| 84 | + * |
|
| 85 | + * @param array $cats_array List of categories IDs. |
|
| 86 | + * @param array $tags_array List of tags IDs. |
|
| 87 | + * @param array $exclude_ids Excluded IDs. |
|
| 88 | + * @param int $limit Limit of results. |
|
| 89 | + * @param int $product_id Product ID. |
|
| 90 | + * @return array |
|
| 91 | + */ |
|
| 92 | + public function get_related_products( $cats_array, $tags_array, $exclude_ids, $limit, $product_id ); |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * Update a product's stock amount directly. |
|
| 96 | - * |
|
| 97 | - * Uses queries rather than update_post_meta so we can do this in one query (to avoid stock issues). |
|
| 98 | - * |
|
| 99 | - * @param int $product_id_with_stock Product ID. |
|
| 100 | - * @param int|null $stock_quantity Stock quantity to update to. |
|
| 101 | - * @param string $operation Either set, increase or decrease. |
|
| 102 | - */ |
|
| 103 | - public function update_product_stock( $product_id_with_stock, $stock_quantity = null, $operation = 'set' ); |
|
| 94 | + /** |
|
| 95 | + * Update a product's stock amount directly. |
|
| 96 | + * |
|
| 97 | + * Uses queries rather than update_post_meta so we can do this in one query (to avoid stock issues). |
|
| 98 | + * |
|
| 99 | + * @param int $product_id_with_stock Product ID. |
|
| 100 | + * @param int|null $stock_quantity Stock quantity to update to. |
|
| 101 | + * @param string $operation Either set, increase or decrease. |
|
| 102 | + */ |
|
| 103 | + public function update_product_stock( $product_id_with_stock, $stock_quantity = null, $operation = 'set' ); |
|
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Update a product's sale count directly. |
|
| 107 | - * |
|
| 108 | - * Uses queries rather than update_post_meta so we can do this in one query for performance. |
|
| 109 | - * |
|
| 110 | - * @param int $product_id Product ID. |
|
| 111 | - * @param int|null $quantity Stock quantity to use for update. |
|
| 112 | - * @param string $operation Either set, increase or decrease. |
|
| 113 | - */ |
|
| 114 | - public function update_product_sales( $product_id, $quantity = null, $operation = 'set' ); |
|
| 105 | + /** |
|
| 106 | + * Update a product's sale count directly. |
|
| 107 | + * |
|
| 108 | + * Uses queries rather than update_post_meta so we can do this in one query for performance. |
|
| 109 | + * |
|
| 110 | + * @param int $product_id Product ID. |
|
| 111 | + * @param int|null $quantity Stock quantity to use for update. |
|
| 112 | + * @param string $operation Either set, increase or decrease. |
|
| 113 | + */ |
|
| 114 | + public function update_product_sales( $product_id, $quantity = null, $operation = 'set' ); |
|
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * Get shipping class ID by slug. |
|
| 118 | - * |
|
| 119 | - * @param string $slug Shipping class slug. |
|
| 120 | - * @return int|false |
|
| 121 | - */ |
|
| 122 | - public function get_shipping_class_id_by_slug( $slug ); |
|
| 116 | + /** |
|
| 117 | + * Get shipping class ID by slug. |
|
| 118 | + * |
|
| 119 | + * @param string $slug Shipping class slug. |
|
| 120 | + * @return int|false |
|
| 121 | + */ |
|
| 122 | + public function get_shipping_class_id_by_slug( $slug ); |
|
| 123 | 123 | |
| 124 | - /** |
|
| 125 | - * Returns an array of products. |
|
| 126 | - * |
|
| 127 | - * @param array $args @see wc_get_products. |
|
| 128 | - * @return array |
|
| 129 | - */ |
|
| 130 | - public function get_products( $args = array() ); |
|
| 124 | + /** |
|
| 125 | + * Returns an array of products. |
|
| 126 | + * |
|
| 127 | + * @param array $args @see wc_get_products. |
|
| 128 | + * @return array |
|
| 129 | + */ |
|
| 130 | + public function get_products( $args = array() ); |
|
| 131 | 131 | |
| 132 | - /** |
|
| 133 | - * Get the product type based on product ID. |
|
| 134 | - * |
|
| 135 | - * @param int $product_id Product ID. |
|
| 136 | - * @return bool|string |
|
| 137 | - */ |
|
| 138 | - public function get_product_type( $product_id ); |
|
| 132 | + /** |
|
| 133 | + * Get the product type based on product ID. |
|
| 134 | + * |
|
| 135 | + * @param int $product_id Product ID. |
|
| 136 | + * @return bool|string |
|
| 137 | + */ |
|
| 138 | + public function get_product_type( $product_id ); |
|
| 139 | 139 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * @param string $sku SKU. |
| 40 | 40 | * @return bool |
| 41 | 41 | */ |
| 42 | - public function is_existing_sku( $product_id, $sku ); |
|
| 42 | + public function is_existing_sku($product_id, $sku); |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Return product ID based on SKU. |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @param string $sku SKU. |
| 48 | 48 | * @return int |
| 49 | 49 | */ |
| 50 | - public function get_product_id_by_sku( $sku ); |
|
| 50 | + public function get_product_id_by_sku($sku); |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Returns an array of IDs of products that have sales starting soon. |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | * @param array $match_attributes Array of attributes we want to try to match. |
| 71 | 71 | * @return int Matching variation ID or 0. |
| 72 | 72 | */ |
| 73 | - public function find_matching_product_variation( $product, $match_attributes = array() ); |
|
| 73 | + public function find_matching_product_variation($product, $match_attributes = array()); |
|
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * Make sure all variations have a sort order set so they can be reordered correctly. |
| 77 | 77 | * |
| 78 | 78 | * @param int $parent_id Parent ID. |
| 79 | 79 | */ |
| 80 | - public function sort_all_product_variations( $parent_id ); |
|
| 80 | + public function sort_all_product_variations($parent_id); |
|
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * Return a list of related products (using data like categories and IDs). |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @param int $product_id Product ID. |
| 90 | 90 | * @return array |
| 91 | 91 | */ |
| 92 | - public function get_related_products( $cats_array, $tags_array, $exclude_ids, $limit, $product_id ); |
|
| 92 | + public function get_related_products($cats_array, $tags_array, $exclude_ids, $limit, $product_id); |
|
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | * Update a product's stock amount directly. |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @param int|null $stock_quantity Stock quantity to update to. |
| 101 | 101 | * @param string $operation Either set, increase or decrease. |
| 102 | 102 | */ |
| 103 | - public function update_product_stock( $product_id_with_stock, $stock_quantity = null, $operation = 'set' ); |
|
| 103 | + public function update_product_stock($product_id_with_stock, $stock_quantity = null, $operation = 'set'); |
|
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * Update a product's sale count directly. |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @param int|null $quantity Stock quantity to use for update. |
| 112 | 112 | * @param string $operation Either set, increase or decrease. |
| 113 | 113 | */ |
| 114 | - public function update_product_sales( $product_id, $quantity = null, $operation = 'set' ); |
|
| 114 | + public function update_product_sales($product_id, $quantity = null, $operation = 'set'); |
|
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | 117 | * Get shipping class ID by slug. |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @param string $slug Shipping class slug. |
| 120 | 120 | * @return int|false |
| 121 | 121 | */ |
| 122 | - public function get_shipping_class_id_by_slug( $slug ); |
|
| 122 | + public function get_shipping_class_id_by_slug($slug); |
|
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | 125 | * Returns an array of products. |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @param array $args @see wc_get_products. |
| 128 | 128 | * @return array |
| 129 | 129 | */ |
| 130 | - public function get_products( $args = array() ); |
|
| 130 | + public function get_products($args = array()); |
|
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | 133 | * Get the product type based on product ID. |
@@ -135,5 +135,5 @@ discard block |
||
| 135 | 135 | * @param int $product_id Product ID. |
| 136 | 136 | * @return bool|string |
| 137 | 137 | */ |
| 138 | - public function get_product_type( $product_id ); |
|
| 138 | + public function get_product_type($product_id); |
|
| 139 | 139 | } |
@@ -14,12 +14,12 @@ |
||
| 14 | 14 | * @version 3.0.0 |
| 15 | 15 | */ |
| 16 | 16 | interface WC_Order_Item_Product_Data_Store_Interface { |
| 17 | - /** |
|
| 18 | - * Get a list of download IDs for a specific item from an order. |
|
| 19 | - * |
|
| 20 | - * @param WC_Order_Item $item Item object. |
|
| 21 | - * @param WC_Order $order Order object. |
|
| 22 | - * @return array |
|
| 23 | - */ |
|
| 24 | - public function get_download_ids( $item, $order ); |
|
| 17 | + /** |
|
| 18 | + * Get a list of download IDs for a specific item from an order. |
|
| 19 | + * |
|
| 20 | + * @param WC_Order_Item $item Item object. |
|
| 21 | + * @param WC_Order $order Order object. |
|
| 22 | + * @return array |
|
| 23 | + */ |
|
| 24 | + public function get_download_ids( $item, $order ); |
|
| 25 | 25 | } |
@@ -21,5 +21,5 @@ |
||
| 21 | 21 | * @param WC_Order $order Order object. |
| 22 | 22 | * @return array |
| 23 | 23 | */ |
| 24 | - public function get_download_ids( $item, $order ); |
|
| 24 | + public function get_download_ids($item, $order); |
|
| 25 | 25 | } |
@@ -12,67 +12,67 @@ |
||
| 12 | 12 | * @version 3.0.0 |
| 13 | 13 | */ |
| 14 | 14 | interface WC_Object_Data_Store_Interface { |
| 15 | - /** |
|
| 16 | - * Method to create a new record of a WC_Data based object. |
|
| 17 | - * |
|
| 18 | - * @param WC_Data $data Data object. |
|
| 19 | - */ |
|
| 20 | - public function create( &$data ); |
|
| 15 | + /** |
|
| 16 | + * Method to create a new record of a WC_Data based object. |
|
| 17 | + * |
|
| 18 | + * @param WC_Data $data Data object. |
|
| 19 | + */ |
|
| 20 | + public function create( &$data ); |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Method to read a record. Creates a new WC_Data based object. |
|
| 24 | - * |
|
| 25 | - * @param WC_Data $data Data object. |
|
| 26 | - */ |
|
| 27 | - public function read( &$data ); |
|
| 22 | + /** |
|
| 23 | + * Method to read a record. Creates a new WC_Data based object. |
|
| 24 | + * |
|
| 25 | + * @param WC_Data $data Data object. |
|
| 26 | + */ |
|
| 27 | + public function read( &$data ); |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Updates a record in the database. |
|
| 31 | - * |
|
| 32 | - * @param WC_Data $data Data object. |
|
| 33 | - */ |
|
| 34 | - public function update( &$data ); |
|
| 29 | + /** |
|
| 30 | + * Updates a record in the database. |
|
| 31 | + * |
|
| 32 | + * @param WC_Data $data Data object. |
|
| 33 | + */ |
|
| 34 | + public function update( &$data ); |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Deletes a record from the database. |
|
| 38 | - * |
|
| 39 | - * @param WC_Data $data Data object. |
|
| 40 | - * @param array $args Array of args to pass to the delete method. |
|
| 41 | - * @return bool result |
|
| 42 | - */ |
|
| 43 | - public function delete( &$data, $args = array() ); |
|
| 36 | + /** |
|
| 37 | + * Deletes a record from the database. |
|
| 38 | + * |
|
| 39 | + * @param WC_Data $data Data object. |
|
| 40 | + * @param array $args Array of args to pass to the delete method. |
|
| 41 | + * @return bool result |
|
| 42 | + */ |
|
| 43 | + public function delete( &$data, $args = array() ); |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Returns an array of meta for an object. |
|
| 47 | - * |
|
| 48 | - * @param WC_Data $data Data object. |
|
| 49 | - * @return array |
|
| 50 | - */ |
|
| 51 | - public function read_meta( &$data ); |
|
| 45 | + /** |
|
| 46 | + * Returns an array of meta for an object. |
|
| 47 | + * |
|
| 48 | + * @param WC_Data $data Data object. |
|
| 49 | + * @return array |
|
| 50 | + */ |
|
| 51 | + public function read_meta( &$data ); |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Deletes meta based on meta ID. |
|
| 55 | - * |
|
| 56 | - * @param WC_Data $data Data object. |
|
| 57 | - * @param object $meta Meta object (containing at least ->id). |
|
| 58 | - * @return array |
|
| 59 | - */ |
|
| 60 | - public function delete_meta( &$data, $meta ); |
|
| 53 | + /** |
|
| 54 | + * Deletes meta based on meta ID. |
|
| 55 | + * |
|
| 56 | + * @param WC_Data $data Data object. |
|
| 57 | + * @param object $meta Meta object (containing at least ->id). |
|
| 58 | + * @return array |
|
| 59 | + */ |
|
| 60 | + public function delete_meta( &$data, $meta ); |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Add new piece of meta. |
|
| 64 | - * |
|
| 65 | - * @param WC_Data $data Data object. |
|
| 66 | - * @param object $meta Meta object (containing ->key and ->value). |
|
| 67 | - * @return int meta ID |
|
| 68 | - */ |
|
| 69 | - public function add_meta( &$data, $meta ); |
|
| 62 | + /** |
|
| 63 | + * Add new piece of meta. |
|
| 64 | + * |
|
| 65 | + * @param WC_Data $data Data object. |
|
| 66 | + * @param object $meta Meta object (containing ->key and ->value). |
|
| 67 | + * @return int meta ID |
|
| 68 | + */ |
|
| 69 | + public function add_meta( &$data, $meta ); |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Update meta. |
|
| 73 | - * |
|
| 74 | - * @param WC_Data $data Data object. |
|
| 75 | - * @param object $meta Meta object (containing ->id, ->key and ->value). |
|
| 76 | - */ |
|
| 77 | - public function update_meta( &$data, $meta ); |
|
| 71 | + /** |
|
| 72 | + * Update meta. |
|
| 73 | + * |
|
| 74 | + * @param WC_Data $data Data object. |
|
| 75 | + * @param object $meta Meta object (containing ->id, ->key and ->value). |
|
| 76 | + */ |
|
| 77 | + public function update_meta( &$data, $meta ); |
|
| 78 | 78 | } |
@@ -17,21 +17,21 @@ discard block |
||
| 17 | 17 | * |
| 18 | 18 | * @param WC_Data $data Data object. |
| 19 | 19 | */ |
| 20 | - public function create( &$data ); |
|
| 20 | + public function create(&$data); |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Method to read a record. Creates a new WC_Data based object. |
| 24 | 24 | * |
| 25 | 25 | * @param WC_Data $data Data object. |
| 26 | 26 | */ |
| 27 | - public function read( &$data ); |
|
| 27 | + public function read(&$data); |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Updates a record in the database. |
| 31 | 31 | * |
| 32 | 32 | * @param WC_Data $data Data object. |
| 33 | 33 | */ |
| 34 | - public function update( &$data ); |
|
| 34 | + public function update(&$data); |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Deletes a record from the database. |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param array $args Array of args to pass to the delete method. |
| 41 | 41 | * @return bool result |
| 42 | 42 | */ |
| 43 | - public function delete( &$data, $args = array() ); |
|
| 43 | + public function delete(&$data, $args = array()); |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Returns an array of meta for an object. |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param WC_Data $data Data object. |
| 49 | 49 | * @return array |
| 50 | 50 | */ |
| 51 | - public function read_meta( &$data ); |
|
| 51 | + public function read_meta(&$data); |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Deletes meta based on meta ID. |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param object $meta Meta object (containing at least ->id). |
| 58 | 58 | * @return array |
| 59 | 59 | */ |
| 60 | - public function delete_meta( &$data, $meta ); |
|
| 60 | + public function delete_meta(&$data, $meta); |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * Add new piece of meta. |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @param object $meta Meta object (containing ->key and ->value). |
| 67 | 67 | * @return int meta ID |
| 68 | 68 | */ |
| 69 | - public function add_meta( &$data, $meta ); |
|
| 69 | + public function add_meta(&$data, $meta); |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * Update meta. |
@@ -74,5 +74,5 @@ discard block |
||
| 74 | 74 | * @param WC_Data $data Data object. |
| 75 | 75 | * @param object $meta Meta object (containing ->id, ->key and ->value). |
| 76 | 76 | */ |
| 77 | - public function update_meta( &$data, $meta ); |
|
| 77 | + public function update_meta(&$data, $meta); |
|
| 78 | 78 | } |
@@ -14,45 +14,45 @@ |
||
| 14 | 14 | * @version 3.0.0 |
| 15 | 15 | */ |
| 16 | 16 | interface WC_Coupon_Data_Store_Interface { |
| 17 | - /** |
|
| 18 | - * Increase usage count for current coupon. |
|
| 19 | - * |
|
| 20 | - * @param WC_Coupon $coupon Coupon object. |
|
| 21 | - * @param string $used_by Either user ID or billing email. |
|
| 22 | - */ |
|
| 23 | - public function increase_usage_count( &$coupon, $used_by = '' ); |
|
| 17 | + /** |
|
| 18 | + * Increase usage count for current coupon. |
|
| 19 | + * |
|
| 20 | + * @param WC_Coupon $coupon Coupon object. |
|
| 21 | + * @param string $used_by Either user ID or billing email. |
|
| 22 | + */ |
|
| 23 | + public function increase_usage_count( &$coupon, $used_by = '' ); |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Decrease usage count for current coupon. |
|
| 27 | - * |
|
| 28 | - * @param WC_Coupon $coupon Coupon object. |
|
| 29 | - * @param string $used_by Either user ID or billing email. |
|
| 30 | - */ |
|
| 31 | - public function decrease_usage_count( &$coupon, $used_by = '' ); |
|
| 25 | + /** |
|
| 26 | + * Decrease usage count for current coupon. |
|
| 27 | + * |
|
| 28 | + * @param WC_Coupon $coupon Coupon object. |
|
| 29 | + * @param string $used_by Either user ID or billing email. |
|
| 30 | + */ |
|
| 31 | + public function decrease_usage_count( &$coupon, $used_by = '' ); |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Get the number of uses for a coupon by user ID. |
|
| 35 | - * |
|
| 36 | - * @param WC_Coupon $coupon Coupon object. |
|
| 37 | - * @param int $user_id User ID. |
|
| 38 | - * @return int |
|
| 39 | - */ |
|
| 40 | - public function get_usage_by_user_id( &$coupon, $user_id ); |
|
| 33 | + /** |
|
| 34 | + * Get the number of uses for a coupon by user ID. |
|
| 35 | + * |
|
| 36 | + * @param WC_Coupon $coupon Coupon object. |
|
| 37 | + * @param int $user_id User ID. |
|
| 38 | + * @return int |
|
| 39 | + */ |
|
| 40 | + public function get_usage_by_user_id( &$coupon, $user_id ); |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Return a coupon code for a specific ID. |
|
| 44 | - * |
|
| 45 | - * @param int $id Coupon ID. |
|
| 46 | - * @return string Coupon Code. |
|
| 47 | - */ |
|
| 48 | - public function get_code_by_id( $id ); |
|
| 42 | + /** |
|
| 43 | + * Return a coupon code for a specific ID. |
|
| 44 | + * |
|
| 45 | + * @param int $id Coupon ID. |
|
| 46 | + * @return string Coupon Code. |
|
| 47 | + */ |
|
| 48 | + public function get_code_by_id( $id ); |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Return an array of IDs for for a specific coupon code. |
|
| 52 | - * Can return multiple to check for existence. |
|
| 53 | - * |
|
| 54 | - * @param string $code Coupon code. |
|
| 55 | - * @return array Array of IDs. |
|
| 56 | - */ |
|
| 57 | - public function get_ids_by_code( $code ); |
|
| 50 | + /** |
|
| 51 | + * Return an array of IDs for for a specific coupon code. |
|
| 52 | + * Can return multiple to check for existence. |
|
| 53 | + * |
|
| 54 | + * @param string $code Coupon code. |
|
| 55 | + * @return array Array of IDs. |
|
| 56 | + */ |
|
| 57 | + public function get_ids_by_code( $code ); |
|
| 58 | 58 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @param WC_Coupon $coupon Coupon object. |
| 21 | 21 | * @param string $used_by Either user ID or billing email. |
| 22 | 22 | */ |
| 23 | - public function increase_usage_count( &$coupon, $used_by = '' ); |
|
| 23 | + public function increase_usage_count(&$coupon, $used_by = ''); |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Decrease usage count for current coupon. |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * @param WC_Coupon $coupon Coupon object. |
| 29 | 29 | * @param string $used_by Either user ID or billing email. |
| 30 | 30 | */ |
| 31 | - public function decrease_usage_count( &$coupon, $used_by = '' ); |
|
| 31 | + public function decrease_usage_count(&$coupon, $used_by = ''); |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Get the number of uses for a coupon by user ID. |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @param int $user_id User ID. |
| 38 | 38 | * @return int |
| 39 | 39 | */ |
| 40 | - public function get_usage_by_user_id( &$coupon, $user_id ); |
|
| 40 | + public function get_usage_by_user_id(&$coupon, $user_id); |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Return a coupon code for a specific ID. |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * @param int $id Coupon ID. |
| 46 | 46 | * @return string Coupon Code. |
| 47 | 47 | */ |
| 48 | - public function get_code_by_id( $id ); |
|
| 48 | + public function get_code_by_id($id); |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Return an array of IDs for for a specific coupon code. |
@@ -54,5 +54,5 @@ discard block |
||
| 54 | 54 | * @param string $code Coupon code. |
| 55 | 55 | * @return array Array of IDs. |
| 56 | 56 | */ |
| 57 | - public function get_ids_by_code( $code ); |
|
| 57 | + public function get_ids_by_code($code); |
|
| 58 | 58 | } |
@@ -15,88 +15,88 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | interface WC_Order_Item_Data_Store_Interface { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Add an order item to an order. |
|
| 20 | - * |
|
| 21 | - * @param int $order_id Order ID. |
|
| 22 | - * @param array $item order_item_name and order_item_type. |
|
| 23 | - * @return int Order Item ID |
|
| 24 | - */ |
|
| 25 | - public function add_order_item( $order_id, $item ); |
|
| 18 | + /** |
|
| 19 | + * Add an order item to an order. |
|
| 20 | + * |
|
| 21 | + * @param int $order_id Order ID. |
|
| 22 | + * @param array $item order_item_name and order_item_type. |
|
| 23 | + * @return int Order Item ID |
|
| 24 | + */ |
|
| 25 | + public function add_order_item( $order_id, $item ); |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Update an order item. |
|
| 29 | - * |
|
| 30 | - * @param int $item_id Item ID. |
|
| 31 | - * @param array $item order_item_name or order_item_type. |
|
| 32 | - * @return boolean |
|
| 33 | - */ |
|
| 34 | - public function update_order_item( $item_id, $item ); |
|
| 27 | + /** |
|
| 28 | + * Update an order item. |
|
| 29 | + * |
|
| 30 | + * @param int $item_id Item ID. |
|
| 31 | + * @param array $item order_item_name or order_item_type. |
|
| 32 | + * @return boolean |
|
| 33 | + */ |
|
| 34 | + public function update_order_item( $item_id, $item ); |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Delete an order item. |
|
| 38 | - * |
|
| 39 | - * @param int $item_id Item ID. |
|
| 40 | - */ |
|
| 41 | - public function delete_order_item( $item_id ); |
|
| 36 | + /** |
|
| 37 | + * Delete an order item. |
|
| 38 | + * |
|
| 39 | + * @param int $item_id Item ID. |
|
| 40 | + */ |
|
| 41 | + public function delete_order_item( $item_id ); |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Update term meta. |
|
| 45 | - * |
|
| 46 | - * @param int $item_id Item ID. |
|
| 47 | - * @param string $meta_key Meta key. |
|
| 48 | - * @param mixed $meta_value Meta value. |
|
| 49 | - * @param string $prev_value Previous value (default: ''). |
|
| 50 | - * @return bool |
|
| 51 | - */ |
|
| 52 | - public function update_metadata( $item_id, $meta_key, $meta_value, $prev_value = '' ); |
|
| 43 | + /** |
|
| 44 | + * Update term meta. |
|
| 45 | + * |
|
| 46 | + * @param int $item_id Item ID. |
|
| 47 | + * @param string $meta_key Meta key. |
|
| 48 | + * @param mixed $meta_value Meta value. |
|
| 49 | + * @param string $prev_value Previous value (default: ''). |
|
| 50 | + * @return bool |
|
| 51 | + */ |
|
| 52 | + public function update_metadata( $item_id, $meta_key, $meta_value, $prev_value = '' ); |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Add term meta. |
|
| 56 | - * |
|
| 57 | - * @param int $item_id Item ID. |
|
| 58 | - * @param string $meta_key Meta key. |
|
| 59 | - * @param mixed $meta_value Meta value. |
|
| 60 | - * @param bool $unique Unique? (default: false). |
|
| 61 | - * @return int New row ID or 0 |
|
| 62 | - */ |
|
| 63 | - public function add_metadata( $item_id, $meta_key, $meta_value, $unique = false ); |
|
| 54 | + /** |
|
| 55 | + * Add term meta. |
|
| 56 | + * |
|
| 57 | + * @param int $item_id Item ID. |
|
| 58 | + * @param string $meta_key Meta key. |
|
| 59 | + * @param mixed $meta_value Meta value. |
|
| 60 | + * @param bool $unique Unique? (default: false). |
|
| 61 | + * @return int New row ID or 0 |
|
| 62 | + */ |
|
| 63 | + public function add_metadata( $item_id, $meta_key, $meta_value, $unique = false ); |
|
| 64 | 64 | |
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Delete term meta. |
|
| 68 | - * |
|
| 69 | - * @param int $item_id Item ID. |
|
| 70 | - * @param string $meta_key Meta key. |
|
| 71 | - * @param string $meta_value Meta value (default: ''). |
|
| 72 | - * @param bool $delete_all Delete all matching entries? (default: false). |
|
| 73 | - * @return bool |
|
| 74 | - */ |
|
| 75 | - public function delete_metadata( $item_id, $meta_key, $meta_value = '', $delete_all = false ); |
|
| 66 | + /** |
|
| 67 | + * Delete term meta. |
|
| 68 | + * |
|
| 69 | + * @param int $item_id Item ID. |
|
| 70 | + * @param string $meta_key Meta key. |
|
| 71 | + * @param string $meta_value Meta value (default: ''). |
|
| 72 | + * @param bool $delete_all Delete all matching entries? (default: false). |
|
| 73 | + * @return bool |
|
| 74 | + */ |
|
| 75 | + public function delete_metadata( $item_id, $meta_key, $meta_value = '', $delete_all = false ); |
|
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * Get term meta. |
|
| 79 | - * |
|
| 80 | - * @param int $item_id Item ID. |
|
| 81 | - * @param string $key Meta key. |
|
| 82 | - * @param bool $single Store as single value and not serialised (default: true). |
|
| 83 | - * @return mixed |
|
| 84 | - */ |
|
| 85 | - public function get_metadata( $item_id, $key, $single = true ); |
|
| 77 | + /** |
|
| 78 | + * Get term meta. |
|
| 79 | + * |
|
| 80 | + * @param int $item_id Item ID. |
|
| 81 | + * @param string $key Meta key. |
|
| 82 | + * @param bool $single Store as single value and not serialised (default: true). |
|
| 83 | + * @return mixed |
|
| 84 | + */ |
|
| 85 | + public function get_metadata( $item_id, $key, $single = true ); |
|
| 86 | 86 | |
| 87 | - /** |
|
| 88 | - * Get order ID by order item ID. |
|
| 89 | - * |
|
| 90 | - * @param int $item_id Item ID. |
|
| 91 | - * @return int |
|
| 92 | - */ |
|
| 93 | - public function get_order_id_by_order_item_id( $item_id ); |
|
| 87 | + /** |
|
| 88 | + * Get order ID by order item ID. |
|
| 89 | + * |
|
| 90 | + * @param int $item_id Item ID. |
|
| 91 | + * @return int |
|
| 92 | + */ |
|
| 93 | + public function get_order_id_by_order_item_id( $item_id ); |
|
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * Get the order item type based on Item ID. |
|
| 97 | - * |
|
| 98 | - * @param int $item_id Item ID. |
|
| 99 | - * @return string |
|
| 100 | - */ |
|
| 101 | - public function get_order_item_type( $item_id ); |
|
| 95 | + /** |
|
| 96 | + * Get the order item type based on Item ID. |
|
| 97 | + * |
|
| 98 | + * @param int $item_id Item ID. |
|
| 99 | + * @return string |
|
| 100 | + */ |
|
| 101 | + public function get_order_item_type( $item_id ); |
|
| 102 | 102 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * @param array $item order_item_name and order_item_type. |
| 23 | 23 | * @return int Order Item ID |
| 24 | 24 | */ |
| 25 | - public function add_order_item( $order_id, $item ); |
|
| 25 | + public function add_order_item($order_id, $item); |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Update an order item. |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | * @param array $item order_item_name or order_item_type. |
| 32 | 32 | * @return boolean |
| 33 | 33 | */ |
| 34 | - public function update_order_item( $item_id, $item ); |
|
| 34 | + public function update_order_item($item_id, $item); |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Delete an order item. |
| 38 | 38 | * |
| 39 | 39 | * @param int $item_id Item ID. |
| 40 | 40 | */ |
| 41 | - public function delete_order_item( $item_id ); |
|
| 41 | + public function delete_order_item($item_id); |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Update term meta. |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @param string $prev_value Previous value (default: ''). |
| 50 | 50 | * @return bool |
| 51 | 51 | */ |
| 52 | - public function update_metadata( $item_id, $meta_key, $meta_value, $prev_value = '' ); |
|
| 52 | + public function update_metadata($item_id, $meta_key, $meta_value, $prev_value = ''); |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * Add term meta. |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @param bool $unique Unique? (default: false). |
| 61 | 61 | * @return int New row ID or 0 |
| 62 | 62 | */ |
| 63 | - public function add_metadata( $item_id, $meta_key, $meta_value, $unique = false ); |
|
| 63 | + public function add_metadata($item_id, $meta_key, $meta_value, $unique = false); |
|
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @param bool $delete_all Delete all matching entries? (default: false). |
| 73 | 73 | * @return bool |
| 74 | 74 | */ |
| 75 | - public function delete_metadata( $item_id, $meta_key, $meta_value = '', $delete_all = false ); |
|
| 75 | + public function delete_metadata($item_id, $meta_key, $meta_value = '', $delete_all = false); |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Get term meta. |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * @param bool $single Store as single value and not serialised (default: true). |
| 83 | 83 | * @return mixed |
| 84 | 84 | */ |
| 85 | - public function get_metadata( $item_id, $key, $single = true ); |
|
| 85 | + public function get_metadata($item_id, $key, $single = true); |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Get order ID by order item ID. |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @param int $item_id Item ID. |
| 91 | 91 | * @return int |
| 92 | 92 | */ |
| 93 | - public function get_order_id_by_order_item_id( $item_id ); |
|
| 93 | + public function get_order_id_by_order_item_id($item_id); |
|
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * Get the order item type based on Item ID. |
@@ -98,5 +98,5 @@ discard block |
||
| 98 | 98 | * @param int $item_id Item ID. |
| 99 | 99 | * @return string |
| 100 | 100 | */ |
| 101 | - public function get_order_item_type( $item_id ); |
|
| 101 | + public function get_order_item_type($item_id); |
|
| 102 | 102 | } |
@@ -14,58 +14,58 @@ |
||
| 14 | 14 | * @version 3.0.0 |
| 15 | 15 | */ |
| 16 | 16 | interface WC_Payment_Token_Data_Store_Interface { |
| 17 | - /** |
|
| 18 | - * Returns an array of objects (stdObject) matching specific token criteria. |
|
| 19 | - * Accepts token_id, user_id, gateway_id, and type. |
|
| 20 | - * Each object should contain the fields token_id, gateway_id, token, user_id, type, is_default. |
|
| 21 | - * |
|
| 22 | - * @param array $args Arguments. |
|
| 23 | - * @return array |
|
| 24 | - */ |
|
| 25 | - public function get_tokens( $args ); |
|
| 17 | + /** |
|
| 18 | + * Returns an array of objects (stdObject) matching specific token criteria. |
|
| 19 | + * Accepts token_id, user_id, gateway_id, and type. |
|
| 20 | + * Each object should contain the fields token_id, gateway_id, token, user_id, type, is_default. |
|
| 21 | + * |
|
| 22 | + * @param array $args Arguments. |
|
| 23 | + * @return array |
|
| 24 | + */ |
|
| 25 | + public function get_tokens( $args ); |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Returns an stdObject of a token for a user's default token. |
|
| 29 | - * Should contain the fields token_id, gateway_id, token, user_id, type, is_default. |
|
| 30 | - * |
|
| 31 | - * @param int $user_id User ID. |
|
| 32 | - * @return object |
|
| 33 | - */ |
|
| 34 | - public function get_users_default_token( $user_id ); |
|
| 27 | + /** |
|
| 28 | + * Returns an stdObject of a token for a user's default token. |
|
| 29 | + * Should contain the fields token_id, gateway_id, token, user_id, type, is_default. |
|
| 30 | + * |
|
| 31 | + * @param int $user_id User ID. |
|
| 32 | + * @return object |
|
| 33 | + */ |
|
| 34 | + public function get_users_default_token( $user_id ); |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Returns an stdObject of a token. |
|
| 38 | - * Should contain the fields token_id, gateway_id, token, user_id, type, is_default. |
|
| 39 | - * |
|
| 40 | - * @param int $token_id Token ID. |
|
| 41 | - * @return object |
|
| 42 | - */ |
|
| 43 | - public function get_token_by_id( $token_id ); |
|
| 36 | + /** |
|
| 37 | + * Returns an stdObject of a token. |
|
| 38 | + * Should contain the fields token_id, gateway_id, token, user_id, type, is_default. |
|
| 39 | + * |
|
| 40 | + * @param int $token_id Token ID. |
|
| 41 | + * @return object |
|
| 42 | + */ |
|
| 43 | + public function get_token_by_id( $token_id ); |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Returns metadata for a specific payment token. |
|
| 47 | - * |
|
| 48 | - * @param int $token_id Token ID. |
|
| 49 | - * @return array |
|
| 50 | - */ |
|
| 51 | - public function get_metadata( $token_id ); |
|
| 45 | + /** |
|
| 46 | + * Returns metadata for a specific payment token. |
|
| 47 | + * |
|
| 48 | + * @param int $token_id Token ID. |
|
| 49 | + * @return array |
|
| 50 | + */ |
|
| 51 | + public function get_metadata( $token_id ); |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Get a token's type by ID. |
|
| 55 | - * |
|
| 56 | - * @param int $token_id Token ID. |
|
| 57 | - * @return string |
|
| 58 | - */ |
|
| 59 | - public function get_token_type_by_id( $token_id ); |
|
| 53 | + /** |
|
| 54 | + * Get a token's type by ID. |
|
| 55 | + * |
|
| 56 | + * @param int $token_id Token ID. |
|
| 57 | + * @return string |
|
| 58 | + */ |
|
| 59 | + public function get_token_type_by_id( $token_id ); |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * Update's a tokens default status in the database. Used for quickly |
|
| 63 | - * looping through tokens and setting their statuses instead of creating a bunch |
|
| 64 | - * of objects. |
|
| 65 | - * |
|
| 66 | - * @param int $token_id Token ID. |
|
| 67 | - * @param bool $status If should update status. |
|
| 68 | - * @return string |
|
| 69 | - */ |
|
| 70 | - public function set_default_status( $token_id, $status = true ); |
|
| 61 | + /** |
|
| 62 | + * Update's a tokens default status in the database. Used for quickly |
|
| 63 | + * looping through tokens and setting their statuses instead of creating a bunch |
|
| 64 | + * of objects. |
|
| 65 | + * |
|
| 66 | + * @param int $token_id Token ID. |
|
| 67 | + * @param bool $status If should update status. |
|
| 68 | + * @return string |
|
| 69 | + */ |
|
| 70 | + public function set_default_status( $token_id, $status = true ); |
|
| 71 | 71 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * @param array $args Arguments. |
| 23 | 23 | * @return array |
| 24 | 24 | */ |
| 25 | - public function get_tokens( $args ); |
|
| 25 | + public function get_tokens($args); |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Returns an stdObject of a token for a user's default token. |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @param int $user_id User ID. |
| 32 | 32 | * @return object |
| 33 | 33 | */ |
| 34 | - public function get_users_default_token( $user_id ); |
|
| 34 | + public function get_users_default_token($user_id); |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Returns an stdObject of a token. |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param int $token_id Token ID. |
| 41 | 41 | * @return object |
| 42 | 42 | */ |
| 43 | - public function get_token_by_id( $token_id ); |
|
| 43 | + public function get_token_by_id($token_id); |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Returns metadata for a specific payment token. |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param int $token_id Token ID. |
| 49 | 49 | * @return array |
| 50 | 50 | */ |
| 51 | - public function get_metadata( $token_id ); |
|
| 51 | + public function get_metadata($token_id); |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Get a token's type by ID. |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * @param int $token_id Token ID. |
| 57 | 57 | * @return string |
| 58 | 58 | */ |
| 59 | - public function get_token_type_by_id( $token_id ); |
|
| 59 | + public function get_token_type_by_id($token_id); |
|
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Update's a tokens default status in the database. Used for quickly |
@@ -67,5 +67,5 @@ discard block |
||
| 67 | 67 | * @param bool $status If should update status. |
| 68 | 68 | * @return string |
| 69 | 69 | */ |
| 70 | - public function set_default_status( $token_id, $status = true ); |
|
| 70 | + public function set_default_status($token_id, $status = true); |
|
| 71 | 71 | } |
@@ -11,62 +11,62 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | interface WC_Importer_Interface { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Process importation. |
|
| 16 | - * Returns an array with the imported and failed items. |
|
| 17 | - * 'imported' contains a list of IDs. |
|
| 18 | - * 'failed' contains a list of WP_Error objects. |
|
| 19 | - * |
|
| 20 | - * Example: |
|
| 21 | - * ['imported' => [], 'failed' => []] |
|
| 22 | - * |
|
| 23 | - * @return array |
|
| 24 | - */ |
|
| 25 | - public function import(); |
|
| 14 | + /** |
|
| 15 | + * Process importation. |
|
| 16 | + * Returns an array with the imported and failed items. |
|
| 17 | + * 'imported' contains a list of IDs. |
|
| 18 | + * 'failed' contains a list of WP_Error objects. |
|
| 19 | + * |
|
| 20 | + * Example: |
|
| 21 | + * ['imported' => [], 'failed' => []] |
|
| 22 | + * |
|
| 23 | + * @return array |
|
| 24 | + */ |
|
| 25 | + public function import(); |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Get file raw keys. |
|
| 29 | - * |
|
| 30 | - * CSV - Headers. |
|
| 31 | - * XML - Element names. |
|
| 32 | - * JSON - Keys |
|
| 33 | - * |
|
| 34 | - * @return array |
|
| 35 | - */ |
|
| 36 | - public function get_raw_keys(); |
|
| 27 | + /** |
|
| 28 | + * Get file raw keys. |
|
| 29 | + * |
|
| 30 | + * CSV - Headers. |
|
| 31 | + * XML - Element names. |
|
| 32 | + * JSON - Keys |
|
| 33 | + * |
|
| 34 | + * @return array |
|
| 35 | + */ |
|
| 36 | + public function get_raw_keys(); |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Get file mapped headers. |
|
| 40 | - * |
|
| 41 | - * @return array |
|
| 42 | - */ |
|
| 43 | - public function get_mapped_keys(); |
|
| 38 | + /** |
|
| 39 | + * Get file mapped headers. |
|
| 40 | + * |
|
| 41 | + * @return array |
|
| 42 | + */ |
|
| 43 | + public function get_mapped_keys(); |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Get raw data. |
|
| 47 | - * |
|
| 48 | - * @return array |
|
| 49 | - */ |
|
| 50 | - public function get_raw_data(); |
|
| 45 | + /** |
|
| 46 | + * Get raw data. |
|
| 47 | + * |
|
| 48 | + * @return array |
|
| 49 | + */ |
|
| 50 | + public function get_raw_data(); |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Get parsed data. |
|
| 54 | - * |
|
| 55 | - * @return array |
|
| 56 | - */ |
|
| 57 | - public function get_parsed_data(); |
|
| 52 | + /** |
|
| 53 | + * Get parsed data. |
|
| 54 | + * |
|
| 55 | + * @return array |
|
| 56 | + */ |
|
| 57 | + public function get_parsed_data(); |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * Get file pointer position from the last read. |
|
| 61 | - * |
|
| 62 | - * @return int |
|
| 63 | - */ |
|
| 64 | - public function get_file_position(); |
|
| 59 | + /** |
|
| 60 | + * Get file pointer position from the last read. |
|
| 61 | + * |
|
| 62 | + * @return int |
|
| 63 | + */ |
|
| 64 | + public function get_file_position(); |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Get file pointer position as a percentage of file size. |
|
| 68 | - * |
|
| 69 | - * @return int |
|
| 70 | - */ |
|
| 71 | - public function get_percent_complete(); |
|
| 66 | + /** |
|
| 67 | + * Get file pointer position as a percentage of file size. |
|
| 68 | + * |
|
| 69 | + * @return int |
|
| 70 | + */ |
|
| 71 | + public function get_percent_complete(); |
|
| 72 | 72 | } |
@@ -14,11 +14,11 @@ |
||
| 14 | 14 | * @version 3.0.0 |
| 15 | 15 | */ |
| 16 | 16 | interface WC_Order_Item_Type_Data_Store_Interface { |
| 17 | - /** |
|
| 18 | - * Saves an item's data to the database / item meta. |
|
| 19 | - * Ran after both create and update, so $item->get_id() will be set. |
|
| 20 | - * |
|
| 21 | - * @param WC_Order_Item $item Item object. |
|
| 22 | - */ |
|
| 23 | - public function save_item_data( &$item ); |
|
| 17 | + /** |
|
| 18 | + * Saves an item's data to the database / item meta. |
|
| 19 | + * Ran after both create and update, so $item->get_id() will be set. |
|
| 20 | + * |
|
| 21 | + * @param WC_Order_Item $item Item object. |
|
| 22 | + */ |
|
| 23 | + public function save_item_data( &$item ); |
|
| 24 | 24 | } |
@@ -20,5 +20,5 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * @param WC_Order_Item $item Item object. |
| 22 | 22 | */ |
| 23 | - public function save_item_data( &$item ); |
|
| 23 | + public function save_item_data(&$item); |
|
| 24 | 24 | } |
@@ -13,58 +13,58 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | interface WC_Customer_Download_Data_Store_Interface { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Method to delete a download permission from the database by ID. |
|
| 18 | - * |
|
| 19 | - * @param int $id Download Permission ID. |
|
| 20 | - */ |
|
| 21 | - public function delete_by_id( $id ); |
|
| 16 | + /** |
|
| 17 | + * Method to delete a download permission from the database by ID. |
|
| 18 | + * |
|
| 19 | + * @param int $id Download Permission ID. |
|
| 20 | + */ |
|
| 21 | + public function delete_by_id( $id ); |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Method to delete a download permission from the database by order ID. |
|
| 25 | - * |
|
| 26 | - * @param int $id Order ID. |
|
| 27 | - */ |
|
| 28 | - public function delete_by_order_id( $id ); |
|
| 23 | + /** |
|
| 24 | + * Method to delete a download permission from the database by order ID. |
|
| 25 | + * |
|
| 26 | + * @param int $id Order ID. |
|
| 27 | + */ |
|
| 28 | + public function delete_by_order_id( $id ); |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Method to delete a download permission from the database by download ID. |
|
| 32 | - * |
|
| 33 | - * @param int $id Download ID. |
|
| 34 | - */ |
|
| 35 | - public function delete_by_download_id( $id ); |
|
| 30 | + /** |
|
| 31 | + * Method to delete a download permission from the database by download ID. |
|
| 32 | + * |
|
| 33 | + * @param int $id Download ID. |
|
| 34 | + */ |
|
| 35 | + public function delete_by_download_id( $id ); |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Get array of download ids by specified args. |
|
| 39 | - * |
|
| 40 | - * @param array $args Arguments. |
|
| 41 | - * @return array of WC_Customer_Download |
|
| 42 | - */ |
|
| 43 | - public function get_downloads( $args = array() ); |
|
| 37 | + /** |
|
| 38 | + * Get array of download ids by specified args. |
|
| 39 | + * |
|
| 40 | + * @param array $args Arguments. |
|
| 41 | + * @return array of WC_Customer_Download |
|
| 42 | + */ |
|
| 43 | + public function get_downloads( $args = array() ); |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Update download ids if the hash changes. |
|
| 47 | - * |
|
| 48 | - * @param int $product_id Product ID. |
|
| 49 | - * @param string $old_id Old ID. |
|
| 50 | - * @param string $new_id New ID. |
|
| 51 | - */ |
|
| 52 | - public function update_download_id( $product_id, $old_id, $new_id ); |
|
| 45 | + /** |
|
| 46 | + * Update download ids if the hash changes. |
|
| 47 | + * |
|
| 48 | + * @param int $product_id Product ID. |
|
| 49 | + * @param string $old_id Old ID. |
|
| 50 | + * @param string $new_id New ID. |
|
| 51 | + */ |
|
| 52 | + public function update_download_id( $product_id, $old_id, $new_id ); |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Get a customers downloads. |
|
| 56 | - * |
|
| 57 | - * @param int $customer_id Customer ID. |
|
| 58 | - * @return array |
|
| 59 | - */ |
|
| 60 | - public function get_downloads_for_customer( $customer_id ); |
|
| 54 | + /** |
|
| 55 | + * Get a customers downloads. |
|
| 56 | + * |
|
| 57 | + * @param int $customer_id Customer ID. |
|
| 58 | + * @return array |
|
| 59 | + */ |
|
| 60 | + public function get_downloads_for_customer( $customer_id ); |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Update user prop for downloads based on order id. |
|
| 64 | - * |
|
| 65 | - * @param int $order_id Order ID. |
|
| 66 | - * @param int $customer_id Customer ID. |
|
| 67 | - * @param string $email Email Address. |
|
| 68 | - */ |
|
| 69 | - public function update_user_by_order_id( $order_id, $customer_id, $email ); |
|
| 62 | + /** |
|
| 63 | + * Update user prop for downloads based on order id. |
|
| 64 | + * |
|
| 65 | + * @param int $order_id Order ID. |
|
| 66 | + * @param int $customer_id Customer ID. |
|
| 67 | + * @param string $email Email Address. |
|
| 68 | + */ |
|
| 69 | + public function update_user_by_order_id( $order_id, $customer_id, $email ); |
|
| 70 | 70 | } |
@@ -18,21 +18,21 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @param int $id Download Permission ID. |
| 20 | 20 | */ |
| 21 | - public function delete_by_id( $id ); |
|
| 21 | + public function delete_by_id($id); |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Method to delete a download permission from the database by order ID. |
| 25 | 25 | * |
| 26 | 26 | * @param int $id Order ID. |
| 27 | 27 | */ |
| 28 | - public function delete_by_order_id( $id ); |
|
| 28 | + public function delete_by_order_id($id); |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Method to delete a download permission from the database by download ID. |
| 32 | 32 | * |
| 33 | 33 | * @param int $id Download ID. |
| 34 | 34 | */ |
| 35 | - public function delete_by_download_id( $id ); |
|
| 35 | + public function delete_by_download_id($id); |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Get array of download ids by specified args. |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param array $args Arguments. |
| 41 | 41 | * @return array of WC_Customer_Download |
| 42 | 42 | */ |
| 43 | - public function get_downloads( $args = array() ); |
|
| 43 | + public function get_downloads($args = array()); |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Update download ids if the hash changes. |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @param string $old_id Old ID. |
| 50 | 50 | * @param string $new_id New ID. |
| 51 | 51 | */ |
| 52 | - public function update_download_id( $product_id, $old_id, $new_id ); |
|
| 52 | + public function update_download_id($product_id, $old_id, $new_id); |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * Get a customers downloads. |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param int $customer_id Customer ID. |
| 58 | 58 | * @return array |
| 59 | 59 | */ |
| 60 | - public function get_downloads_for_customer( $customer_id ); |
|
| 60 | + public function get_downloads_for_customer($customer_id); |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * Update user prop for downloads based on order id. |
@@ -66,5 +66,5 @@ discard block |
||
| 66 | 66 | * @param int $customer_id Customer ID. |
| 67 | 67 | * @param string $email Email Address. |
| 68 | 68 | */ |
| 69 | - public function update_user_by_order_id( $order_id, $customer_id, $email ); |
|
| 69 | + public function update_user_by_order_id($order_id, $customer_id, $email); |
|
| 70 | 70 | } |