phpcs fixes in includes/data-stores/class-wc-order-item-data-store.php

This commit is contained in:
Rodrigo Primo 2018-03-08 16:28:40 -03:00
parent 1e32f09560
commit 67ab320a90
1 changed files with 27 additions and 23 deletions

View File

@ -1,4 +1,10 @@
<?php
/**
* Class WC_Order_Item_Data_Store file.
*
* @package WooCommerce\DataStores
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@ -7,8 +13,6 @@ if ( ! defined( 'ABSPATH' ) ) {
* WC Order Item Data Store: Misc Order Item Data functions.
*
* @version 3.0.0
* @category Class
* @author WooCommerce
*/
class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
@ -16,7 +20,7 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Add an order item to an order.
*
* @since 3.0.0
* @param int $order_id
* @param int $order_id Order ID.
* @param array $item order_item_name and order_item_type.
* @return int Order Item ID
*/
@ -43,7 +47,7 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Update an order item.
*
* @since 3.0.0
* @param int $item_id
* @param int $item_id Item ID.
* @param array $item order_item_name or order_item_type.
* @return boolean
*/
@ -56,7 +60,7 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Delete an order item.
*
* @since 3.0.0
* @param int $item_id
* @param int $item_id Item ID.
*/
public function delete_order_item( $item_id ) {
global $wpdb;
@ -68,10 +72,10 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Update term meta.
*
* @since 3.0.0
* @param int $item_id
* @param string $meta_key
* @param mixed $meta_value
* @param string $prev_value (default: '')
* @param int $item_id Item ID.
* @param string $meta_key Meta key.
* @param mixed $meta_value Meta value.
* @param string $prev_value (default: '').
* @return bool
*/
public function update_metadata( $item_id, $meta_key, $meta_value, $prev_value = '' ) {
@ -82,10 +86,10 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Add term meta.
*
* @since 3.0.0
* @param int $item_id
* @param string $meta_key
* @param mixed $meta_value
* @param bool $unique (default: false)
* @param int $item_id Item ID.
* @param string $meta_key Meta key.
* @param mixed $meta_value Meta value.
* @param bool $unique (default: false).
* @return int New row ID or 0
*/
public function add_metadata( $item_id, $meta_key, $meta_value, $unique = false ) {
@ -96,10 +100,10 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Delete term meta.
*
* @since 3.0.0
* @param int $item_id
* @param string $meta_key
* @param string $meta_value (default: '')
* @param bool $delete_all (default: false)
* @param int $item_id Item ID.
* @param string $meta_key Meta key.
* @param string $meta_value (default: '').
* @param bool $delete_all (default: false).
* @return bool
*/
public function delete_metadata( $item_id, $meta_key, $meta_value = '', $delete_all = false ) {
@ -110,9 +114,9 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Get term meta.
*
* @since 3.0.0
* @param int $item_id
* @param string $key
* @param bool $single (default: true)
* @param int $item_id Item ID.
* @param string $key Meta key.
* @param bool $single (default: true).
* @return mixed
*/
public function get_metadata( $item_id, $key, $single = true ) {
@ -123,10 +127,10 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Get order ID by order item ID.
*
* @since 3.0.0
* @param int $item_id
* @param int $item_id Item ID.
* @return int
*/
function get_order_id_by_order_item_id( $item_id ) {
public function get_order_id_by_order_item_id( $item_id ) {
global $wpdb;
return (int) $wpdb->get_var(
$wpdb->prepare(
@ -140,7 +144,7 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface {
* Get the order item type based on Item ID.
*
* @since 3.0.0
* @param int $item_id
* @param int $item_id Item ID.
* @return string
*/
public function get_order_item_type( $item_id ) {