Completed
Push — master ( 37ef18...cbde41 )
by Aimeos
06:05
created
client/html/src/Client/Html/Locale/Select/Standard.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @since 2014.09
79 79
 	 * @category Developer
80 80
 	 */
81
-	private $subPartNames = array( 'language', 'currency' );
81
+	private $subPartNames = array('language', 'currency');
82 82
 	private $cache;
83 83
 
84 84
 
@@ -90,42 +90,42 @@  discard block
 block discarded – undo
90 90
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
91 91
 	 * @return string HTML code
92 92
 	 */
93
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
93
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
94 94
 	{
95 95
 		$context = $this->getContext();
96 96
 		$view = $this->getView();
97 97
 
98 98
 		try
99 99
 		{
100
-			$view = $this->setViewParams( $view, $tags, $expire );
100
+			$view = $this->setViewParams($view, $tags, $expire);
101 101
 
102 102
 			$html = '';
103
-			foreach( $this->getSubClients() as $subclient ) {
104
-				$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
103
+			foreach ($this->getSubClients() as $subclient) {
104
+				$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
105 105
 			}
106 106
 			$view->selectBody = $html;
107 107
 		}
108
-		catch( \Aimeos\Client\Html\Exception $e )
108
+		catch (\Aimeos\Client\Html\Exception $e)
109 109
 		{
110
-			$error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) );
111
-			$view->selectErrorList = $view->get( 'selectErrorList', array() ) + $error;
110
+			$error = array($this->getContext()->getI18n()->dt('client', $e->getMessage()));
111
+			$view->selectErrorList = $view->get('selectErrorList', array()) + $error;
112 112
 		}
113
-		catch( \Aimeos\Controller\Frontend\Exception $e )
113
+		catch (\Aimeos\Controller\Frontend\Exception $e)
114 114
 		{
115
-			$error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
116
-			$view->selectErrorList = $view->get( 'selectErrorList', array() ) + $error;
115
+			$error = array($this->getContext()->getI18n()->dt('controller/frontend', $e->getMessage()));
116
+			$view->selectErrorList = $view->get('selectErrorList', array()) + $error;
117 117
 		}
118
-		catch( \Aimeos\MShop\Exception $e )
118
+		catch (\Aimeos\MShop\Exception $e)
119 119
 		{
120
-			$error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
121
-			$view->selectErrorList = $view->get( 'selectErrorList', array() ) + $error;
120
+			$error = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
121
+			$view->selectErrorList = $view->get('selectErrorList', array()) + $error;
122 122
 		}
123
-		catch( \Exception $e )
123
+		catch (\Exception $e)
124 124
 		{
125
-			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
125
+			$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
126 126
 
127
-			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
128
-			$view->selectErrorList = $view->get( 'selectErrorList', array() ) + $error;
127
+			$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
128
+			$view->selectErrorList = $view->get('selectErrorList', array()) + $error;
129 129
 		}
130 130
 
131 131
 		/** client/html/locale/select/standard/template-body
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 		$tplconf = 'client/html/locale/select/standard/template-body';
152 152
 		$default = 'locale/select/body-default.php';
153 153
 
154
-		return $view->render( $view->config( $tplconf, $default ) );
154
+		return $view->render($view->config($tplconf, $default));
155 155
 	}
156 156
 
157 157
 
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
164 164
 	 * @return string|null String including HTML tags for the header on error
165 165
 	 */
