Passed
Push — master ( 9f41c4...e5e2d2 )
by Aimeos
16:12
created
client/html/src/Client/Html/Checkout/Standard/Address/Delivery/Standard.php 1 patch
Braces   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -471,19 +471,22 @@  discard block
 block discarded – undo
471 471
 		$disable = $view->config( 'client/html/checkout/standard/address/delivery/disable-new', false );
472 472
 		$type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY;
473 473
 
474
-		if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) // new address
474
+		if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) {
475
+			// new address
475 476
 		{
476 477
 			$params = $view->param( 'ca_delivery', [] );
478
+		}
477 479
 
478 480
 			if( ( $view->deliveryError = $this->checkFields( $params ) ) !== [] ) {
479 481
 				throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one delivery address part is missing or invalid' ) );
480 482
 			}
481 483
 
482 484
 			$basketCtrl->addAddress( $type, $params, 0 );
483
-		}
484
-		else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) // existing address
485
+		} else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) {
486
+			// existing address
485 487
 		{
486 488
 			$params = $view->param( 'ca_delivery_' . $option, [] );
489
+		}
487 490
 
488 491
 			if( !empty( $params ) && ( $view->deliveryError = $this->checkFields( $params ) ) !== [] ) {
489 492
 				throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one delivery address part is missing or invalid' ) );
@@ -499,8 +502,7 @@  discard block
 block discarded – undo
499 502
 
500 503
 			$basketCtrl->addAddress( $type, $params, 0 );
501 504
 			$basketCtrl->get()->getAddress( $type, 0 )->setAddressId( $option );
502
-		}
503
-		else
505
+		} else
504 506
 		{
505 507
 			$basketCtrl->deleteAddress( $type );
506 508
 		}
@@ -702,8 +704,7 @@  discard block
 block discarded – undo
702 704
 					$invalid[$key] = $name;
703 705
 					unset( $params[$key] );
704 706
 				}
705
-			}
706
-			else
707
+			} else
707 708
 			{
708 709
 				unset( $params[$key] );
709 710
 			}
Please login to merge, or discard this patch.