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

This commit is contained in:
Rodrigo Primo 2018-03-08 16:27:17 -03:00
parent 03c202f1f5
commit 2b84b7c38d
1 changed files with 15 additions and 9 deletions

View File

@ -1,4 +1,10 @@
<?php
/**
* Class Abstract_WC_Order_Item_Type_Data_Store file.
*
* @package WooCommerce\DataStores
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@ -7,8 +13,6 @@ if ( ! defined( 'ABSPATH' ) ) {
* WC Order Item Data Store
*
* @version 3.0.0
* @category Class
* @author WooCommerce
*/
abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP implements WC_Object_Data_Store_Interface {
@ -16,6 +20,8 @@ abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP i
* Meta type. This should match up with
* the types available at https://codex.wordpress.org/Function_Reference/add_metadata.
* WP defines 'post', 'user', 'comment', and 'term'.
*
* @var string
*/
protected $meta_type = 'order_item';
@ -32,7 +38,7 @@ abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP i
* Create a new order item in the database.
*
* @since 3.0.0
* @param WC_Order_Item $item
* @param WC_Order_Item $item Order item object.
*/
public function create( &$item ) {
global $wpdb;
@ -57,7 +63,7 @@ abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP i
* Update a order item in the database.
*
* @since 3.0.0
* @param WC_Order_Item $item
* @param WC_Order_Item $item Order item object.
*/
public function update( &$item ) {
global $wpdb;
@ -86,7 +92,7 @@ abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP i
* Remove an order item from the database.
*
* @since 3.0.0
* @param WC_Order_Item $item
* @param WC_Order_Item $item Order item object.
* @param array $args Array of args to pass to the delete method.
*/
public function delete( &$item, $args = array() ) {
@ -105,9 +111,9 @@ abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP i
*
* @since 3.0.0
*
* @param WC_Order_Item $item
* @param WC_Order_Item $item Order item object.
*
* @throws Exception
* @throws Exception If invalid order item.
*/
public function read( &$item ) {
global $wpdb;
@ -140,14 +146,14 @@ abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP i
* Ran after both create and update, so $item->get_id() will be set.
*
* @since 3.0.0
* @param WC_Order_Item $item
* @param WC_Order_Item $item Order item object.
*/
public function save_item_data( &$item ) {}
/**
* Clear meta cache.
*
* @param WC_Order_Item $item
* @param WC_Order_Item $item Order item object.
*/
public function clear_cache( &$item ) {
wp_cache_delete( 'item-' . $item->get_id(), 'order-items' );