166
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
166
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
167 167
 	{
168 168
 		try
169 169
 		{
170
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
170
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
171 171
 
172 172
 			$html = '';
173
-			foreach( $this->getSubClients() as $subclient ) {
174
-				$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
173
+			foreach ($this->getSubClients() as $subclient) {
174
+				$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
175 175
 			}
176 176
 			$view->selectHeader = $html;
177 177
 
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
 			$tplconf = 'client/html/locale/select/standard/template-header';
200 200
 			$default = 'locale/select/header-default.php';
201 201
 
202
-			return $view->render( $view->config( $tplconf, $default ) );
202
+			return $view->render($view->config($tplconf, $default));
203 203
 		}
204
-		catch( \Exception $e )
204
+		catch (\Exception $e)
205 205
 		{
206
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
206
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
207 207
 		}
208 208
 	}
209 209
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	 * @param string|null $name Name of the sub-client (Default if null)
216 216
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
217 217
 	 */
218
-	public function getSubClient( $type, $name = null )
218
+	public function getSubClient($type, $name = null)
219 219
 	{
220 220
 		/** client/html/locale/select/decorators/excludes
221 221
 		 * Excludes decorators added by the "common" option from the locale select html client
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		 * @see client/html/locale/select/decorators/excludes
291 291
 		 * @see client/html/locale/select/decorators/global
292 292
 		 */
293
-		return $this->createSubClient( 'locale/select/' . $type, $name );
293
+		return $this->createSubClient('locale/select/'.$type, $name);
294 294
 	}
295 295
 
296 296
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	 */
302 302
 	protected function getSubClientNames()
303 303
 	{
304
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
304
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
305 305
 	}
306 306
 
307 307
 
@@ -313,9 +313,9 @@  discard block
 block discarded – undo
313 313
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
314 314
 	 * @return \Aimeos\MW\View\Iface Modified view object
315 315
 	 */
316
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
316
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
317 317
 	{
318
-		if( !isset( $this->cache ) )
318
+		if (!isset($this->cache))
319 319
 		{
320 320
 			$map = array();
321 321
 			$context = $this->getContext();
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 			 * @since 2015.06
335 335
 			 * @see client/html/locale/select/currency/param-name
336 336
 			 */
337
-			$langname = $config->get( 'client/html/locale/select/language/param-name', 'loc_languageid' );
337
+			$langname = $config->get('client/html/locale/select/language/param-name', 'loc_languageid');
338 338
 
339 339
 			/** client/html/locale/select/currency/param-name
340 340
 			 * Name of the parameter that contains the currency ID value
@@ -348,19 +348,19 @@  discard block
 block discarded – undo
348 348
 			 * @since 2015.06
349 349
 			 * @see client/html/locale/select/language/param-name
350 350
 			 */
351
-			$curname = $config->get( 'client/html/locale/select/currency/param-name', 'loc_currencyid' );
351
+			$curname = $config->get('client/html/locale/select/currency/param-name', 'loc_currencyid');
352 352
 
353 353
 
354
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
354
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'locale');
355 355
 
356
-			$search = $manager->createSearch( true );
357
-			$search->setSortations( array( $search->sort( '+', 'locale.position' ) ) );
356
+			$search = $manager->createSearch(true);
357
+			$search->setSortations(array($search->sort('+', 'locale.position')));
358 358
 
359
-			foreach( $manager->searchItems( $search ) as $item )
359
+			foreach ($manager->searchItems($search) as $item)
360 360
 			{
361 361
 				$curId = $item->getCurrencyId();
362 362
 				$langId = $item->getLanguageId();
363
-				$map[$langId][$curId] = array( $langname => $langId, $curname => $curId );
363
+				$map[$langId][$curId] = array($langname => $langId, $curname => $curId);
364 364
 			}
365 365
 
366 366
 			$params = $view->param();
Please login to merge, or discard this patch.
client/html/src/Client/Html/Locale/Select/Language/Standard.php 1 patch
Spacing   +16 added lines, -16 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->languageBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/locale/select/language/standard/template-body';
101 101
 		$default = 'locale/select/language-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->languageHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/locale/select/language/standard/template-header';
147 147
 		$default = 'locale/select/language-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/locale/select/language/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the locale select language html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/locale/select/language/decorators/global
234 234
 		 */
235 235
 
236
-		return $this->createSubClient( 'locale/select/language/' . $type, $name );
236
+		return $this->createSubClient('locale/select/language/'.$type, $name);
237 237
 	}
238 238
 
239 239
 
@@ -249,10 +249,10 @@  discard block
 block discarded – undo
249 249
 		$config = $context->getConfig();
250 250
 		$session = $context->getSession();
251 251
 
252
-		$name = $config->get( 'client/html/locale/select/language/param-name', 'loc_languageid' );
252
+		$name = $config->get('client/html/locale/select/language/param-name', 'loc_languageid');
253 253
 
254
-		if( ( $languageId = $view->param( $name ) ) !== null ) {
255
-			$session->set( 'aimeos/locale/languageid', $languageId );
254
+		if (($languageId = $view->param($name)) !== null) {
255
+			$session->set('aimeos/locale/languageid', $languageId);
256 256
 		}
257 257
 
258 258
 		parent::process();
@@ -266,6 +266,6 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	protected function getSubClientNames()
268 268
 	{
269
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
269
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
270 270
 	}
271 271
 }
Please login to merge, or discard this patch.
client/html/src/Client/Html/Factory.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,35 +29,35 @@
 block discarded – undo
29 29
 	 * @return \Aimeos\Client\Html\Iface HTML client implementing \Aimeos\Client\Html\Iface
30 30
 	 * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails
31 31
 	 */
32
-	public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $type, $name = null )
32
+	public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $type, $name = null)
33 33
 	{
34
-		if( empty( $type ) ) {
35
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Client HTML type is empty' ) );
34
+		if (empty($type)) {
35
+			throw new \Aimeos\Client\Html\Exception(sprintf('Client HTML type is empty'));
36 36
 		}
37 37
 
38
-		$parts = explode( '/', $type );
38
+		$parts = explode('/', $type);
39 39
 
40
-		if( count( $parts ) !== 2 ) {
41
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Client type "%1$s" must consist of two parts separated by "/"', $type ) );
40
+		if (count($parts) !== 2) {
41
+			throw new \Aimeos\Client\Html\Exception(sprintf('Client type "%1$s" must consist of two parts separated by "/"', $type));
42 42
 		}
43 43
 
44
-		foreach( $parts as $part )
44
+		foreach ($parts as $part)
45 45
 		{
46
-			if( ctype_alnum( $part ) === false ) {
47
-				throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in client name "%1$s" in "%2$s"', $part, $type ) );
46
+			if (ctype_alnum($part) === false) {
47
+				throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in client name "%1$s" in "%2$s"', $part, $type));
48 48
 			}
49 49
 		}
50 50
 
51
-		$factory = '\\Aimeos\\Client\\Html\\' . ucwords( $parts[0] ) . '\\' . ucwords( $parts[1] ) . '\\Factory';
51
+		$factory = '\\Aimeos\\Client\\Html\\'.ucwords($parts[0]).'\\'.ucwords($parts[1]).'\\Factory';
52 52
 
53
-		if( class_exists( $factory ) === false ) {
54
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Class "%1$s" not available', $factory ) );
53
+		if (class_exists($factory) === false) {
54
+			throw new \Aimeos\Client\Html\Exception(sprintf('Class "%1$s" not available', $factory));
55 55
 		}
56 56
 
57
-		$client = @call_user_func_array( array( $factory, 'createClient' ), array( $context, $templatePaths, $name ) );
57
+		$client = @call_user_func_array(array($factory, 'createClient'), array($context, $templatePaths, $name));
58 58
 
59
-		if( $client === false ) {
60
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) );
59
+		if ($client === false) {
60
+			throw new \Aimeos\Client\Html\Exception(sprintf('Invalid factory "%1$s"', $factory));
61 61
 		}
62 62
 
63 63
 		return $client;
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Base.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		$session = $this->getContext()->getSession();
30 30
 
31
-		foreach( $session->get( 'aimeos/basket/cache', array() ) as $key => $value ) {
32
-			$session->set( $key, null );
31
+		foreach ($session->get('aimeos/basket/cache', array()) as $key => $value) {
32
+			$session->set($key, null);
33 33
 		}
34 34
 	}
35 35
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 * @return mixed Value associated to the requested key. If no value for the
43 43
 	 *	key is found in the cache, the given default value is returned
44 44
 	 */
45
-	protected function getBasketCached( $key, $default = null )
45
+	protected function getBasketCached($key, $default = null)
46 46
 	{
47
-		return $this->getContext()->getSession()->get( $key, $default );
47
+		return $this->getContext()->getSession()->get($key, $default);
48 48
 	}
49 49
 
50 50
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * @param string $key Path the cache entry should be stored in
55 55
 	 * @param mixed $value Value stored in the cache for the path
56 56
 	 */
57
-	protected function setBasketCached( $key, $value )
57
+	protected function setBasketCached($key, $value)
58 58
 	{
59 59
 		$context = $this->getContext();
60 60
 
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
 		 * @category Developer
73 73
 		 * @since 2014.11
74 74
 		 */
75
-		if( $context->getConfig()->get( 'client/html/basket/cache/enable', true ) != false )
75
+		if ($context->getConfig()->get('client/html/basket/cache/enable', true) != false)
76 76
 		{
77 77
 			$session = $context->getSession();
78 78
 
79
-			$cached = $session->get( 'aimeos/basket/cache', array() ) + array( $key => true );
80
-			$session->set( 'aimeos/basket/cache', $cached );
81
-			$session->set( $key, $value );
79
+			$cached = $session->get('aimeos/basket/cache', array()) + array($key => true);
80
+			$session->set('aimeos/basket/cache', $cached);
81
+			$session->set($key, $value);
82 82
 		}
83 83
 	}
84 84
 }
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Standard/Coupon/Standard.php 1 patch
Spacing   +23 added lines, -23 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->couponBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/basket/standard/coupon/standard/template-body';
101 101
 		$default = 'basket/standard/coupon-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->couponHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/basket/standard/coupon/standard/template-header';
147 147
 		$default = 'basket/standard/coupon-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/basket/standard/coupon/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the basket standard coupon html client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see client/html/basket/standard/coupon/decorators/excludes
233 233
 		 * @see client/html/basket/standard/coupon/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'basket/standard/coupon/' . $type, $name );
235
+		return $this->createSubClient('basket/standard/coupon/'.$type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -246,25 +246,25 @@  discard block
 block discarded – undo
246 246
 		$view = $this->getView();
247 247
 		$context = $this->getContext();
248 248
 
249
-		switch( $view->param( 'b_action' ) )
249
+		switch ($view->param('b_action'))
250 250
 		{
251 251
 			case 'coupon-delete':
252 252
 
253
-				if( ( $coupon = $view->param( 'b_coupon' ) ) != '' )
253
+				if (($coupon = $view->param('b_coupon')) != '')
254 254
 				{
255 255
 					$this->clearCached();
256
-					$cntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
257
-					$cntl->deleteCoupon( $coupon );
256
+					$cntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket');
257
+					$cntl->deleteCoupon($coupon);
258 258
 				}
259 259
 
260 260
 				break;
261 261
 
262 262
 			default:
263 263
 
264
-				if( ( $coupon = $view->param( 'b_coupon' ) ) != '' )
264
+				if (($coupon = $view->param('b_coupon')) != '')
265 265
 				{
266 266
 					$this->clearCached();
267
-					$cntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
267
+					$cntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket');
268 268
 
269 269
 					/** client/html/basket/standard/coupon/allowed
270 270
 					 * Number of coupon codes a customer is allowed to enter
@@ -282,13 +282,13 @@  discard block
 block discarded – undo
282 282
 					 * @category User
283 283
 					 * @category Developer
284 284
 					 */
285
-					$allowed = $context->getConfig()->get( 'client/html/basket/standard/coupon/allowed', 1 );
285
+					$allowed = $context->getConfig()->get('client/html/basket/standard/coupon/allowed', 1);
286 286
 
287
-					if( $allowed <= count( $cntl->get()->getCoupons() ) ) {
288
-						throw new \Aimeos\Client\Html\Exception( sprintf( 'Number of coupon codes exceeds the limit' ) );
287
+					if ($allowed <= count($cntl->get()->getCoupons())) {
288
+						throw new \Aimeos\Client\Html\Exception(sprintf('Number of coupon codes exceeds the limit'));
289 289
 					}
290 290
 
291
-					$cntl->addCoupon( $coupon );
291
+					$cntl->addCoupon($coupon);
292 292
 				}
293 293
 
294 294
 				break;
@@ -305,6 +305,6 @@  discard block
 block discarded – undo
305 305
 	 */
306 306
 	protected function getSubClientNames()
307 307
 	{
308
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
308
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
309 309
 	}
310 310
 }
311 311
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Standard/Detail/Standard.php 1 patch
Spacing   +24 added lines, -24 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->detailBody = $html;
80 80
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		$tplconf = 'client/html/basket/standard/detail/standard/template-body';
103 103
 		$default = 'common/summary/detail-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->detailHeader = $html;
126 126
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		$tplconf = 'client/html/basket/standard/detail/standard/template-header';
150 150
 		$default = 'common/summary/detail-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/basket/standard/detail/decorators/excludes
166 166
 		 * Excludes decorators added by the "common" option from the basket standard detail html client
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		 * @see client/html/basket/standard/detail/decorators/excludes
236 236
 		 * @see client/html/basket/standard/detail/decorators/global
237 237
 		 */
238
-		return $this->createSubClient( 'basket/standard/detail/' . $type, $name );
238
+		return $this->createSubClient('basket/standard/detail/'.$type, $name);
239 239
 	}
240 240
 
241 241
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	protected function getSubClientNames()
248 248
 	{
249
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
249
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
250 250
 	}
251 251
 
252 252
 
@@ -258,23 +258,23 @@  discard block
 block discarded – undo
258 258
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
259 259
 	 * @return \Aimeos\MW\View\Iface Modified view object
260 260
 	 */
261
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
261
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
262 262
 	{
263
-		$view = parent::setViewParams( $view );
263
+		$view = parent::setViewParams($view);
264 264
 
265
-		if( !isset( $this->cache ) )
265
+		if (!isset($this->cache))
266 266
 		{
267 267
 			$basket = $view->standardBasket;
268 268
 
269
-			$target = $view->config( 'client/html/checkout/standard/url/target' );
270
-			$cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
271
-			$action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
272
-			$config = $view->config( 'client/html/checkout/standard/url/config', array() );
269
+			$target = $view->config('client/html/checkout/standard/url/target');
270
+			$cntl = $view->config('client/html/checkout/standard/url/controller', 'checkout');
271
+			$action = $view->config('client/html/checkout/standard/url/action', 'index');
272
+			$config = $view->config('client/html/checkout/standard/url/config', array());
273 273
 
274
-			$view->summaryParams = $view->get( 'standardParams', array() );
275
-			$view->summaryUrlServicePayment = $view->url( $target, $cntl, $action, array( 'c_step' => 'payment' ), array(), $config );
276
-			$view->summaryUrlServiceDelivery = $view->url( $target, $cntl, $action, array( 'c_step' => 'delivery' ), array(), $config );
277
-			$view->summaryTaxRates = $this->getTaxRates( $basket );
274
+			$view->summaryParams = $view->get('standardParams', array());
275
+			$view->summaryUrlServicePayment = $view->url($target, $cntl, $action, array('c_step' => 'payment'), array(), $config);
276
+			$view->summaryUrlServiceDelivery = $view->url($target, $cntl, $action, array('c_step' => 'delivery'), array(), $config);
277
+			$view->summaryTaxRates = $this->getTaxRates($basket);
278 278
 			$view->summaryEnableModify = true;
279 279
 			$view->summaryBasket = $basket;
280 280
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Standard/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/basket/standard/name
37 37
 		 * Class name of the used basket standard 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/basket/standard/name', 'Standard' );
69
+		if ($name === null) {
70
+			$name = $context->getConfig()->get('client/html/basket/standard/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\\Basket\\Standard\\' . $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\\Basket\\Standard\\'.$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\\Basket\\Standard\\' . $name;
80
+		$classname = '\\Aimeos\\Client\\Html\\Basket\\Standard\\'.$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, 'basket/standard' );
84
+		return self::addClientDecorators($context, $client, $templatePaths, 'basket/standard');
85 85
 	}
86 86
 }
87 87
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Standard/Standard.php 1 patch
Spacing   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @since 2014.03
79 79
 	 * @category Developer
80 80
 	 */
81
-	private $subPartNames = array( 'detail', 'coupon' );
81
+	private $subPartNames = array('detail', 'coupon');
82 82
 	private $cache;
83 83
 
84 84
 
@@ -90,42 +90,42 @@  discard block
 block discarded – undo
90 90
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
91 91
 	 * @return string HTML code
92 92
 	 */
93
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
93
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
94 94
 	{
95 95
 		$context = $this->getContext();
96 96
 		$view = $this->getView();
97 97
 
98 98
 		try
99 99
 		{
100
-			$view = $this->setViewParams( $view, $tags, $expire );
100
+			$view = $this->setViewParams($view, $tags, $expire);
101 101
 
102 102
 			$html = '';
103
-			foreach( $this->getSubClients() as $subclient ) {
104
-				$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
103
+			foreach ($this->getSubClients() as $subclient) {
104
+				$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
105 105
 			}
106 106
 			$view->standardBody = $html;
107 107
 		}
108
-		catch( \Aimeos\Client\Html\Exception $e )
108
+		catch (\Aimeos\Client\Html\Exception $e)
109 109
 		{
110
-			$error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) );
111
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
110
+			$error = array($this->getContext()->getI18n()->dt('client', $e->getMessage()));
111
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
112 112
 		}
113
-		catch( \Aimeos\Controller\Frontend\Exception $e )
113
+		catch (\Aimeos\Controller\Frontend\Exception $e)
114 114
 		{
115
-			$error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
116
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
115
+			$error = array($this->getContext()->getI18n()->dt('controller/frontend', $e->getMessage()));
116
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
117 117
 		}
118
-		catch( \Aimeos\MShop\Exception $e )
118
+		catch (\Aimeos\MShop\Exception $e)
119 119
 		{
120
-			$error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
121
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
120
+			$error = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
121
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
122 122
 		}
123
-		catch( \Exception $e )
123
+		catch (\Exception $e)
124 124
 		{
125
-			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
125
+			$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
126 126
 
127
-			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
128
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
127
+			$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
128
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
129 129
 		}
130 130
 
131 131
 		/** client/html/basket/standard/standard/template-body
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 		$tplconf = 'client/html/basket/standard/standard/template-body';
152 152
 		$default = 'basket/standard/body-default.php';
153 153
 
154
-		return $view->render( $view->config( $tplconf, $default ) );
154
+		return $view->render($view->config($tplconf, $default));
155 155
 	}
156 156
 
157 157
 
@@ -163,21 +163,21 @@  discard block
 block discarded – undo
163 163
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
164 164
 	 * @return string|null String including HTML tags for the header on error
165 165
 	 */
166
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
166
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
167 167
 	{
168 168
 		try
169 169
 		{
170
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
170
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
171 171
 
172 172
 			$html = '';
173
-			foreach( $this->getSubClients() as $subclient ) {
174
-				$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
173
+			foreach ($this->getSubClients() as $subclient) {
174
+				$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
175 175
 			}
176 176
 			$view->standardHeader = $html;
177 177
 		}
178
-		catch( \Exception $e )
178
+		catch (\Exception $e)
179 179
 		{
180
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
180
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
181 181
 			return '';
182 182
 		}
183 183
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		$tplconf = 'client/html/basket/standard/standard/template-header';
206 206
 		$default = 'basket/standard/header-default.php';
207 207
 
208
-		return $view->render( $view->config( $tplconf, $default ) );
208
+		return $view->render($view->config($tplconf, $default));
209 209
 	}
210 210
 
211 211
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * @param string|null $name Name of the sub-client (Default if null)
217 217
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
218 218
 	 */
219
-	public function getSubClient( $type, $name = null )
219
+	public function getSubClient($type, $name = null)
220 220
 	{
221 221
 		/** client/html/basket/standard/decorators/excludes
222 222
 		 * Excludes decorators added by the "common" option from the basket standard html client
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 		 * @see client/html/basket/standard/decorators/global
293 293
 		 */
294 294
 
295
-		return $this->createSubClient( 'basket/standard/' . $type, $name );
295
+		return $this->createSubClient('basket/standard/'.$type, $name);
296 296
 	}
297 297
 
298 298
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 				 * @category Developer
321 321
 				 * @category User
322 322
 				 */
323
-				'stock' => $view->config( 'client/html/basket/require-stock', true ),
323
+				'stock' => $view->config('client/html/basket/require-stock', true),
324 324
 
325 325
 				/** client/html/basket/require-variant
326 326
 				 * A variant of a selection product must be chosen
@@ -338,55 +338,55 @@  discard block
 block discarded – undo
338 338
 				 * @category Developer
339 339
 				 * @category User
340 340
 				 */
341
-				'variant' => $view->config( 'client/html/basket/require-variant', true ),
341
+				'variant' => $view->config('client/html/basket/require-variant', true),
342 342
 			);
343 343
 
344
-			switch( $view->param( 'b_action' ) )
344
+			switch ($view->param('b_action'))
345 345
 			{
346 346
 				case 'add':
347
-					$this->addProducts( $view, $options );
347
+					$this->addProducts($view, $options);
348 348
 					break;
349 349
 				case 'delete':
350
-					$this->deleteProducts( $view );
350
+					$this->deleteProducts($view);
351 351
 					break;
352 352
 				default:
353
-					$this->editProducts( $view, $options );
353
+					$this->editProducts($view, $options);
354 354
 			}
355 355
 
356 356
 			parent::process();
357 357
 
358
-			$controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
359
-			$controller->get()->check( \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT );
358
+			$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket');
359
+			$controller->get()->check(\Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT);
360 360
 		}
361
-		catch( \Aimeos\Client\Html\Exception $e )
361
+		catch (\Aimeos\Client\Html\Exception $e)
362 362
 		{
363
-			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
364
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
363
+			$error = array($context->getI18n()->dt('client', $e->getMessage()));
364
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
365 365
 		}
366
-		catch( \Aimeos\Controller\Frontend\Exception $e )
366
+		catch (\Aimeos\Controller\Frontend\Exception $e)
367 367
 		{
368
-			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
369
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
368
+			$error = array($context->getI18n()->dt('controller/frontend', $e->getMessage()));
369
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
370 370
 		}
371
-		catch( \Aimeos\MShop\Plugin\Provider\Exception $e )
371
+		catch (\Aimeos\MShop\Plugin\Provider\Exception $e)
372 372
 		{
373
-			$errors = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
374
-			$errors = array_merge( $errors, $this->translatePluginErrorCodes( $e->getErrorCodes() ) );
373
+			$errors = array($context->getI18n()->dt('mshop', $e->getMessage()));
374
+			$errors = array_merge($errors, $this->translatePluginErrorCodes($e->getErrorCodes()));
375 375
 
376 376
 			$view->summaryErrorCodes = $e->getErrorCodes();
377
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $errors;
377
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $errors;
378 378
 		}
379
-		catch( \Aimeos\MShop\Exception $e )
379
+		catch (\Aimeos\MShop\Exception $e)
380 380
 		{
381
-			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
382
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
381
+			$error = array($context->getI18n()->dt('mshop', $e->getMessage()));
382
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
383 383
 		}
384
-		catch( \Exception $e )
384
+		catch (\Exception $e)
385 385
 		{
386
-			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
386
+			$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
387 387
 
388
-			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
389
-			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
388
+			$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
389
+			$view->standardErrorList = $view->get('standardErrorList', array()) + $error;
390 390
 		}
391 391
 	}
392 392
 
@@ -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,38 +410,38 @@  discard block
 block discarded – undo
410 410
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
411 411
 	 * @return \Aimeos\MW\View\Iface Modified view object
412 412
 	 */
413
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
413
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
414 414
 	{
415
-		if( !isset( $this->cache ) )
415
+		if (!isset($this->cache))
416 416
 		{
417 417
 			$context = $this->getContext();
418 418
 			$site = $context->getLocale()->getSite()->getCode();
419 419
 
420
-			if( ( $params = $context->getSession()->get( 'aimeos/catalog/detail/params/last' . $site ) ) !== null )
420
+			if (($params = $context->getSession()->get('aimeos/catalog/detail/params/last'.$site)) !== null)
421 421
 			{
422
-				$target = $view->config( 'client/html/catalog/detail/url/target' );
423
-				$controller = $view->config( 'client/html/catalog/detail/url/controller', 'catalog' );
424
-				$action = $view->config( 'client/html/catalog/detail/url/action', 'detail' );
425
-				$config = $view->config( 'client/html/catalog/detail/url/config', array() );
422
+				$target = $view->config('client/html/catalog/detail/url/target');
423
+				$controller = $view->config('client/html/catalog/detail/url/controller', 'catalog');
424
+				$action = $view->config('client/html/catalog/detail/url/action', 'detail');
425
+				$config = $view->config('client/html/catalog/detail/url/config', array());
426 426
 			}
427 427
 			else
428 428
 			{
429
-				$params = $context->getSession()->get( 'aimeos/catalog/lists/params/last' . $site, array() );
429
+				$params = $context->getSession()->get('aimeos/catalog/lists/params/last'.$site, array());
430 430
 
431
-				$target = $view->config( 'client/html/catalog/lists/url/target' );
432
-				$controller = $view->config( 'client/html/catalog/lists/url/controller', 'catalog' );
433
-				$action = $view->config( 'client/html/catalog/lists/url/action', 'list' );
434
-				$config = $view->config( 'client/html/catalog/lists/url/config', array() );
431
+				$target = $view->config('client/html/catalog/lists/url/target');
432
+				$controller = $view->config('client/html/catalog/lists/url/controller', 'catalog');
433
+				$action = $view->config('client/html/catalog/lists/url/action', 'list');
434
+				$config = $view->config('client/html/catalog/lists/url/config', array());
435 435
 
436 436
 			}
437 437
 
438
-			if( empty( $params ) === false )
438
+			if (empty($params) === false)
439 439
 			{
440
-				$view->standardParams = $this->getClientParams( $view->param() );
441
-				$view->standardBackUrl = $view->url( $target, $controller, $action, $params, array(), $config );
440
+				$view->standardParams = $this->getClientParams($view->param());
441
+				$view->standardBackUrl = $view->url($target, $controller, $action, $params, array(), $config);
442 442
 			}
443 443
 
444
-			$view->standardBasket = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' )->get();
444
+			$view->standardBasket = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket')->get();
445 445
 
446 446
 			$this->cache = $view;
447 447
 		}
@@ -456,27 +456,27 @@  discard block
 block discarded – undo
456 456
 	 * @param \Aimeos\MW\View\Iface $view View object
457 457
 	 * @param array $options List of options for addProducts() in basket controller
458 458
 	 */
459
-	protected function addProducts( \Aimeos\MW\View\Iface $view, array $options )
459
+	protected function addProducts(\Aimeos\MW\View\Iface $view, array $options)
460 460
 	{
461 461
 		$this->clearCached();
462
-		$products = (array) $view->param( 'b_prod', array() );
463
-		$controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'basket' );
462
+		$products = (array) $view->param('b_prod', array());
463
+		$controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'basket');
464 464
 
465
-		if( ( $prodid = $view->param( 'b_prodid', '' ) ) !== '' )
465
+		if (($prodid = $view->param('b_prodid', '')) !== '')
466 466
 		{
467 467
 			$products[] = array(
468 468
 				'prodid' => $prodid,
469
-				'quantity' => $view->param( 'b_quantity', 1 ),
470
-				'attrvarid' => array_filter( (array) $view->param( 'b_attrvarid', array() ) ),
471
-				'attrconfid' => array_filter( (array) $view->param( 'b_attrconfid', array() ) ),
472
-				'attrhideid' => array_filter( (array) $view->param( 'b_attrhideid', array() ) ),
473
-				'attrcustid' => array_filter( (array) $view->param( 'b_attrcustid', array() ) ),
474
-				'warehouse' => $view->param( 'b_warehouse', 'default' ),
469
+				'quantity' => $view->param('b_quantity', 1),
470
+				'attrvarid' => array_filter((array) $view->param('b_attrvarid', array())),
471
+				'attrconfid' => array_filter((array) $view->param('b_attrconfid', array())),
472
+				'attrhideid' => array_filter((array) $view->param('b_attrhideid', array())),
473
+				'attrcustid' => array_filter((array) $view->param('b_attrcustid', array())),
474
+				'warehouse' => $view->param('b_warehouse', 'default'),
475 475
 			);
476 476
 		}
477 477
 
478
-		foreach( $products as $values ) {
479
-			$this->addProduct( $controller, $values, $options );
478
+		foreach ($products as $values) {
479
+			$this->addProduct($controller, $values, $options);
480 480
 		}
481 481
 	}
482 482
 
@@ -488,17 +488,17 @@  discard block
 block discarded – undo
488 488
 	 * @param array $values Associative list of key/value pairs from the view specifying the product
489 489
 	 * @param array $options List of options for addProducts() in basket frontend controller
490 490
 	 */
491
-	protected function addProduct( \Aimeos\Controller\Frontend\Iface $controller, array $values, array $options )
491
+	protected function addProduct(\Aimeos\Controller\Frontend\Iface $controller, array $values, array $options)
492 492
 	{
493 493
 		$controller->addProduct(
494
-			( isset( $values['prodid'] ) ? (string) $values['prodid'] : '' ),
495
-			( isset( $values['quantity'] ) ? (int) $values['quantity'] : 1 ),
494
+			(isset($values['prodid']) ? (string) $values['prodid'] : ''),
495
+			(isset($values['quantity']) ? (int) $values['quantity'] : 1),
496 496
 			$options,
497
-			( isset( $values['attrvarid'] ) ? array_filter( (array) $values['attrvarid'] ) : array() ),
498
-			( isset( $values['attrconfid'] ) ? array_filter( (array) $values['attrconfid'] ) : array() ),
499
-			( isset( $values['attrhideid'] ) ? array_filter( (array) $values['attrhideid'] ) : array() ),
500
-			( isset( $values['attrcustid'] ) ? array_filter( (array) $values['attrcustid'] ) : array() ),
501
-			( isset( $values['warehouse'] ) ? (string) $values['warehouse'] : 'default' )
497
+			(isset($values['attrvarid']) ? array_filter((array) $values['attrvarid']) : array()),
498
+			(isset($values['attrconfid']) ? array_filter((array) $values['attrconfid']) : array()),
499
+			(isset($values['attrhideid']) ? array_filter((array) $values['attrhideid']) : array()),
500
+			(isset($values['attrcustid']) ? array_filter((array) $values['attrcustid']) : array()),
501
+			(isset($values['warehouse']) ? (string) $values['warehouse'] : 'default')
502 502
 		);
503 503
 	}
504 504
 
@@ -508,14 +508,14 @@  discard block
 block discarded – undo
508 508
 	 *
509 509
 	 * @param \Aimeos\MW\View\Iface $view View object
510 510
 	 */
511
-	protected function deleteProducts( \Aimeos\MW\View\Iface $view )
511
+	protected function deleteProducts(\Aimeos\MW\View\Iface $view)
512 512
 	{
513 513
 		$this->clearCached();
514
-		$products = (array) $view->param( 'b_position', array() );
515
-		$controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'basket' );
514
+		$products = (array) $view->param('b_position', array());
515
+		$controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'basket');
516 516
 
517
-		foreach( $products as $position ) {
518
-			$controller->deleteProduct( $position );
517
+		foreach ($products as $position) {
518
+			$controller->deleteProduct($position);
519 519
 		}
520 520
 	}
521 521
 
@@ -526,28 +526,28 @@  discard block
 block discarded – undo
526 526
 	 * @param \Aimeos\MW\View\Iface $view View object
527 527
 	 * @param array $options List of options for editProducts() in basket controller
528 528
 	 */
529
-	protected function editProducts( \Aimeos\MW\View\Iface $view, array $options )
529
+	protected function editProducts(\Aimeos\MW\View\Iface $view, array $options)
530 530
 	{
531 531
 		$this->clearCached();
532
-		$products = (array) $view->param( 'b_prod', array() );
533
-		$controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'basket' );
532
+		$products = (array) $view->param('b_prod', array());
533
+		$controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'basket');
534 534
 
