Passed
Push — master ( f1b8f5...aa41b1 )
by Mike
03:09
created
src/Controllers/Version4/Schema/ProductVariationSchema.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 		$props_to_set = array_intersect_key( $values, array_flip( $prop_keys ) );
506 506
 		$props_to_set = array_filter(
507 507
 			$props_to_set,
508
-			function ( $prop ) use ( $object ) {
508
+			function( $prop ) use ( $object ) {
509 509
 				return is_callable( array( $object, "set_$prop" ) );
510 510
 			},
511 511
 			ARRAY_FILTER_USE_KEY
@@ -612,14 +612,14 @@  discard block
 block discarded – undo
612 612
 				continue;
613 613
 			}
614 614
 
615
-			if ( ! isset( $parent_attributes[ $attribute_name ] ) || ! $parent_attributes[ $attribute_name ]->get_variation() ) {
615
+			if ( ! isset( $parent_attributes[$attribute_name] ) || ! $parent_attributes[$attribute_name]->get_variation() ) {
616 616
 				continue;
617 617
 			}
618 618
 
619
-			$attribute_key   = sanitize_title( $parent_attributes[ $attribute_name ]->get_name() );
619
+			$attribute_key   = sanitize_title( $parent_attributes[$attribute_name]->get_name() );
620 620
 			$attribute_value = isset( $attribute['option'] ) ? wc_clean( stripslashes( $attribute['option'] ) ) : '';
621 621
 
622
-			if ( $parent_attributes[ $attribute_name ]->is_taxonomy() ) {
622
+			if ( $parent_attributes[$attribute_name]->is_taxonomy() ) {
623 623
 				// If dealing with a taxonomy, we need to get the slug from the name posted to the API.
624 624
 				$term = get_term_by( 'name', $attribute_value, $attribute_name );
625 625
 
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 				}
631 631
 			}
632 632
 
633
-			$attributes[ $attribute_key ] = $attribute_value;
633
+			$attributes[$attribute_key] = $attribute_value;
634 634
 		}
635 635
 
636 636
 		$object->set_attributes( $attributes );
Please login to merge, or discard this patch.
src/Controllers/Version4/Schema/ProductSchema.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 		$props_to_set = array_intersect_key( $values, array_flip( $prop_keys ) );
837 837
 		$props_to_set = array_filter(
838 838
 			$props_to_set,
839
-			function ( $prop ) use ( $object ) {
839
+			function( $prop ) use ( $object ) {
840 840
 				return is_callable( array( $object, "set_$prop" ) );
841 841
 			},
842 842
 			ARRAY_FILTER_USE_KEY
@@ -1013,10 +1013,10 @@  discard block
 block discarded – undo
1013 1013
 		$attribute  = false;
1014 1014
 
1015 1015
 		// pa_ attributes.
1016
-		if ( isset( $attributes[ wc_attribute_taxonomy_name( $slug ) ] ) ) {
1017
-			$attribute = $attributes[ wc_attribute_taxonomy_name( $slug ) ];
1018
-		} elseif ( isset( $attributes[ $slug ] ) ) {
1019
-			$attribute = $attributes[ $slug ];
1016
+		if ( isset( $attributes[wc_attribute_taxonomy_name( $slug )] ) ) {
1017
+			$attribute = $attributes[wc_attribute_taxonomy_name( $slug )];
1018
+		} elseif ( isset( $attributes[$slug] ) ) {
1019
+			$attribute = $attributes[$slug];
1020 1020
 		}
1021 1021
 
1022 1022
 		if ( ! $attribute ) {
@@ -1383,8 +1383,8 @@  discard block
 block discarded – undo
1383 1383
 				continue;
1384 1384
 			}
1385 1385
 
1386
-			if ( isset( $attributes[ $attribute_name ] ) ) {
1387
-				$_attribute = $attributes[ $attribute_name ];
1386
+			if ( isset( $attributes[$attribute_name] ) ) {
1387
+				$_attribute = $attributes[$attribute_name];
1388 1388
 
1389 1389
 				if ( $_attribute['is_variation'] ) {
1390 1390
 					$value = isset( $attribute['option'] ) ? wc_clean( stripslashes( $attribute['option'] ) ) : '';
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 					}
1402 1402
 
1403 1403
 					if ( $value ) {
1404
-						$default_attributes[ $attribute_name ] = $value;
1404
+						$default_attributes[$attribute_name] = $value;
1405 1405
 					}
1406 1406
 				}
1407 1407
 			}
Please login to merge, or discard this patch.