Completed
Push — master ( b384ce...7658b0 )
by Aimeos
05:56
created
client/html/src/Client/Html/Checkout/Confirm/Factory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface
32 32
 	 * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails
33 33
 	 */
34
-	public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null )
34
+	public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null)
35 35
 	{
36 36
 		/** client/html/checkout/confirm/name
37 37
 		 * Class name of the used checkout confirm client implementation
@@ -66,22 +66,22 @@  discard block
 block discarded – undo
66 66
 		 * @since 2014.03
67 67
 		 * @category Developer
68 68
 		 */
69
-		if( $name === null ) {
70
-			$name = $context->getConfig()->get( 'client/html/checkout/confirm/name', 'Standard' );
69
+		if ($name === null) {
70
+			$name = $context->getConfig()->get('client/html/checkout/confirm/name', 'Standard');
71 71
 		}
72 72
 
73
-		if( ctype_alnum( $name ) === false )
73
+		if (ctype_alnum($name) === false)
74 74
 		{
75
-			$classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Checkout\\Confirm\\' . $name : '<not a string>';
76
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
75
+			$classname = is_string($name) ? '\\Aimeos\\Client\\Html\\Checkout\\Confirm\\'.$name : '<not a string>';
76
+			throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
77 77
 		}
78 78
 
79 79
 		$iface = '\\Aimeos\\Client\\Html\\Iface';
80
-		$classname = '\\Aimeos\\Client\\Html\\Checkout\\Confirm\\' . $name;
80
+		$classname = '\\Aimeos\\Client\\Html\\Checkout\\Confirm\\'.$name;
81 81
 
82
-		$client = self::createClientBase( $context, $classname, $iface, $templatePaths );
82
+		$client = self::createClientBase($context, $classname, $iface, $templatePaths);
83 83
 
84
-		return self::addClientDecorators( $context, $client, $templatePaths, 'checkout/confirm' );
84
+		return self::addClientDecorators($context, $client, $templatePaths, 'checkout/confirm');
85 85
 	}
86 86
 }
87 87
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Confirm/Standard.php 1 patch
Spacing   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 * @since 2015.02
101 101
 	 * @category Developer
102 102
 	 */
103
-	private $subPartNames = array( 'intro', 'basic', 'retry', 'order' );
103
+	private $subPartNames = array('intro', 'basic', 'retry', 'order');
104 104
 	private $cache;
105 105
 
106 106
 
@@ -112,42 +112,42 @@  discard block
 block discarded – undo
112 112
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
113 113
 	 * @return string HTML code
114 114
 	 */
115
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
115
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
116 116
 	{
117 117
 		$context = $this->getContext();
118 118
 		$view = $this->getView();
119 119
 
120 120
 		try
121 121
 		{
122
-			$view = $this->setViewParams( $view, $tags, $expire );
122
+			$view = $this->setViewParams($view, $tags, $expire);
123 123
 
124 124
 			$html = '';
125
-			foreach( $this->getSubClients() as $subclient ) {
126
-				$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
125
+			foreach ($this->getSubClients() as $subclient) {
126
+				$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
127 127
 			}
128 128
 			$view->confirmBody = $html;
129 129
 		}
130
-		catch( \Aimeos\Client\Html\Exception $e )
130
+		catch (\Aimeos\Client\Html\Exception $e)
131 131
 		{
132
-			$error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) );
133
-			$view->confirmErrorList = $view->get( 'confirmErrorList', array() ) + $error;
132
+			$error = array($this->getContext()->getI18n()->dt('client', $e->getMessage()));
133
+			$view->confirmErrorList = $view->get('confirmErrorList', array()) + $error;
134 134
 		}
135
-		catch( \Aimeos\Controller\Frontend\Exception $e )
135
+		catch (\Aimeos\Controller\Frontend\Exception $e)
136 136
 		{
137
-			$error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
138
-			$view->confirmErrorList = $view->get( 'confirmErrorList', array() ) + $error;
137
+			$error = array($this->getContext()->getI18n()->dt('controller/frontend', $e->getMessage()));
138
+			$view->confirmErrorList = $view->get('confirmErrorList', array()) + $error;
139 139
 		}
140
-		catch( \Aimeos\MShop\Exception $e )
140
+		catch (\Aimeos\MShop\Exception $e)
141 141
 		{
142
-			$error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
143
-			$view->confirmErrorList = $view->get( 'confirmErrorList', array() ) + $error;
142
+			$error = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
143
+			$view->confirmErrorList = $view->get('confirmErrorList', array()) + $error;
144 144
 		}
145
-		catch( \Exception $e )
145
+		catch (\Exception $e)
146 146
 		{
147
-			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
147
+			$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
148 148
 
149
-			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
150
-			$view->confirmErrorList = $view->get( 'confirmErrorList', array() ) + $error;
149
+			$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
150
+			$view->confirmErrorList = $view->get('confirmErrorList', array()) + $error;
151 151
 		}
152 152
 
153 153
 		/** client/html/checkout/confirm/standard/template-body
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		$tplconf = 'client/html/checkout/confirm/standard/template-body';
174 174
 		$default = 'checkout/confirm/body-default.php';
175 175
 
176
-		return $view->render( $view->config( $tplconf, $default ) );
176
+		return $view->render($view->config($tplconf, $default));
177 177
 	}
178 178
 
179 179
 
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
186 186
 	 * @return string|null String including HTML tags for the header on error
187 187
 	 */
