diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index 3fa90257e34..5ed8b324ea4 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -936,7 +936,7 @@ class WC_Cart { if ( $product_data->managing_stock() ) { $products_qty_in_cart = $this->get_cart_item_quantities(); - if ( isset( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ] ) && ! $product_data->has_enough_stock( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ] + $quantity ) ) { + if ( isset( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ] ) && ! $product_data->has_enough_stock( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ] + $quantity ) ) { throw new Exception( sprintf( '%s %s', wc_get_cart_url(), diff --git a/includes/class-wc-product-variation.php b/includes/class-wc-product-variation.php index 6ecda369bcf..404031270d7 100644 --- a/includes/class-wc-product-variation.php +++ b/includes/class-wc-product-variation.php @@ -37,15 +37,6 @@ class WC_Product_Variation extends WC_Product_Simple { 'tax_class' => '', ); - /** - * Initialize simple product. - * - * @param mixed $product - */ - public function __construct( $product = 0 ) { - parent::__construct( $product ); - } - /** * Prefix for action and filter hooks on data. * diff --git a/includes/data-stores/class-wc-order-data-store-cpt.php b/includes/data-stores/class-wc-order-data-store-cpt.php index e9659144914..9dcbe4dc32a 100644 --- a/includes/data-stores/class-wc-order-data-store-cpt.php +++ b/includes/data-stores/class-wc-order-data-store-cpt.php @@ -64,7 +64,7 @@ class WC_Order_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT implement '_date_paid', '_payment_tokens', '_billing_address_index', - '_shipping_address_index' + '_shipping_address_index', ); /** diff --git a/tests/framework/class-wc-mock-wc-data.php b/tests/framework/class-wc-mock-wc-data.php index 6b33cfd0b2f..0e55c615cc4 100644 --- a/tests/framework/class-wc-mock-wc-data.php +++ b/tests/framework/class-wc-mock-wc-data.php @@ -155,7 +155,7 @@ class WC_Mock_WC_Data extends WC_Data { * @param string $content */ public function set_content( $content ) { - $this->set_prop('content', $content ); + $this->set_prop( 'content', $content ); } /** diff --git a/tests/unit-tests/product/data-store.php b/tests/unit-tests/product/data-store.php index 6bc3f50c4b3..df3e8909db6 100644 --- a/tests/unit-tests/product/data-store.php +++ b/tests/unit-tests/product/data-store.php @@ -346,6 +346,6 @@ class WC_Tests_Product_Data_Store extends WC_Unit_Test_Case { $loaded_variation = wc_get_product( $variation->get_id() ); $this->assertEquals( 'publish', $loaded_variation->get_status( 'edit' ) ); - $this->assertEquals( 'green', $loaded_variation->get_attributes( 'edit' )[ 'attribute_color' ] ); + $this->assertEquals( 'green', $loaded_variation->get_attributes( 'edit' )['attribute_color'] ); } }