535
-		if( ( $position = $view->param( 'b_position', '' ) ) !== '' )
535
+		if (($position = $view->param('b_position', '')) !== '')
536 536
 		{
537 537
 			$products[] = array(
538 538
 				'position' => $position,
539
-				'quantity' => $view->param( 'b_quantity', 1 ),
540
-				'attrconf-code' => array_filter( (array) $view->param( 'b_attrconfcode', array() ) )
539
+				'quantity' => $view->param('b_quantity', 1),
540
+				'attrconf-code' => array_filter((array) $view->param('b_attrconfcode', array()))
541 541
 			);
542 542
 		}
543 543
 
544
-		foreach( $products as $values )
544
+		foreach ($products as $values)
545 545
 		{
546 546
 			$controller->editProduct(
547
-				( isset( $values['position'] ) ? (int) $values['position'] : 0 ),
548
-				( isset( $values['quantity'] ) ? (int) $values['quantity'] : 1 ),
547
+				(isset($values['position']) ? (int) $values['position'] : 0),
548
+				(isset($values['quantity']) ? (int) $values['quantity'] : 1),
549 549
 				$options,
550
-				( isset( $values['attrconf-code'] ) ? array_filter( (array) $values['attrconf-code'] ) : array() )
550
+				(isset($values['attrconf-code']) ? array_filter((array) $values['attrconf-code']) : array())
551 551
 			);
552 552
 		}