188
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
188
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
189 189
 	{
190 190
 		try
191 191
 		{
192
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
192
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
193 193
 
194 194
 			$html = '';
195
-			foreach( $this->getSubClients() as $subclient ) {
196
-				$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
195
+			foreach ($this->getSubClients() as $subclient) {
196
+				$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
197 197
 			}
198 198
 			$view->confirmHeader = $html;
199 199
 
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 			$tplconf = 'client/html/checkout/confirm/standard/template-header';
222 222
 			$default = 'checkout/confirm/header-default.php';
223 223
 
224
-			return $view->render( $view->config( $tplconf, $default ) );
224
+			return $view->render($view->config($tplconf, $default));
225 225
 		}
226
-		catch( \Exception $e )
226
+		catch (\Exception $e)
227 227
 		{
228
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
228
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
229 229
 		}
230 230
 	}
231 231
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 * @param string|null $name Name of the sub-client (Default if null)
238 238
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
239 239
 	 */
240
-	public function getSubClient( $type, $name = null )
240
+	public function getSubClient($type, $name = null)
241 241
 	{
242 242
 		/** client/html/checkout/confirm/decorators/excludes
243 243
 		 * Excludes decorators added by the "common" option from the checkout confirm html client
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 		 * @see client/html/checkout/confirm/decorators/global
314 314
 		 */
315 315
 
316
-		return $this->createSubClient( 'checkout/confirm/' . $type, $name );
316
+		return $this->createSubClient('checkout/confirm/'.$type, $name);
317 317
 	}
318 318
 
319 319
 
@@ -327,14 +327,14 @@  discard block
 block discarded – undo
327 327
 		$view = $this->getView();
328 328
 		$context = $this->getContext();
329 329
 		$session = $context->getSession();
330
-		$orderid = $session->get( 'aimeos/orderid' );
330
+		$orderid = $session->get('aimeos/orderid');
331 331
 
332 332
 		try
333 333
 		{
334
-			if( ( $orderItem = $this->updatePayment( $view, $orderid ) ) === null )
334
+			if (($orderItem = $this->updatePayment($view, $orderid)) === null)
335 335
 			{
336
-				$orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
337
-				$orderItem = $orderManager->getItem( $orderid );
336
+				$orderManager = \Aimeos\MShop\Factory::createManager($context, 'order');
337
+				$orderItem = $orderManager->getItem($orderid);
338 338
 			}
339 339
 
340 340
 			$view->confirmOrderItem = $orderItem;
@@ -343,39 +343,39 @@  discard block
 block discarded – undo
343 343
 			parent::process();
344 344
 
345 345
 
346
-			if( $orderItem->getPaymentStatus() > \Aimeos\MShop\Order\Item\Base::PAY_REFUSED )
346
+			if ($orderItem->getPaymentStatus() > \Aimeos\MShop\Order\Item\Base::PAY_REFUSED)
347 347
 			{
348
-				foreach( $session->get( 'aimeos/basket/cache', array() ) as $key => $value ) {
349
-					$session->set( $key, null );
348
+				foreach ($session->get('aimeos/basket/cache', array()) as $key => $value) {
349
+					$session->set($key, null);
350 350
 				}
351 351
 
352
-				\Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' )->clear();
352
+				\Aimeos\Controller\Frontend\Factory::createController($context, 'basket')->clear();
353 353
 			}
354 354
 
355 355
 			// Update stock, coupons, etc.
356
-			\Aimeos\Controller\Frontend\Factory::createController( $context, 'order' )->update( $orderItem );
356
+			\Aimeos\Controller\Frontend\Factory::createController($context, 'order')->update($orderItem);
357 357
 		}
358
-		catch( \Aimeos\Client\Html\Exception $e )
358
+		catch (\Aimeos\Client\Html\Exception $e)
359 359
 		{
360
-			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
361
-			$view->confirmErrorList = $view->get( 'confirmErrorList', array() ) + $error;
360
+			$error = array($context->getI18n()->dt('client', $e->getMessage()));
361
+			$view->confirmErrorList = $view->get('confirmErrorList', array()) + $error;
362 362
 		}
363
-		catch( \Aimeos\Controller\Frontend\Exception $e )
363
+		catch (\Aimeos\Controller\Frontend\Exception $e)
364 364
 		{
365
-			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
366
-			$view->confirmErrorList = $view->get( 'confirmErrorList', array() ) + $error;
365
+			$error = array($context->getI18n()->dt('controller/frontend', $e->getMessage()));
366
+			$view->confirmErrorList = $view->get('confirmErrorList', array()) + $error;
367 367
 		}
368
-		catch( \Aimeos\MShop\Exception $e )
368
+		catch (\Aimeos\MShop\Exception $e)
369 369
 		{
370
-			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
371
-			$view->confirmErrorList = $view->get( 'confirmErrorList', array() ) + $error;
370
+			$error = array($context->getI18n()->dt('mshop', $e->getMessage()));
371
+			$view->confirmErrorList = $view->get('confirmErrorList', array()) + $error;
372 372
 		}
373
-		catch( \Exception $e )
373
+		catch (\Exception $e)
374 374
 		{
375
-			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
375
+			$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
376 376
 
377
-			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
378
-			$view->confirmErrorList = $view->get( 'confirmErrorList', array() ) + $error;
377
+			$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
378
+			$view->confirmErrorList = $view->get('confirmErrorList', array()) + $error;
379 379
 		}
380 380
 	}
381 381
 
@@ -387,26 +387,26 @@  discard block
 block discarded – undo
387 387
 	 * @throws \Aimeos\Client\Html\Exception If no payment service item could be found
388 388
 	 * @return \Aimeos\MShop\Service\Provider\Iface Service provider object
389 389
 	 */
390
-	protected function getServiceProvider( $code )
390
+	protected function getServiceProvider($code)
391 391
 	{
392
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
392
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
393 393
 
394 394
 		$search = $serviceManager->createSearch();
395 395
 		$expr = array(
396
-			$search->compare( '==', 'service.code', $code ),
397
-			$search->compare( '==', 'service.type.code', 'payment' ),
396
+			$search->compare('==', 'service.code', $code),
397
+			$search->compare('==', 'service.type.code', 'payment'),
398 398
 		);
399
-		$search->setConditions( $search->combine( '&&', $expr ) );
399
+		$search->setConditions($search->combine('&&', $expr));
400 400
 
401
-		$result = $serviceManager->searchItems( $search );
401
+		$result = $serviceManager->searchItems($search);
402 402
 
403
-		if( ( $serviceItem = reset( $result ) ) === false )
403
+		if (($serviceItem = reset($result)) === false)
404 404
 		{
405
-			$msg = sprintf( 'No service for code "%1$s" found', $code );
406
-			throw new \Aimeos\Client\Html\Exception( $msg );
405
+			$msg = sprintf('No service for code "%1$s" found', $code);
406
+			throw new \Aimeos\Client\Html\Exception($msg);
407 407
 		}
408 408
 
409
-		return $serviceManager->getProvider( $serviceItem );
409
+		return $serviceManager->getProvider($serviceItem);
410 410
 	}
411 411
 
412 412
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	 */
418 418
 	protected function getSubClientNames()
419 419
 	{
420
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
420
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
421 421
 	}
422 422
 
423 423
 
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
 	 * @param array $config Default URL configuration
430 430
 	 * @return string URL string
431 431
 	 */
432
-	protected function getUrlConfirm( \Aimeos\MW\View\Iface $view, array $params, array $config )
432
+	protected function getUrlConfirm(\Aimeos\MW\View\Iface $view, array $params, array $config)
433 433
 	{
434
-		$target = $view->config( 'client/html/checkout/confirm/url/target' );
435
-		$cntl = $view->config( 'client/html/checkout/confirm/url/controller', 'checkout' );
436
-		$action = $view->config( 'client/html/checkout/confirm/url/action', 'confirm' );
437
-		$config = $view->config( 'client/html/checkout/confirm/url/config', $config );
434
+		$target = $view->config('client/html/checkout/confirm/url/target');
435
+		$cntl = $view->config('client/html/checkout/confirm/url/controller', 'checkout');
436
+		$action = $view->config('client/html/checkout/confirm/url/action', 'confirm');
437
+		$config = $view->config('client/html/checkout/confirm/url/config', $config);
438 438
 
439
-		return $view->url( $target, $cntl, $action, $params, array(), $config );
439
+		return $view->url($target, $cntl, $action, $params, array(), $config);
440 440
 	}
441 441
 
442 442
 
@@ -448,14 +448,14 @@  discard block
 block discarded – undo
448 448
 	 * @param array $config Default URL configuration
449 449
 	 * @return string URL string
450 450
 	 */
451
-	protected function getUrlUpdate( \Aimeos\MW\View\Iface $view, array $params, array $config )
451
+	protected function getUrlUpdate(\Aimeos\MW\View\Iface $view, array $params, array $config)
452 452
 	{
453
-		$target = $view->config( 'client/html/checkout/update/url/target' );
454
-		$cntl = $view->config( 'client/html/checkout/update/url/controller', 'checkout' );
455
-		$action = $view->config( 'client/html/checkout/update/url/action', 'update' );
456
-		$config = $view->config( 'client/html/checkout/update/url/config', $config );
453
+		$target = $view->config('client/html/checkout/update/url/target');
454
+		$cntl = $view->config('client/html/checkout/update/url/controller', 'checkout');
455
+		$action = $view->config('client/html/checkout/update/url/action', 'update');
456
+		$config = $view->config('client/html/checkout/update/url/config', $config);
457 457
 
458
-		return $view->url( $target, $cntl, $action, $params, array(), $config );
458
+		return $view->url($target, $cntl, $action, $params, array(), $config);
459 459
 	}
460 460
 
461 461
 
@@ -467,17 +467,17 @@  discard block
 block discarded – undo
467 467
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
468 468
 	 * @return \Aimeos\MW\View\Iface Modified view object
469 469
 	 */
470
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
470
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
471 471
 	{
472
-		if( !isset( $this->cache ) )
472
+		if (!isset($this->cache))
473 473
 		{
474
-			if( !isset( $view->confirmOrderItem ) )
474
+			if (!isset($view->confirmOrderItem))
475 475
 			{
476 476
 				$context = $this->getContext();
477
-				$orderid = $context->getSession()->get( 'aimeos/orderid' );
478
-				$orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
477
+				$orderid = $context->getSession()->get('aimeos/orderid');
478
+				$orderManager = \Aimeos\MShop\Factory::createManager($context, 'order');
479 479
 
480
-				$view->confirmOrderItem = $orderManager->getItem( $orderid );
480
+				$view->confirmOrderItem = $orderManager->getItem($orderid);
481 481
 			}
482 482
 
483 483
 			$this->cache = $view;
@@ -494,32 +494,32 @@  discard block
 block discarded – undo
494 494
 	 * @param string $orderid ID of the order whose payment status should be updated
495 495
 	 * @return void|\Aimeos\MShop\Order\Item\Iface Order item that has been updated
496 496
 	 */
497
-	protected function updatePayment( \Aimeos\MW\View\Iface $view, $orderid )
497
+	protected function updatePayment(\Aimeos\MW\View\Iface $view, $orderid)
498 498
 	{
499
-		if( ( $code = $view->param( 'code' ) ) === null ) {
499
+		if (($code = $view->param('code')) === null) {
500 500
 			return;
501 501
 		}
502 502
 
503
-		$provider = $this->getServiceProvider( $code );
503
+		$provider = $this->getServiceProvider($code);
504 504
 
505
-		$config = array( 'absoluteUri' => true, 'namespace' => false );
506
-		$params = array( 'code' => $code, 'orderid' => $orderid );
505
+		$config = array('absoluteUri' => true, 'namespace' => false);
506
+		$params = array('code' => $code, 'orderid' => $orderid);
507 507
 		$urls = array(
508
-			'payment.url-success' => $this->getUrlConfirm( $view, $params, $config ),
509
-			'payment.url-update' => $this->getUrlUpdate( $view, $params, $config ),
508
+			'payment.url-success' => $this->getUrlConfirm($view, $params, $config),
509
+			'payment.url-update' => $this->getUrlUpdate($view, $params, $config),
510 510
 			'client.ipaddress' => $view->request()->getClientAddress(),
511 511
 		);
512 512
 		$urls['payment.url-self'] = $urls['payment.url-success'];
513
-		$provider->injectGlobalConfigBE( $urls );
513
+		$provider->injectGlobalConfigBE($urls);
514 514
 
515 515
 		$reqParams = $view->param();
516 516
 		$reqParams['orderid'] = $orderid;
517 517
 
518
-		if( ( $orderItem = $provider->updateSync( $reqParams, $view->request()->getBody() ) ) !== null
518
+		if (($orderItem = $provider->updateSync($reqParams, $view->request()->getBody())) !== null
519 519
 			&& $orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED
520
-			&& $provider->isImplemented( \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY )
520
+			&& $provider->isImplemented(\Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY)
521 521
 		) {
522
-			$provider->query( $orderItem );
522
+			$provider->query($orderItem);
523 523
 		}
524 524
 
525 525
 		return $orderItem;
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Confirm/Basic/Standard.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
68 68
 	 * @return string HTML code
69 69
 	 */
70
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
70
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
71 71
 	{
72
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
72
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
73 73
 
74 74
 		$html = '';
75
-		foreach( $this->getSubClients() as $subclient ) {
76
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
75
+		foreach ($this->getSubClients() as $subclient) {
76
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
77 77
 		}
78 78
 		$view->basicBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/checkout/confirm/basic/standard/template-body';
101 101
 		$default = 'checkout/confirm/basic-body-default.php';
102 102
 
103
-		return $view->render( $view->config( $tplconf, $default ) );
103
+		return $view->render($view->config($tplconf, $default));
104 104
 	}
105 105
 
106 106
 
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
113 113
 	 * @return string|null String including HTML tags for the header on error
114 114
 	 */
115
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
115
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
116 116
 	{
117
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
117
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
118 118
 
119 119
 		$html = '';
120
-		foreach( $this->getSubClients() as $subclient ) {
121
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
120
+		foreach ($this->getSubClients() as $subclient) {
121
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
122 122
 		}
123 123
 		$view->basicHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/checkout/confirm/basic/standard/template-header';
147 147
 		$default = 'checkout/confirm/basic-header-default.php';
148 148
 
149
-		return $view->render( $view->config( $tplconf, $default ) );
149
+		return $view->render($view->config($tplconf, $default));
150 150
 	}
151 151
 
152 152
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** client/html/checkout/confirm/basic/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the checkout confirm basic html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/checkout/confirm/basic/decorators/global
234 234
 		 */
235 235
 
236
-		return $this->createSubClient( 'checkout/confirm/basic/' . $type, $name );
236
+		return $this->createSubClient('checkout/confirm/basic/'.$type, $name);
237 237
 	}
238 238
 
239 239
 
@@ -244,6 +244,6 @@  discard block
 block discarded – undo
244 244
 	 */
245 245
 	protected function getSubClientNames()
246 246
 	{
247
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
247
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
248 248
 	}
249 249
 }
250 250
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Confirm/Intro/Standard.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
68 68
 	 * @return string HTML code
69 69
 	 */
70
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
70
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
71 71
 	{
72
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
72
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
73 73
 
74 74
 		$html = '';
75
-		foreach( $this->getSubClients() as $subclient ) {
76
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
75
+		foreach ($this->getSubClients() as $subclient) {
76
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
77 77
 		}
78 78
 		$view->introBody = $html;
79 79
 
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 		$tplconf = 'client/html/checkout/confirm/intro/standard/template-body';
109 109
 
110 110
 		$status = $view->confirmOrderItem->getPaymentStatus();
111
-		$default = array( 'checkout/confirm/' . $status . '/intro-body-default.php', 'checkout/confirm/intro-body-default.php' );
111
+		$default = array('checkout/confirm/'.$status.'/intro-body-default.php', 'checkout/confirm/intro-body-default.php');
112 112
 
113
-		return $view->render( $view->config( $tplconf, $default ) );
113
+		return $view->render($view->config($tplconf, $default));
114 114
 	}
115 115
 
116 116
 
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
123 123
 	 * @return string|null String including HTML tags for the header on error
124 124
 	 */
125
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
125
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
126 126
 	{
127
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
127
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
128 128
 
129 129
 		$html = '';
130
-		foreach( $this->getSubClients() as $subclient ) {
131
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
130
+		foreach ($this->getSubClients() as $subclient) {
131
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
132 132
 		}
133 133
 		$view->introHeader = $html;
134 134
 
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 		$tplconf = 'client/html/checkout/confirm/intro/standard/template-header';
165 165
 
166 166
 		$status = $view->confirmOrderItem->getPaymentStatus();
167
-		$default = array( 'checkout/confirm/' . $status . '/intro-header-default.php', 'checkout/confirm/intro-header-default.php' );
167
+		$default = array('checkout/confirm/'.$status.'/intro-header-default.php', 'checkout/confirm/intro-header-default.php');
168 168
 
169
-		return $view->render( $view->config( $tplconf, $default ) );
169
+		return $view->render($view->config($tplconf, $default));
170 170
 	}
171 171
 
172 172
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	 * @param string|null $name Name of the sub-client (Default if null)
178 178
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
179 179
 	 */
180
-	public function getSubClient( $type, $name = null )
180
+	public function getSubClient($type, $name = null)
181 181
 	{
182 182
 		/** client/html/checkout/confirm/intro/decorators/excludes
183 183
 		 * Excludes decorators added by the "common" option from the checkout confirm intro html client
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 		 * @see client/html/checkout/confirm/intro/decorators/global
254 254
 		 */
255 255
 
256
-		return $this->createSubClient( 'checkout/confirm/intro/' . $type, $name );
256
+		return $this->createSubClient('checkout/confirm/intro/'.$type, $name);
257 257
 	}
258 258
 
259 259
 
@@ -264,6 +264,6 @@  discard block
 block discarded – undo
264 264
 	 */
265 265
 	protected function getSubClientNames()
266 266
 	{
267
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
267
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
268 268
 	}
269 269
 }
270 270
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Process/Standard.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 
14 14
 // Strings for translation
15
-sprintf( 'process' );
15
+sprintf('process');
16 16
 
17 17
 
18 18
 /**
@@ -70,19 +70,19 @@  discard block
 block discarded – undo
70 70
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
71 71
 	 * @return string HTML code
72 72
 	 */
73
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
73
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
74 74
 	{
75 75
 		$view = $this->getView();
76 76
 
77
-		if( !in_array( $view->get( 'standardStepActive' ), array( 'order', 'process' ) ) ) {
77
+		if (!in_array($view->get('standardStepActive'), array('order', 'process'))) {
78 78
 			return '';
79 79
 		}
80 80
 
81
-		$view = $this->setViewParams( $view, $tags, $expire );
81
+		$view = $this->setViewParams($view, $tags, $expire);
82 82
 
83 83
 		$html = '';
84
-		foreach( $this->getSubClients() as $subclient ) {
85
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
84
+		foreach ($this->getSubClients() as $subclient) {
85
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
86 86
 		}
87 87
 		$view->processBody = $html;
88 88
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		$tplconf = 'client/html/checkout/standard/process/standard/template-body';
110 110
 		$default = 'checkout/standard/process-body-default.php';
111 111
 
112
-		return $view->render( $view->config( $tplconf, $default ) );
112
+		return $view->render($view->config($tplconf, $default));
113 113
 	}
114 114
 
115 115
 
@@ -121,19 +121,19 @@  discard block
 block discarded – undo
121 121
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
122 122
 	 * @return string|null String including HTML tags for the header on error
123 123
 	 */
124
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
124
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
125 125
 	{
126 126
 		$view = $this->getView();
127 127
 
128
-		if( !in_array( $view->param( 'standardStepActive' ), array( 'order', 'process' ) ) ) {
128
+		if (!in_array($view->param('standardStepActive'), array('order', 'process'))) {
129 129
 			return '';
130 130
 		}
131 131
 
132
-		$view = $this->setViewParams( $view, $tags, $expire );
132
+		$view = $this->setViewParams($view, $tags, $expire);
133 133
 
134 134
 		$html = '';
135
-		foreach( $this->getSubClients() as $subclient ) {
136
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
135
+		foreach ($this->getSubClients() as $subclient) {
136
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
137 137
 		}
138 138
 		$view->processHeader = $html;
139 139
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		$tplconf = 'client/html/checkout/standard/process/standard/template-header';
162 162
 		$default = 'checkout/standard/process-header-default.php';
163 163
 
164
-		return $view->render( $view->config( $tplconf, $default ) );
164
+		return $view->render($view->config($tplconf, $default));
165 165
 	}
166 166
 
167 167
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 * @param string|null $name Name of the sub-client (Default if null)
173 173
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
174 174
 	 */
175
-	public function getSubClient( $type, $name = null )
175
+	public function getSubClient($type, $name = null)
176 176
 	{
177 177
 		/** client/html/checkout/standard/process/decorators/excludes
178 178
 		 * Excludes decorators added by the "common" option from the checkout standard process html client
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		 * @see client/html/checkout/standard/process/decorators/global
249 249
 		 */
250 250
 
251
-		return $this->createSubClient( 'checkout/standard/process/' . $type, $name );
251
+		return $this->createSubClient('checkout/standard/process/'.$type, $name);
252 252
 	}
253 253
 
254 254
 
@@ -260,41 +260,41 @@  discard block
 block discarded – undo
260 260
 	public function process()
261 261
 	{
262 262
 		$view = $this->getView();
263
-		$errors = $view->get( 'standardErrorList', array() );
263
+		$errors = $view->get('standardErrorList', array());
264 264
 
265
-		if( !in_array( $view->param( 'c_step' ), array( 'order', 'process' ) ) || !empty( $errors ) ) {
265
+		if (!in_array($view->param('c_step'), array('order', 'process')) || !empty($errors)) {
266 266
 			return;
267 267
 		}
268 268
 
269 269
 		$context = $this->getContext();
270 270
 		$session = $context->getSession();
271
-		$orderid = $session->get( 'aimeos/orderid' );
272
-		$config = array( 'absoluteUri' => true, 'namespace' => false );
271
+		$orderid = $session->get('aimeos/orderid');
272
+		$config = array('absoluteUri' => true, 'namespace' => false);
273 273
 
274 274
 		try
275 275
 		{
276
-			$orderItem = \Aimeos\MShop\Factory::createManager( $context, 'order' )->getItem( $orderid );
276
+			$orderItem = \Aimeos\MShop\Factory::createManager($context, 'order')->getItem($orderid);
277 277
 
278
-			if( ( $code = $this->getOrderServiceCode( $orderItem->getBaseId() ) ) !== null )
278
+			if (($code = $this->getOrderServiceCode($orderItem->getBaseId())) !== null)
279 279
 			{
280
-				$serviceItem = $this->getServiceItem( $code );
280
+				$serviceItem = $this->getServiceItem($code);
281 281
 
282
-				$serviceManager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
283
-				$provider = $serviceManager->getProvider( $serviceItem );
282
+				$serviceManager = \Aimeos\MShop\Factory::createManager($context, 'service');
283
+				$provider = $serviceManager->getProvider($serviceItem);
284 284
 
285
-				$params = array( 'code' => $serviceItem->getCode(), 'orderid' => $orderid );
285
+				$params = array('code' => $serviceItem->getCode(), 'orderid' => $orderid);
286 286
 				$urls = array(
287
-					'payment.url-self' => $this->getUrlSelf( $view, $params + array( 'c_step' => 'process' ), array() ),
288
-					'payment.url-success' => $this->getUrlConfirm( $view, $params, $config ),
289
-					'payment.url-update' => $this->getUrlUpdate( $view, $params, $config ),
287
+					'payment.url-self' => $this->getUrlSelf($view, $params + array('c_step' => 'process'), array()),
288
+					'payment.url-success' => $this->getUrlConfirm($view, $params, $config),
289
+					'payment.url-update' => $this->getUrlUpdate($view, $params, $config),
290 290
 					'client.ipaddress' => $view->request()->getClientAddress(),
291 291
 				);
292
-				$provider->injectGlobalConfigBE( $urls );
292
+				$provider->injectGlobalConfigBE($urls);
293 293
 
294
-				if( ( $form = $provider->process( $orderItem, $view->param() ) ) === null )
294
+				if (($form = $provider->process($orderItem, $view->param())) === null)
295 295
 				{
296
-					$msg = sprintf( 'Invalid process response from service provider with code "%1$s"', $serviceItem->getCode() );
297
-					throw new \Aimeos\Client\Html\Exception( $msg );
296
+					$msg = sprintf('Invalid process response from service provider with code "%1$s"', $serviceItem->getCode());
297
+					throw new \Aimeos\Client\Html\Exception($msg);
298 298
 				}
299 299
 
300 300
 				$view->standardUrlNext = $form->getUrl();
@@ -304,34 +304,34 @@  discard block
 block discarded – undo
304 304
 			}
305 305
 			else
306 306
 			{
307
-				$view->standardUrlNext = $this->getUrlConfirm( $view, array(), array() );
307
+				$view->standardUrlNext = $this->getUrlConfirm($view, array(), array());
308 308
 				$view->standardMethod = 'GET';
309 309
 			}
310 310
 
311 311
 
312 312
 			parent::process();
313 313
 		}
314
-		catch( \Aimeos\Client\Html\Exception $e )
314
+		catch (\Aimeos\Client\Html\Exception $e)
315 315
 		{
316
-			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
317
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
316
+			$error = array($context->getI18n()->dt('client', $e->getMessage()));
317
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
318 318
 		}
319
-		catch( \Aimeos\Controller\Frontend\Exception $e )
319
+		catch (\Aimeos\Controller\Frontend\Exception $e)
320 320
 		{
321
-			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
322
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
321
+			$error = array($context->getI18n()->dt('controller/frontend', $e->getMessage()));
322
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
323 323
 		}
324
-		catch( \Aimeos\MShop\Exception $e )
324
+		catch (\Aimeos\MShop\Exception $e)
325 325
 		{
326
-			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
327
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
326
+			$error = array($context->getI18n()->dt('mshop', $e->getMessage()));
327
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
328 328
 		}
329
-		catch( \Exception $e )
329
+		catch (\Exception $e)
330 330
 		{
331
-			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
331
+			$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
332 332
 
333
-			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
334
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
333
+			$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
334
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
335 335
 		}
336 336
 	}
337 337
 
@@ -342,20 +342,20 @@  discard block
 block discarded – undo
342 342
 	 * @param string $baseid ID of the order base item
343 343
 	 * @return string|null Code of the service item or null if not found
344 344
 	 */
345
-	protected function getOrderServiceCode( $baseid )
345
+	protected function getOrderServiceCode($baseid)
346 346
 	{
347
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order/base/service' );
347
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order/base/service');
348 348
 
349 349
 		$search = $manager->createSearch();
350 350
 		$expr = array(
351
-			$search->compare( '==', 'order.base.service.baseid', $baseid ),
352
-			$search->compare( '==', 'order.base.service.type', \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT ),
351
+			$search->compare('==', 'order.base.service.baseid', $baseid),
352
+			$search->compare('==', 'order.base.service.type', \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT),
353 353
 		);
354
-		$search->setConditions( $search->combine( '&&', $expr ) );
354
+		$search->setConditions($search->combine('&&', $expr));
355 355
 
356
-		$result = $manager->searchItems( $search );
356
+		$result = $manager->searchItems($search);
357 357
 
358
-		if( ( $item = reset( $result ) ) !== false ) {
358
+		if (($item = reset($result)) !== false) {
359 359
 			return $item->getCode();
360 360
 		}
361 361
 	}
@@ -368,23 +368,23 @@  discard block
 block discarded – undo
368 368
 	 * @throws \Aimeos\Client\Html\Exception If no service item for this code is found
369 369
 	 * @return \Aimeos\MShop\Service\Item\Iface Service item object
370 370
 	 */
371
-	protected function getServiceItem( $code )
371
+	protected function getServiceItem($code)
372 372
 	{
373
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
373
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
374 374
 
375 375
 		$search = $serviceManager->createSearch();
376 376
 		$expr = array(
377
-			$search->compare( '==', 'service.code', $code ),
378
-			$search->compare( '==', 'service.type.code', 'payment' ),
377
+			$search->compare('==', 'service.code', $code),
378
+			$search->compare('==', 'service.type.code', 'payment'),
379 379
 		);
380
-		$search->setConditions( $search->combine( '&&', $expr ) );
380
+		$search->setConditions($search->combine('&&', $expr));
381 381
 
382
-		$result = $serviceManager->searchItems( $search );
382
+		$result = $serviceManager->searchItems($search);
383 383
 
384
-		if( ( $serviceItem = reset( $result ) ) === false )
384
+		if (($serviceItem = reset($result)) === false)
385 385
 		{
386
-			$msg = sprintf( 'No service for code "%1$s" found', $code );
387
-			throw new \Aimeos\Client\Html\Exception( $msg );
386
+			$msg = sprintf('No service for code "%1$s" found', $code);
387
+			throw new \Aimeos\Client\Html\Exception($msg);
388 388
 		}
389 389
 
390 390
 		return $serviceItem;
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 	 */
399 399
 	protected function getSubClientNames()
400 400
 	{
401
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
401
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
402 402
 	}
403 403
 
404 404
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 * @param array $config Default URL configuration
411 411
 	 * @return string URL string
412 412
 	 */
413
-	protected function getUrlConfirm( \Aimeos\MW\View\Iface $view, array $params, array $config )
413
+	protected function getUrlConfirm(\Aimeos\MW\View\Iface $view, array $params, array $config)
414 414
 	{
415 415
 		/** client/html/checkout/confirm/url/target
416 416
 		 * Destination of the URL where the controller specified in the URL is known
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 		 * @see client/html/checkout/confirm/url/action
427 427
 		 * @see client/html/checkout/confirm/url/config
428 428
 		 */
429
-		$target = $view->config( 'client/html/checkout/confirm/url/target' );
429
+		$target = $view->config('client/html/checkout/confirm/url/target');
430 430
 
431 431
 		/** client/html/checkout/confirm/url/controller
432 432
 		 * Name of the controller whose action should be called
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 		 * @see client/html/checkout/confirm/url/action
443 443
 		 * @see client/html/checkout/confirm/url/config
444 444
 		 */
445
-		$cntl = $view->config( 'client/html/checkout/confirm/url/controller', 'checkout' );
445
+		$cntl = $view->config('client/html/checkout/confirm/url/controller', 'checkout');
446 446
 
447 447
 		/** client/html/checkout/confirm/url/action
448 448
 		 * Name of the action that should create the output
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 		 * @see client/html/checkout/confirm/url/controller
459 459
 		 * @see client/html/checkout/confirm/url/config
460 460
 		 */
461
-		$action = $view->config( 'client/html/checkout/confirm/url/action', 'confirm' );
461
+		$action = $view->config('client/html/checkout/confirm/url/action', 'confirm');
462 462
 
463 463
 		/** client/html/checkout/confirm/url/config
464 464
 		 * Associative list of configuration options used for generating the URL
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
 		 * @see client/html/checkout/confirm/url/action
482 482
 		 * @see client/html/url/config
483 483
 		 */
484
-		$config = $view->config( 'client/html/checkout/confirm/url/config', $config );
484
+		$config = $view->config('client/html/checkout/confirm/url/config', $config);
485 485
 
486
-		return $view->url( $target, $cntl, $action, $params, array(), $config );
486
+		return $view->url($target, $cntl, $action, $params, array(), $config);
487 487
 	}
488 488
 
489 489
 
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 	 * @param array $config Default URL configuration
496 496
 	 * @return string URL string
497 497
 	 */
498
-	protected function getUrlSelf( \Aimeos\MW\View\Iface $view, array $params, array $config )
498
+	protected function getUrlSelf(\Aimeos\MW\View\Iface $view, array $params, array $config)
499 499
 	{
500 500
 		/** client/html/checkout/standard/url/target
501 501
 		 * Destination of the URL where the controller specified in the URL is known
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 		 * @see client/html/checkout/standard/url/action
512 512
 		 * @see client/html/checkout/standard/url/config
513 513
 		 */
514
-		$target = $view->config( 'client/html/checkout/standard/url/target' );
514
+		$target = $view->config('client/html/checkout/standard/url/target');
515 515
 
516 516
 		/** client/html/checkout/standard/url/controller
517 517
 		 * Name of the controller whose action should be called
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 		 * @see client/html/checkout/standard/url/action
528 528
 		 * @see client/html/checkout/standard/url/config
529 529
 		 */
530
-		$cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
530
+		$cntl = $view->config('client/html/checkout/standard/url/controller', 'checkout');
531 531
 
532 532
 		/** client/html/checkout/standard/url/action
533 533
 		 * Name of the action that should create the output
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 		 * @see client/html/checkout/standard/url/controller
544 544
 		 * @see client/html/checkout/standard/url/config
545 545
 		 */
546
-		$action = $view->config( 'client/html/checkout/standard/url/action', 'standard' );
546
+		$action = $view->config('client/html/checkout/standard/url/action', 'standard');
547 547
 
548 548
 		/** client/html/checkout/standard/url/config
549 549
 		 * Associative list of configuration options used for generating the URL
@@ -566,9 +566,9 @@  discard block
 block discarded – undo
566 566
 		 * @see client/html/checkout/standard/url/action
567 567
 		 * @see client/html/url/config
568 568
 		 */
569
-		$config = $view->config( 'client/html/checkout/standard/url/config', $config );
569
+		$config = $view->config('client/html/checkout/standard/url/config', $config);
570 570
 
571
-		return $view->url( $target, $cntl, $action, $params, array(), $config );
571
+		return $view->url($target, $cntl, $action, $params, array(), $config);
572 572
 	}
573 573
 
574 574
 
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 	 * @param array $config Default URL configuration
581 581
 	 * @return string URL string
582 582
 	 */
583
-	protected function getUrlUpdate( \Aimeos\MW\View\Iface $view, array $params, array $config )
583
+	protected function getUrlUpdate(\Aimeos\MW\View\Iface $view, array $params, array $config)
584 584
 	{
585 585
 		/** client/html/checkout/update/url/target
586 586
 		 * Destination of the URL where the controller specified in the URL is known
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 		 * @see client/html/checkout/update/url/action
597 597
 		 * @see client/html/checkout/update/url/config
598 598
 		 */
599
-		$target = $view->config( 'client/html/checkout/update/url/target' );
599
+		$target = $view->config('client/html/checkout/update/url/target');
600 600
 
601 601
 		/** client/html/checkout/update/url/controller
602 602
 		 * Name of the controller whose action should be called
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 		 * @see client/html/checkout/update/url/action
613 613
 		 * @see client/html/checkout/update/url/config
614 614
 		 */
615
-		$cntl = $view->config( 'client/html/checkout/update/url/controller', 'checkout' );
615
+		$cntl = $view->config('client/html/checkout/update/url/controller', 'checkout');
616 616
 
617 617
 		/** client/html/checkout/update/url/action
618 618
 		 * Name of the action that should create the output
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 		 * @see client/html/checkout/update/url/controller
629 629
 		 * @see client/html/checkout/update/url/config
630 630
 		 */
631
-		$action = $view->config( 'client/html/checkout/update/url/action', 'update' );
631
+		$action = $view->config('client/html/checkout/update/url/action', 'update');
632 632
 
633 633
 		/** client/html/checkout/update/url/config
634 634
 		 * Associative list of configuration options used for generating the URL
@@ -651,9 +651,9 @@  discard block
 block discarded – undo
651 651
 		 * @see client/html/checkout/update/url/action
652 652
 		 * @see client/html/url/config
653 653
 		 */
654
-		$config = $view->config( 'client/html/checkout/update/url/config', $config );
654
+		$config = $view->config('client/html/checkout/update/url/config', $config);
655 655
 
656
-		return $view->url( $target, $cntl, $action, $params, array(), $config );
656
+		return $view->url($target, $cntl, $action, $params, array(), $config);
657 657
 	}
658 658
 
659 659
 
@@ -665,11 +665,11 @@  discard block
 block discarded – undo
665 665
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
666 666
 	 * @return \Aimeos\MW\View\Iface Modified view object
667 667
 	 */
668
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
668
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
669 669
 	{
670
-		if( !isset( $this->cache ) )
670
+		if (!isset($this->cache))
671 671
 		{
672
-			$view->standardUrlPayment = $this->getUrlSelf( $view, array( 'c_step' => 'payment' ), array() );
672
+			$view->standardUrlPayment = $this->getUrlSelf($view, array('c_step' => 'payment'), array());
673 673
 
674 674
 			$this->cache = $view;
675 675
 		}
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Order/Standard.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 
15 15
 // Strings for translation
16
-sprintf( 'order' );
16
+sprintf('order');
17 17
 
18 18
 
19 19
 /**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @since 2014.03
83 83
 	 * @category Developer
84 84
 	 */
85
-	private $subPartNames = array( 'account', 'address' );
85
+	private $subPartNames = array('account', 'address');
86 86
 
87 87
 
88 88
 	/**
@@ -93,19 +93,19 @@  discard block
 block discarded – undo
93 93
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
94 94
 	 * @return string HTML code
95 95
 	 */
96
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
96
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
97 97
 	{
98 98
 		$view = $this->getView();
99 99
 
100
-		if( $view->get( 'standardStepActive' ) != 'order' ) {
100
+		if ($view->get('standardStepActive') != 'order') {
101 101
 			return '';
102 102
 		}
103 103
 
104
-		$view = $this->setViewParams( $view, $tags, $expire );
104
+		$view = $this->setViewParams($view, $tags, $expire);
105 105
 
106 106
 		$html = '';
107
-		foreach( $this->getSubClients() as $subclient ) {
108
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
107
+		foreach ($this->getSubClients() as $subclient) {
108
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
109 109
 		}
110 110
 		$view->orderBody = $html;
111 111
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		$tplconf = 'client/html/checkout/standard/order/standard/template-body';
133 133
 		$default = 'checkout/standard/order-body-default.php';
134 134
 
135
-		return $view->render( $view->config( $tplconf, $default ) );
135
+		return $view->render($view->config($tplconf, $default));
136 136
 	}
137 137
 
138 138
 
@@ -144,19 +144,19 @@  discard block
 block discarded – undo
144 144
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
145 145
 	 * @return string|null String including HTML tags for the header on error
146 146
 	 */
147
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
147
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
148 148
 	{
149 149
 		$view = $this->getView();
150 150
 
151
-		if( $view->get( 'standardStepActive' ) != 'order' ) {
151
+		if ($view->get('standardStepActive') != 'order') {
152 152
 			return '';
153 153
 		}
154 154
 
155
-		$view = $this->setViewParams( $view, $tags, $expire );
155
+		$view = $this->setViewParams($view, $tags, $expire);
156 156
 
157 157
 		$html = '';
158
-		foreach( $this->getSubClients() as $subclient ) {
159
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
158
+		foreach ($this->getSubClients() as $subclient) {
159
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
160 160
 		}
161 161
 		$view->orderHeader = $html;
162 162
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		$tplconf = 'client/html/checkout/standard/order/standard/template-header';
185 185
 		$default = 'checkout/standard/order-header-default.php';
186 186
 
187
-		return $view->render( $view->config( $tplconf, $default ) );
187
+		return $view->render($view->config($tplconf, $default));
188 188
 	}
189 189
 
190 190
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 * @param string|null $name Name of the sub-client (Default if null)
196 196
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
197 197
 	 */
198
-	public function getSubClient( $type, $name = null )
198
+	public function getSubClient($type, $name = null)
199 199
 	{
200 200
 		/** client/html/checkout/standard/order/decorators/excludes
201 201
 		 * Excludes decorators added by the "common" option from the checkout standard order html client
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		 * @see client/html/checkout/standard/order/decorators/global
272 272
 		 */
273 273
 
274
-		return $this->createSubClient( 'checkout/standard/order/' . $type, $name );
274
+		return $this->createSubClient('checkout/standard/order/'.$type, $name);
275 275
 	}
276 276
 
277 277
 
@@ -287,24 +287,24 @@  discard block
 block discarded – undo
287 287
 		try
288 288
 		{
289 289
 			// only start if there's something to do
290
-			if( ( $option = $view->param( 'cs_order', null ) ) === null
291
-				|| $view->get( 'standardStepActive' ) !== null
290
+			if (($option = $view->param('cs_order', null)) === null
291
+				|| $view->get('standardStepActive') !== null
292 292
 			) {
293 293
 				return;
294 294
 			}
295 295
 
296 296
 			$context = $this->getContext();
297
-			$orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' );
297
+			$orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base');
298 298
 
299 299
 			$basket = $orderBaseManager->getSession();
300
-			$basket->setCustomerId( $context->getUserId() );
300
+			$basket->setCustomerId($context->getUserId());
301 301
 			$basket->finish();
302 302
 
303
-			$cntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'order' );
304
-			$orderItem = $cntl->store( $basket );
305
-			$cntl->block( $orderItem );
303
+			$cntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'order');
304
+			$orderItem = $cntl->store($basket);
305
+			$cntl->block($orderItem);
306 306
 
307
-			$context->getSession()->set( 'aimeos/orderid', $orderItem->getId() );
307
+			$context->getSession()->set('aimeos/orderid', $orderItem->getId());
308 308
 
309 309
 			$view->orderItem = $orderItem;
310 310
 			$view->orderBasket = $basket;
@@ -312,9 +312,9 @@  discard block
 block discarded – undo
312 312
 			parent::process();
313 313
 
314 314
 			// save again after sub-clients modified it's state
315
-			\Aimeos\MShop\Factory::createManager( $context, 'order' )->saveItem( $orderItem );
315
+			\Aimeos\MShop\Factory::createManager($context, 'order')->saveItem($orderItem);
316 316
 		}
317
-		catch( \Exception $e )
317
+		catch (\Exception $e)
318 318
 		{
319 319
 			$view->standardStepActive = 'order';
320 320
 			throw $e;
@@ -329,6 +329,6 @@  discard block
 block discarded – undo
329 329
 	 */
330 330
 	protected function getSubClientNames()
331 331
 	{
332
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
332
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
333 333
 	}
334 334
 }
335 335
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Order/Address/Standard.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
68 68
 	 * @return string HTML code
69 69
 	 */
70
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
70
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
71 71
 	{
72
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
72
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
73 73
 
74 74
 		$html = '';
75
-		foreach( $this->getSubClients() as $subclient ) {
76
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
75
+		foreach ($this->getSubClients() as $subclient) {
76
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
77 77
 		}
78 78
 		$view->addressBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/checkout/standard/order/address/standard/template-body';
101 101
 		$default = 'checkout/standard/order-address-body-default.php';
102 102
 
103
-		return $view->render( $view->config( $tplconf, $default ) );
103
+		return $view->render($view->config($tplconf, $default));
104 104
 	}
105 105
 
106 106
 
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
113 113
 	 * @return string|null String including HTML tags for the header on error
114 114
 	 */
115
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
115
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
116 116
 	{
117
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
117
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
118 118
 
119 119
 		$html = '';
120
-		foreach( $this->getSubClients() as $subclient ) {
121
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
120
+		foreach ($this->getSubClients() as $subclient) {
121
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
122 122
 		}
123 123
 		$view->addressHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/checkout/standard/order/address/standard/template-header';
147 147
 		$default = 'checkout/standard/order-address-header-default.php';
148 148
 
149
-		return $view->render( $view->config( $tplconf, $default ) );
149
+		return $view->render($view->config($tplconf, $default));
150 150
 	}
151 151
 
152 152
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** client/html/checkout/standard/order/address/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the checkout standard order address html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/checkout/standard/order/address/decorators/global
234 234
 		 */
235 235
 
236
-		return $this->createSubClient( 'checkout/standard/order/address/' . $type, $name );
236
+		return $this->createSubClient('checkout/standard/order/address/'.$type, $name);
237 237
 	}
238 238
 
239 239
 
@@ -250,27 +250,27 @@  discard block
 block discarded – undo
250 250
 
251 251
 		try
252 252
 		{
253
-			$addr = $basket->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY );
253
+			$addr = $basket->getAddress(\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY);
254 254
 
255
-			if( $customerId != '' && $addr->getAddressId() == '' )
255
+			if ($customerId != '' && $addr->getAddressId() == '')
256 256
 			{
257
-				$addrManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
258
-				$orderAddrManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order/base/address' );
257
+				$addrManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
258
+				$orderAddrManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order/base/address');
259 259
 
260 260
 				$item = $addrManager->createItem();
261
-				$item->setParentId( $customerId );
262
-				$item->copyFrom( $addr );
261
+				$item->setParentId($customerId);
262
+				$item->copyFrom($addr);
263 263
 
264
-				$addrManager->saveItem( $item );
264
+				$addrManager->saveItem($item);
265 265
 
266
-				$addr->setAddressId( $item->getId() );
267
-				$orderAddrManager->saveItem( $addr, false );
266
+				$addr->setAddressId($item->getId());
267
+				$orderAddrManager->saveItem($addr, false);
268 268
 			}
269 269
 		}
270
-		catch( \Exception $e )
270
+		catch (\Exception $e)
271 271
 		{
272
-			$msg = sprintf( 'Unable to save address for customer "%1$s": %2$s', $customerId, $e->getMessage() );
273
-			$this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::INFO );
272
+			$msg = sprintf('Unable to save address for customer "%1$s": %2$s', $customerId, $e->getMessage());
273
+			$this->getContext()->getLogger()->log($msg, \Aimeos\MW\Logger\Base::INFO);
274 274
 		}
275 275
 
276 276
 		parent::process();
@@ -284,6 +284,6 @@  discard block
 block discarded – undo
284 284
 	 */
285 285
 	protected function getSubClientNames()
286 286
 	{
287
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
287
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
288 288
 	}
289 289
 }
290 290
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Order/Account/Standard.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
67 67
 	 * @return string HTML code
68 68
 	 */
69
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
69
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
70 70
 	{
71
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
71
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
72 72
 
73 73
 		$html = '';
74
-		foreach( $this->getSubClients() as $subclient ) {
75
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
74
+		foreach ($this->getSubClients() as $subclient) {
75
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
76 76
 		}
77 77
 		$view->accountBody = $html;
78 78
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		$tplconf = 'client/html/checkout/standard/order/account/standard/template-body';
100 100
 		$default = 'checkout/standard/order-account-body-default.php';
101 101
 
102
-		return $view->render( $view->config( $tplconf, $default ) );
102
+		return $view->render($view->config($tplconf, $default));
103 103
 	}
104 104
 
105 105
 
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
112 112
 	 * @return string|null String including HTML tags for the header on error
113 113
 	 */
114
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
114
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
115 115
 	{
116
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
116
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
117 117
 
118 118
 		$html = '';
119
-		foreach( $this->getSubClients() as $subclient ) {
120
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
119
+		foreach ($this->getSubClients() as $subclient) {
120
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
121 121
 		}
122 122
 		$view->accountHeader = $html;
123 123
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		$tplconf = 'client/html/checkout/standard/order/account/standard/template-header';
146 146
 		$default = 'checkout/standard/order-account-header-default.php';
147 147
 
148
-		return $view->render( $view->config( $tplconf, $default ) );
148
+		return $view->render($view->config($tplconf, $default));
149 149
 	}
150 150
 
151 151
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 * @param string|null $name Name of the sub-client (Default if null)
157 157
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
158 158
 	 */
159
-	public function getSubClient( $type, $name = null )
159
+	public function getSubClient($type, $name = null)
160 160
 	{
161 161
 		/** client/html/checkout/standard/order/account/decorators/excludes
162 162
 		 * Excludes decorators added by the "common" option from the checkout standard order account html client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see client/html/checkout/standard/order/account/decorators/global
233 233
 		 */
234 234
 
235
-		return $this->createSubClient( 'checkout/standard/order/account/' . $type, $name );
235
+		return $this->createSubClient('checkout/standard/order/account/'.$type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -246,43 +246,43 @@  discard block
 block discarded – undo
246 246
 		$view = $this->getView();
247 247
 		$basket = $view->orderBasket;
248 248
 
249
-		if( $basket->getCustomerId() == '' )
249
+		if ($basket->getCustomerId() == '')
250 250
 		{
251 251
 			$email = '<unknown>';
252 252
 			$context = $this->getContext();
253 253
 
254 254
 			try
255 255
 			{
256
-				$addr = $basket->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT );
256
+				$addr = $basket->getAddress(\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT);
257 257
 				$email = $addr->getEmail();
258 258
 
259
-				$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
259
+				$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
260 260
 				$search = $manager->createSearch();
261
-				$search->setConditions( $search->compare( '==', 'customer.code', $email ) );
262
-				$search->setSlice( 0, 1 );
263
-				$result = $manager->searchItems( $search );
261
+				$search->setConditions($search->compare('==', 'customer.code', $email));
262
+				$search->setSlice(0, 1);
263
+				$result = $manager->searchItems($search);
264 264
 
265
-				if( ( $item = reset( $result ) ) === false )
265
+				if (($item = reset($result)) === false)
266 266
 				{
267
-					$password = substr( md5( microtime( true ) . getmypid() . rand() ), -8 );
268
-					$item = $this->addCustomerData( $manager->createItem(), $addr, $addr->getEmail(), $password );
269
-					$manager->saveItem( $item );
267
+					$password = substr(md5(microtime(true).getmypid().rand()), -8);
268
+					$item = $this->addCustomerData($manager->createItem(), $addr, $addr->getEmail(), $password);
269
+					$manager->saveItem($item);
270 270
 
271 271
 					$msg = $item->toArray();
272 272
 					$msg['customer.password'] = $password;
273
-					$context->getMessageQueue( 'mq-email', 'customer/email/account' )->add( json_encode( $msg ) );
274
-					$context->setUserId( $item->getId() );
273
+					$context->getMessageQueue('mq-email', 'customer/email/account')->add(json_encode($msg));
274
+					$context->setUserId($item->getId());
275 275
 				}
276 276
 
277
-				$basket->setCustomerId( $item->getId() );
277
+				$basket->setCustomerId($item->getId());
278 278
 
279
-				$orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' );
280
-				$orderBaseManager->saveItem( $basket, false );
279
+				$orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base');
280
+				$orderBaseManager->saveItem($basket, false);
281 281
 			}
282
-			catch( \Exception $e )
282
+			catch (\Exception $e)
283 283
 			{
284
-				$msg = sprintf( 'Unable to create an account for "%1$s": %2$s', $email, $e->getMessage() );
285
-				$context->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::INFO );
284
+				$msg = sprintf('Unable to create an account for "%1$s": %2$s', $email, $e->getMessage());
285
+				$context->getLogger()->log($msg, \Aimeos\MW\Logger\Base::INFO);
286 286
 			}
287 287
 		}
288 288
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 */
298 298
 	protected function getSubClientNames()
299 299
 	{
300
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
300
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
301 301
 	}
302 302
 
303 303
 
@@ -310,24 +310,24 @@  discard block
 block discarded – undo
310 310
 	 * @param string $password Plain-text password for the customer
311 311
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer object filled with data
312 312
 	 */
313
-	protected function addCustomerData( \Aimeos\MShop\Customer\Item\Iface $customer,
314
-		\Aimeos\MShop\Common\Item\Address\Iface $address, $code, $password )
313
+	protected function addCustomerData(\Aimeos\MShop\Customer\Item\Iface $customer,
314
+		\Aimeos\MShop\Common\Item\Address\Iface $address, $code, $password)
315 315
 	{
316 316
 		$label = $address->getLastname();
317 317
 
318
-		if( ( $part = $address->getFirstname() ) !== '' ) {
319
-			$label = $part . ' ' . $label;
318
+		if (($part = $address->getFirstname()) !== '') {
319
+			$label = $part.' '.$label;
320 320
 		}
321 321
 
322
-		if( ( $part = $address->getCompany() ) !== '' ) {
323
-			$label .= ' (' . $part . ')';
322
+		if (($part = $address->getCompany()) !== '') {
323
+			$label .= ' ('.$part.')';
324 324
 		}
325 325
 
326
-		$customer->setPaymentAddress( $address );
327
-		$customer->setCode( $code );
328
-		$customer->setPassword( $password );
329
-		$customer->setLabel( $label );
330
-		$customer->setStatus( 1 );
326
+		$customer->setPaymentAddress($address);
327
+		$customer->setCode($code);
328
+		$customer->setPassword($password);
329
+		$customer->setLabel($label);
330
+		$customer->setStatus(1);
331 331
 
332 332
 		/** client/html/checkout/standard/order/account/standard/groupids
333 333
 		 * List of groups new customers should be assigned to
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
 		 * @category Developer
343 343
 		 */
344 344
 		$config = $this->getContext()->getConfig();
345
-		$gids = (array) $config->get( 'client/html/checkout/standard/order/account/standard/groupids', array() );
346
-		$customer->setGroups( $gids );
345
+		$gids = (array) $config->get('client/html/checkout/standard/order/account/standard/groupids', array());
346
+		$customer->setGroups($gids);
347 347
 
348 348
 		return $customer;
349 349
 	}
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Summary/Service/Standard.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69 69
 	 * @return string HTML code
70 70
 	*/
71
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
71
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
72 72
 	{
73
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
73
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
74 74
 
75 75
 		$html = '';
76
-		foreach( $this->getSubClients() as $subclient ) {
77
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
76
+		foreach ($this->getSubClients() as $subclient) {
77
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
78 78
 		}
79 79
 		$view->serviceBody = $html;
80 80
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		$tplconf = 'client/html/checkout/standard/summary/service/standard/template-body';
103 103
 		$default = 'common/summary/service-body-default.php';
104 104
 
105
-		return $view->render( $view->config( $tplconf, $default ) );
105
+		return $view->render($view->config($tplconf, $default));
106 106
 	}
107 107
 
108 108
 
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115 115
 	 * @return string|null String including HTML tags for the header on error
116 116
 	 */
117
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
117
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
118 118
 	{
119
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
119
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
120 120
 
121 121
 		$html = '';
122
-		foreach( $this->getSubClients() as $subclient ) {
123
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
122
+		foreach ($this->getSubClients() as $subclient) {
123
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
124 124
 		}
125 125
 		$view->serviceHeader = $html;
126 126
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		$tplconf = 'client/html/checkout/standard/summary/service/standard/template-header';
150 150
 		$default = 'common/summary/service-header-default.php';
151 151
 
152
-		return $view->render( $view->config( $tplconf, $default ) );
152
+		return $view->render($view->config($tplconf, $default));
153 153
 	}
154 154
 
155 155
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 * @param string|null $name Name of the sub-client (Default if null)
161 161
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
162 162
 	 */
163
-	public function getSubClient( $type, $name = null )
163
+	public function getSubClient($type, $name = null)
164 164
 	{
165 165
 		/** client/html/checkout/standard/summary/service/decorators/excludes
166 166
 		 * Excludes decorators added by the "common" option from the checkout standard summary service html client
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		 * @see client/html/checkout/standard/summary/service/decorators/global
237 237
 		 */
238 238
 
239
-		return $this->createSubClient( 'checkout/standard/summary/service/' . $type, $name );
239
+		return $this->createSubClient('checkout/standard/summary/service/'.$type, $name);
240 240
 	}
241 241
 
242 242
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	protected function getSubClientNames()
249 249
 	{
250
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
250
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
251 251
 	}
252 252
 
253 253
 
@@ -259,19 +259,19 @@  discard block
 block discarded – undo
259 259
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260 260
 	 * @return \Aimeos\MW\View\Iface Modified view object
261 261
 	 */
262
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
262
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
263 263
 	{
264
-		$view = parent::setViewParams( $view, $tags, $expire );
264
+		$view = parent::setViewParams($view, $tags, $expire);
265 265
 
266
-		if( !isset( $this->cache ) )
266
+		if (!isset($this->cache))
267 267
 		{
268
-			$target = $view->config( 'client/html/checkout/standard/url/target' );
269
-			$cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
270
-			$action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
271
-			$config = $view->config( 'client/html/checkout/standard/url/config', array() );
268
+			$target = $view->config('client/html/checkout/standard/url/target');
269
+			$cntl = $view->config('client/html/checkout/standard/url/controller', 'checkout');
270
+			$action = $view->config('client/html/checkout/standard/url/action', 'index');
271
+			$config = $view->config('client/html/checkout/standard/url/config', array());
272 272
 
273
-			$view->summaryUrlServicePayment = $view->url( $target, $cntl, $action, array( 'c_step' => 'payment' ), array(), $config );
274
-			$view->summaryUrlServiceDelivery = $view->url( $target, $cntl, $action, array( 'c_step' => 'delivery' ), array(), $config );
273
+			$view->summaryUrlServicePayment = $view->url($target, $cntl, $action, array('c_step' => 'payment'), array(), $config);
274
+			$view->summaryUrlServiceDelivery = $view->url($target, $cntl, $action, array('c_step' => 'delivery'), array(), $config);
275 275
 
276 276
 			$this->cache = $view;
277 277
 		}
Please login to merge, or discard this patch.