@@ -308,10 +308,10 @@ |
||
308 | 308 | $attribute = false; |
309 | 309 | |
310 | 310 | // pa_ attributes. |
311 | - if ( isset( $attributes[ wc_attribute_taxonomy_name( $slug ) ] ) ) { |
|
312 | - $attribute = $attributes[ wc_attribute_taxonomy_name( $slug ) ]; |
|
313 | - } elseif ( isset( $attributes[ $slug ] ) ) { |
|
314 | - $attribute = $attributes[ $slug ]; |
|
311 | + if ( isset( $attributes[wc_attribute_taxonomy_name( $slug )] ) ) { |
|
312 | + $attribute = $attributes[wc_attribute_taxonomy_name( $slug )]; |
|
313 | + } elseif ( isset( $attributes[$slug] ) ) { |
|
314 | + $attribute = $attributes[$slug]; |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | if ( ! $attribute ) { |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | |
53 | 53 | // Format decimal values. |
54 | 54 | foreach ( $format_decimal as $key ) { |
55 | - $data[ $key ] = wc_format_decimal( $data[ $key ], $this->dp ); |
|
55 | + $data[$key] = wc_format_decimal( $data[$key], $this->dp ); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // Format date values. |
59 | 59 | foreach ( $format_date as $key ) { |
60 | - $datetime = $data[ $key ]; |
|
61 | - $data[ $key ] = wc_rest_prepare_date_response( $datetime, false ); |
|
62 | - $data[ $key . '_gmt' ] = wc_rest_prepare_date_response( $datetime ); |
|
60 | + $datetime = $data[$key]; |
|
61 | + $data[$key] = wc_rest_prepare_date_response( $datetime, false ); |
|
62 | + $data[$key . '_gmt'] = wc_rest_prepare_date_response( $datetime ); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | // Format the order status. |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | // Format line items. |
69 | 69 | foreach ( $format_line_items as $key ) { |
70 | - $data[ $key ] = array_values( array_map( array( $this, 'prepare_order_item_data' ), $data[ $key ] ) ); |
|
70 | + $data[$key] = array_values( array_map( array( $this, 'prepare_order_item_data' ), $data[$key] ) ); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // Refunds. |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | |
143 | 143 | // Format decimal values. |
144 | 144 | foreach ( $format_decimal as $key ) { |
145 | - if ( isset( $data[ $key ] ) ) { |
|
146 | - $data[ $key ] = wc_format_decimal( $data[ $key ], $this->dp ); |
|
145 | + if ( isset( $data[$key] ) ) { |
|
146 | + $data[$key] = wc_format_decimal( $data[$key], $this->dp ); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $taxes[] = array( |
162 | 162 | 'id' => $tax_rate_id, |
163 | 163 | 'total' => $tax, |
164 | - 'subtotal' => isset( $data['taxes']['subtotal'][ $tax_rate_id ] ) ? $data['taxes']['subtotal'][ $tax_rate_id ] : '', |
|
164 | + 'subtotal' => isset( $data['taxes']['subtotal'][$tax_rate_id] ) ? $data['taxes']['subtotal'][$tax_rate_id] : '', |
|
165 | 165 | ); |
166 | 166 | } |
167 | 167 | $data['taxes'] = $taxes; |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $response = array(); |
69 | 69 | |
70 | 70 | foreach ( $mappings as $section => $values ) { |
71 | - $response[ $section ] = $values; |
|
71 | + $response[$section] = $values; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | $response = $this->prepare_item_for_response( $response, $request ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @return array |
37 | 37 | */ |
38 | 38 | public function get_active_plugin_data() { |
39 | - return array_map( [ $this, 'format_plugin_data' ], array_map( [ $this, 'get_plugin_data' ], $this->get_active_plugins() ) ); |
|
39 | + return array_map( [$this, 'format_plugin_data'], array_map( [$this, 'get_plugin_data'], $this->get_active_plugins() ) ); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @return array |
46 | 46 | */ |
47 | 47 | public function get_inactive_plugin_data() { |
48 | - return array_map( [ $this, 'format_plugin_data' ], array_map( [ $this, 'get_plugin_data' ], $this->get_inactive_plugins() ) ); |
|
48 | + return array_map( [$this, 'format_plugin_data'], array_map( [$this, 'get_plugin_data'], $this->get_inactive_plugins() ) ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @return array |
56 | 56 | */ |
57 | 57 | public function get_dropin_and_mu_plugin_data() { |
58 | - $plugins = [ |
|
58 | + $plugins = [ |
|
59 | 59 | 'dropins' => [], |
60 | 60 | 'mu_plugins' => [], |
61 | 61 | ]; |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $version_latest = $data['Version']; |
132 | 132 | |
133 | 133 | // Find latest version. |
134 | - if ( isset( $this->available_updates[ $data['plugin_file'] ]->update->new_version ) ) { |
|
135 | - $version_latest = $this->available_updates[ $data['plugin_file'] ]->update->new_version; |
|
134 | + if ( isset( $this->available_updates[$data['plugin_file']]->update->new_version ) ) { |
|
135 | + $version_latest = $this->available_updates[$data['plugin_file']]->update->new_version; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | return array( |
@@ -23,14 +23,14 @@ |
||
23 | 23 | $term_response = array(); |
24 | 24 | $terms = get_terms( 'product_type', array( 'hide_empty' => 0 ) ); |
25 | 25 | foreach ( $terms as $term ) { |
26 | - $term_response[ $term->slug ] = strtolower( $term->name ); |
|
26 | + $term_response[$term->slug] = strtolower( $term->name ); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | // Get a list of terms used for product visibility. |
30 | 30 | $product_visibility_terms = array(); |
31 | 31 | $terms = get_terms( 'product_visibility', array( 'hide_empty' => 0 ) ); |
32 | 32 | foreach ( $terms as $term ) { |
33 | - $product_visibility_terms[ $term->slug ] = strtolower( $term->name ); |
|
33 | + $product_visibility_terms[$term->slug] = strtolower( $term->name ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Check if WooCommerce.com account is connected. |
@@ -96,7 +96,7 @@ |
||
96 | 96 | } |
97 | 97 | $table_type = in_array( $table->name, $core_tables, true ) ? 'woocommerce' : 'other'; |
98 | 98 | |
99 | - $tables[ $table_type ][ $table->name ] = array( |
|
99 | + $tables[$table_type][$table->name] = array( |
|
100 | 100 | 'data' => $table->data, |
101 | 101 | 'index' => $table->index, |
102 | 102 | 'engine' => $table->engine, |