553 553
 	}
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Related/Bought/Standard.php 1 patch
Spacing   +45 added lines, -45 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->boughtBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/basket/related/bought/standard/template-body';
101 101
 		$default = 'basket/related/bought-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->boughtHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/basket/related/bought/standard/template-header';
147 147
 		$default = 'basket/related/bought-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/basket/related/bought/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the basket related bought html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/basket/related/bought/decorators/global
234 234
 		 */
235 235
 
236
-		return $this->createSubClient( 'basket/related/bought/' . $type, $name );
236
+		return $this->createSubClient('basket/related/bought/'.$type, $name);
237 237
 	}
238 238
 
239 239
 
@@ -244,7 +244,7 @@  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
 
@@ -256,31 +256,31 @@  discard block
 block discarded – undo
256 256
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
257 257
 	 * @return \Aimeos\MW\View\Iface Modified view object
258 258
 	 */
259
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
259
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
260 260
 	{
261
-		if( !isset( $this->cache ) )
261
+		if (!isset($this->cache))
262 262
 		{
263
-			if( isset( $view->relatedBasket ) )
263
+			if (isset($view->relatedBasket))
264 264
 			{
265 265
 				$refIds = $items = array();
266 266
 				$context = $this->getContext();
267 267
 
268
-				$prodIds = $this->getProductIdsFromBasket( $view->relatedBasket );
268
+				$prodIds = $this->getProductIdsFromBasket($view->relatedBasket);
269 269
 
270
-				foreach( $this->getListItems( $prodIds ) as $listItem )
270
+				foreach ($this->getListItems($prodIds) as $listItem)
271 271
 				{
272 272
 					$refId = $listItem->getRefId();
273 273
 
274
-					if( !isset( $prodIds[$refId] ) ) {
274
+					if (!isset($prodIds[$refId])) {
275 275
 						$refIds[$refId] = $refId;
276 276
 					}
277 277
 				}
278 278
 
279
-				$products = $this->getProductItems( $refIds );
279
+				$products = $this->getProductItems($refIds);
280 280
 
281
-				foreach( $refIds as $id )
281
+				foreach ($refIds as $id)
282 282
 				{
283
-					if( isset( $products[$id] ) ) {
283
+					if (isset($products[$id])) {
284 284
 						$items[$id] = $products[$id];
285 285
 					}
286 286
 				}
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
 				 * @param integer Number of products
301 301
 				 * @since 2014.09
302 302
 				 */
303
-				$size = $context->getConfig()->get( 'client/html/basket/related/bought/standard/limit', 6 );
303
+				$size = $context->getConfig()->get('client/html/basket/related/bought/standard/limit', 6);
304 304
 
305 305
 
306
-				$view->boughtItems = array_slice( $items, 0, $size, true );
306
+				$view->boughtItems = array_slice($items, 0, $size, true);
307 307
 			}
308 308
 
309 309
 			$this->cache = $view;
@@ -319,22 +319,22 @@  discard block
 block discarded – undo
319 319
 	 * @param string[] $prodIds List of product IDs
320 320
 	 * @return \Aimeos\MShop\Product\Item\Lists\Iface[] List of product list items
321 321
 	 */
322
-	protected function getListItems( array $prodIds )
322
+	protected function getListItems(array $prodIds)
323 323
 	{
324
-		$typeItem = $this->getTypeItem( 'product/lists/type', 'product', 'bought-together' );
325
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/lists' );
324
+		$typeItem = $this->getTypeItem('product/lists/type', 'product', 'bought-together');
325
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/lists');
326 326
 
327
-		$search = $manager->createSearch( true );
327
+		$search = $manager->createSearch(true);
328 328
 		$expr = array(
329
-				$search->compare( '==', 'product.lists.parentid', $prodIds ),
330
-				$search->compare( '==', 'product.lists.typeid', $typeItem->getId() ),
331
-				$search->compare( '==', 'product.lists.domain', 'product' ),
329
+				$search->compare('==', 'product.lists.parentid', $prodIds),
330
+				$search->compare('==', 'product.lists.typeid', $typeItem->getId()),
331
+				$search->compare('==', 'product.lists.domain', 'product'),
332 332
 				$search->getConditions(),
333 333
 		);
334
-		$search->setConditions( $search->combine( '&&', $expr ) );
335
-		$search->setSortations( array( $search->sort( '+', 'product.lists.position' ) ) );
334
+		$search->setConditions($search->combine('&&', $expr));
335
+		$search->setSortations(array($search->sort('+', 'product.lists.position')));
336 336
 
337
-		return $manager->searchItems( $search );
337
+		return $manager->searchItems($search);
338 338
 	}
339 339
 
340 340
 
@@ -344,20 +344,20 @@  discard block
 block discarded – undo
344 344
 	 * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object
345 345
 	 * @return string[] List of product IDs
346 346
 	 */
347
-	protected function getProductIdsFromBasket( \Aimeos\MShop\Order\Item\Base\Iface $basket )
347
+	protected function getProductIdsFromBasket(\Aimeos\MShop\Order\Item\Base\Iface $basket)
348 348
 	{
349 349
 		$list = array();
350 350
 
351
-		foreach( $basket->getProducts() as $orderProduct )
351
+		foreach ($basket->getProducts() as $orderProduct)
352 352
 		{
353
-			$list[ $orderProduct->getProductId() ] = true;
353
+			$list[$orderProduct->getProductId()] = true;
354 354
 
355
-			foreach( $orderProduct->getProducts() as $subProduct ) {
356
-				$list[ $subProduct->getProductId() ] = true;
355
+			foreach ($orderProduct->getProducts() as $subProduct) {
356
+				$list[$subProduct->getProductId()] = true;
357 357
 			}
358 358
 		}
359 359
 
360
-		return array_keys( $list );
360
+		return array_keys($list);
361 361
 	}
362 362
 
363 363
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 	 * @param string[] $ids List of product IDs
368 368
 	 * @return \Aimeos\MShop\Product\Item\Iface[] List of product items
369 369
 	 */
370
-	protected function getProductItems( array $ids )
370
+	protected function getProductItems(array $ids)
371 371
 	{
372 372
 		$context = $this->getContext();
373 373
 		$config = $context->getConfig();
@@ -387,11 +387,11 @@  discard block
 block discarded – undo
387 387
 		 * @since 2014.09
388 388
 		 * @category Developer
389 389
 		 */
390
-		$domains = array( 'text', 'price', 'media' );
391
-		$domains = $config->get( 'client/html/basket/related/bought/standard/domains', $domains );
390
+		$domains = array('text', 'price', 'media');
391
+		$domains = $config->get('client/html/basket/related/bought/standard/domains', $domains);
392 392
 
393
-		$controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' );
393
+		$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog');
394 394
 
395
-		return $controller->getProductItems( $ids, $domains );
395
+		return $controller->getProductItems($ids, $domains);
396 396
 	}
397 397
 }
398 398
\ No newline at end of file
Please login to merge, or discard this patch.