Merge pull request woocommerce/woocommerce-admin#1993 from woocommerce/phpcs/data-stores

phpcs lint fixes for /data-stores/ folder
This commit is contained in:
Paul Sealock 2019-04-04 14:58:12 +13:00 committed by GitHub
commit a554040414
4 changed files with 8 additions and 8 deletions

View File

@ -291,14 +291,14 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store
$subclauses[] = $wpdb->prepare(
"{$param_info['column']} >{$or_equal} {$param_info['format']}",
$query_args[ $min_param ]
); // WPCS: unprepared SQL ok.
); // WPCS: unprepared SQL ok, PreparedSQLPlaceholders replacement count ok.
}
if ( isset( $query_args[ $max_param ] ) ) {
$subclauses[] = $wpdb->prepare(
"{$param_info['column']} <{$or_equal} {$param_info['format']}",
$query_args[ $max_param ]
); // WPCS: unprepared SQL ok.
); // WPCS: unprepared SQL ok, PreparedSQLPlaceholders replacement count ok.
}
if ( $subclauses ) {

View File

@ -262,7 +262,7 @@ class WC_Admin_Reports_Orders_Data_Store extends WC_Admin_Reports_Data_Store imp
$mapped_data = array();
foreach ( $products as $product ) {
if ( ! isset( $mapped_data[ $product['order_id'] ] ) ) {
$mapped_data[ $product['order_id'] ]['products'] = array();
$mapped_data[ $product['order_id'] ]['products'] = array();
}
$mapped_data[ $product['order_id'] ]['products'][] = array(
@ -285,9 +285,9 @@ class WC_Admin_Reports_Orders_Data_Store extends WC_Admin_Reports_Data_Store imp
foreach ( $orders_data as $key => $order_data ) {
$defaults = array(
'products' => array(),
'coupons' => array(),
'customer' => array(),
'products' => array(),
'coupons' => array(),
'customer' => array(),
);
$orders_data[ $key ]['extended_info'] = isset( $mapped_data[ $order_data['order_id'] ] ) ? array_merge( $defaults, $mapped_data[ $order_data['order_id'] ] ) : $defaults;
if ( $order_data['customer_id'] && isset( $mapped_customers[ $order_data['customer_id'] ] ) ) {

View File

@ -297,7 +297,7 @@ class WC_Admin_Reports_Taxes_Data_Store extends WC_Admin_Reports_Data_Store impl
if ( 'tax_code' === $order_by ) {
return 'CONCAT_WS( "-", NULLIF(tax_rate_country, ""), NULLIF(tax_rate_state, ""), NULLIF(tax_rate_name, ""), NULLIF(tax_rate_priority, "") )';
} else if ( 'rate' === $order_by ) {
} elseif ( 'rate' === $order_by ) {
return "CAST({$wpdb->prefix}woocommerce_tax_rates.tax_rate as DECIMAL(7,4))";
}

View File

@ -128,7 +128,7 @@ class WC_Admin_Reports_Variations_Data_Store extends WC_Admin_Reports_Data_Store
$sql_query_params['where_clause'] .= " AND {$order_product_lookup_table}.variation_id IN ({$allowed_variations_str})";
}
$order_status_filter = $this->get_status_subquery( $query_args );
$order_status_filter = $this->get_status_subquery( $query_args );
if ( $order_status_filter ) {
$sql_query_params['from_clause'] .= " JOIN {$wpdb->prefix}wc_order_stats ON {$order_product_lookup_table}.order_id = {$wpdb->prefix}wc_order_stats.order_id";
$sql_query_params['where_clause'] .= " AND ( {$order_status_filter} )";