Completed
Push — master ( d9c87d...d2fca1 )
by Aimeos
06:49
created
client/html/src/Client/Html/Basket/Mini/Product/Standard.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 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->productBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/basket/mini/product/standard/template-body';
101 101
 		$default = 'basket/mini/product-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
 
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
 	 */
115 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->productHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/basket/mini/product/standard/template-header';
147 147
 		$default = 'basket/mini/product-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
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/basket/mini/product/decorators/global
234 234
 		 */
235 235
 
236
-		return $this->createSubClient( 'basket/mini/product/' . $type, $name );
236
+		return $this->createSubClient('basket/mini/product/'.$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/Basket/Mini/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/mini/name
37 37
 		 * Class name of the used basket mini 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/mini/name', 'Standard' );
69
+		if ($name === null) {
70
+			$name = $context->getConfig()->get('client/html/basket/mini/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\\Mini\\' . $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\\Mini\\'.$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\\Mini\\' . $name;
80
+		$classname = '\\Aimeos\\Client\\Html\\Basket\\Mini\\'.$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/mini' );
84
+		return self::addClientDecorators($context, $client, $templatePaths, 'basket/mini');
85 85
 	}
86 86
 
87 87
 }
88 88
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Mini/Standard.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @since 2015.09
79 79
 	 * @category Developer
80 80
 	 */
81
-	private $subPartNames = array( 'main', 'product' );
81
+	private $subPartNames = array('main', 'product');
82 82
 
83 83
 	private $cache;
84 84
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
92 92
 	 * @return string HTML code
93 93
 	 */
94
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
94
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
95 95
 	{
96 96
 		$context = $this->getContext();
97 97
 		$site = $context->getLocale()->getSiteId();
@@ -107,42 +107,42 @@  discard block
 block discarded – undo
107 107
 		 * @category Developer
108 108
 		 * @see client/html/basket#mini
109 109
 		 */
110
-		$config = $context->getConfig()->get( 'client/html/basket/mini', array() );
111
-		$key = $this->getParamHash( array(), $uid . $site . ':basket:mini-body', $config );
110
+		$config = $context->getConfig()->get('client/html/basket/mini', array());
111
+		$key = $this->getParamHash(array(), $uid.$site.':basket:mini-body', $config);
112 112
 
113
-		if( ( $html = $this->getBasketCached( $key ) ) === null )
113
+		if (($html = $this->getBasketCached($key)) === null)
114 114
 		{
115 115
 			try
116 116
 			{
117
-				$view = $this->setViewParams( $view, $tags, $expire );
117
+				$view = $this->setViewParams($view, $tags, $expire);
118 118
 
119 119
 				$output = '';
120
-				foreach( $this->getSubClients() as $subclient ) {
121
-					$output .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
120
+				foreach ($this->getSubClients() as $subclient) {
121
+					$output .= $subclient->setView($view)->getBody($uid, $tags, $expire);
122 122
 				}
123 123
 				$view->miniBody = $output;
124 124
 			}
125
-			catch( \Aimeos\Client\Html\Exception $e )
125
+			catch (\Aimeos\Client\Html\Exception $e)
126 126
 			{
127
-				$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
128
-				$view->miniErrorList = $view->get( 'miniErrorList', array() ) + $error;
127
+				$error = array($context->getI18n()->dt('client', $e->getMessage()));
128
+				$view->miniErrorList = $view->get('miniErrorList', array()) + $error;
129 129
 			}
130
-			catch( \Aimeos\Controller\Frontend\Exception $e )
130
+			catch (\Aimeos\Controller\Frontend\Exception $e)
131 131
 			{
132
-				$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
133
-				$view->miniErrorList = $view->get( 'miniErrorList', array() ) + $error;
132
+				$error = array($context->getI18n()->dt('controller/frontend', $e->getMessage()));
133
+				$view->miniErrorList = $view->get('miniErrorList', array()) + $error;
134 134
 			}
135
-			catch( \Aimeos\MShop\Exception $e )
135
+			catch (\Aimeos\MShop\Exception $e)
136 136
 			{
137
-				$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
138
-				$view->miniErrorList = $view->get( 'miniErrorList', array() ) + $error;
137
+				$error = array($context->getI18n()->dt('mshop', $e->getMessage()));
138
+				$view->miniErrorList = $view->get('miniErrorList', array()) + $error;
139 139
 			}
140
-			catch( \Exception $e )
140
+			catch (\Exception $e)
141 141
 			{
142
-				$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
142
+				$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
143 143
 
144
-				$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
145
-				$view->miniErrorList = $view->get( 'miniErrorList', array() ) + $error;
144
+				$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
145
+				$view->miniErrorList = $view->get('miniErrorList', array()) + $error;
146 146
 			}
147 147
 
148 148
 			/** client/html/basket/mini/standard/template-body
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 			$tplconf = 'client/html/basket/mini/standard/template-body';
169 169
 			$default = 'basket/mini/body-default.php';
170 170
 
171
-			$html = $view->render( $view->config( $tplconf, $default ) );
172
-			$this->setBasketCached( $key, $html );
171
+			$html = $view->render($view->config($tplconf, $default));
172
+			$this->setBasketCached($key, $html);
173 173
 		}
174 174
 		else
175 175
 		{
176
-			$html = $this->modifyBody( $html, $uid );
176
+			$html = $this->modifyBody($html, $uid);
177 177
 		}
178 178
 
179 179
 		return $html;
@@ -188,24 +188,24 @@  discard block
 block discarded – undo
188 188
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
189 189
 	 * @return string|null String including HTML tags for the header on error
190 190
 	 */
191
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
191
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
192 192
 	{
193 193
 		$context = $this->getContext();
194 194
 		$site = $context->getLocale()->getSiteId();
195 195
 		$view = $this->getView();
196 196
 
197
-		$config = $context->getConfig()->get( 'client/html/basket/mini', array() );
198
-		$key = $this->getParamHash( array(), $uid . $site . ':basket:mini-header', $config );
197
+		$config = $context->getConfig()->get('client/html/basket/mini', array());
198
+		$key = $this->getParamHash(array(), $uid.$site.':basket:mini-header', $config);
199 199
 
200
-		if( ( $html = $this->getBasketCached( $key ) ) === null )
200
+		if (($html = $this->getBasketCached($key)) === null)
201 201
 		{
202 202
 			try
203 203
 			{
204
-				$view = $this->setViewParams( $this->getView(), $tags, $expire );
204
+				$view = $this->setViewParams($this->getView(), $tags, $expire);
205 205
 
206 206
 				$output = '';
207
-				foreach( $this->getSubClients() as $subclient ) {
208
-					$output .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
207
+				foreach ($this->getSubClients() as $subclient) {
208
+					$output .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
209 209
 				}
210 210
 				$view->miniHeader = $output;
211 211
 
@@ -233,17 +233,17 @@  discard block
 block discarded – undo
233 233
 				$tplconf = 'client/html/basket/mini/standard/template-header';
234 234
 				$default = 'basket/mini/header-default.php';
235 235
 
236
-				$html = $view->render( $view->config( $tplconf, $default ) );
237
-				$this->setBasketCached( $key, $html );
236
+				$html = $view->render($view->config($tplconf, $default));
237
+				$this->setBasketCached($key, $html);
238 238
 			}
239
-			catch( \Exception $e )
239
+			catch (\Exception $e)
240 240
 			{
241
-				$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
241
+				$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
242 242
 			}
243 243
 		}
244 244
 		else
245 245
 		{
246
-			$html = $this->modifyHeader( $html, $uid );
246
+			$html = $this->modifyHeader($html, $uid);
247 247
 		}
248 248
 
249 249
 		return $html;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 * @param string|null $name Name of the sub-client (Default if null)
258 258
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
259 259
 	 */
260
-	public function getSubClient( $type, $name = null )
260
+	public function getSubClient($type, $name = null)
261 261
 	{
262 262
 		/** client/html/basket/mini/decorators/excludes
263 263
 		 * Excludes decorators added by the "common" option from the basket mini html client
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 		 * @see client/html/basket/mini/decorators/global
334 334
 		 */
335 335
 
336
-		return $this->createSubClient( 'basket/mini/' . $type, $name );
336
+		return $this->createSubClient('basket/mini/'.$type, $name);
337 337
 	}
338 338
 
339 339
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	 */
345 345
 	protected function getSubClientNames()
346 346
 	{
347
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
347
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
348 348
 	}
349 349
 
350 350
 
@@ -356,11 +356,11 @@  discard block
 block discarded – undo
356 356
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
357 357
 	 * @return \Aimeos\MW\View\Iface Modified view object
358 358
 	 */
359
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
359
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
360 360
 	{
361
-		if( !isset( $this->cache ) )
361
+		if (!isset($this->cache))
362 362
 		{
363
-			$controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'basket' );
363
+			$controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'basket');
364 364
 			$view->miniBasket = $controller->get();
365 365
 
366 366
 			$this->cache = $view;
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Mini/Main/Standard.php 1 patch
Spacing   +16 added lines, -16 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->mainBody = $html;
80 80
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$tplconf = 'client/html/basket/mini/main/standard/template-body';
102 102
 		$default = 'basket/mini/main-body-default.php';
103 103
 
104
-		return $view->render( $view->config( $tplconf, $default ) );
104
+		return $view->render($view->config($tplconf, $default));
105 105
 	}
106 106
 
107 107
 
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
114 114
 	 * @return string|null String including HTML tags for the header on error
115 115
 	 */
116
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
116
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
117 117
 	{
118
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
118
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
119 119
 
120 120
 		$html = '';
121
-		foreach( $this->getSubClients() as $subclient ) {
122
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
121
+		foreach ($this->getSubClients() as $subclient) {
122
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
123 123
 		}
124 124
 		$view->mainHeader = $html;
125 125
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		$tplconf = 'client/html/basket/mini/main/standard/template-header';
148 148
 		$default = 'basket/mini/main-header-default.php';
149 149
 
150
-		return $view->render( $view->config( $tplconf, $default ) );
150
+		return $view->render($view->config($tplconf, $default));
151 151
 	}
152 152
 
153 153
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @param string|null $name Name of the sub-client (Default if null)
159 159
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
160 160
 	 */
161
-	public function getSubClient( $type, $name = null )
161
+	public function getSubClient($type, $name = null)
162 162
 	{
163 163
 		/** client/html/basket/mini/main/decorators/excludes
164 164
 		 * Excludes decorators added by the "common" option from the basket mini main html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/basket/mini/main/decorators/excludes
234 234
 		 * @see client/html/basket/mini/main/decorators/global
235 235
 		 */
236
-		return $this->createSubClient( 'basket/mini/main/' . $type, $name );
236
+		return $this->createSubClient('basket/mini/main/'.$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,14 +256,14 @@  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 263
 			$view->mainPriceItem = $view->miniBasket->getPrice();
264 264
 
265 265
 			$count = 0;
266
-			foreach( $view->miniBasket->getProducts() as $product ) {
266
+			foreach ($view->miniBasket->getProducts() as $product) {
267 267
 				$count += $product->getQuantity();
268 268
 			}
269 269
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Stage/Breadcrumb/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->breadcrumbBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/catalog/stage/breadcrumb/standard/template-body';
101 101
 		$default = 'catalog/stage/breadcrumb-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->breadcrumbHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/catalog/stage/breadcrumb/standard/template-header';
147 147
 		$default = 'catalog/stage/breadcrumb-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/catalog/stage/breadcrumb/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the catalog stage breadcrumb html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/catalog/stage/breadcrumb/decorators/global
234 234
 		 */
235 235
 
236
-		return $this->createSubClient( 'catalog/stage/breadcrumb/' . $type, $name );
236
+		return $this->createSubClient('catalog/stage/breadcrumb/'.$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/Catalog/Stage/Navigator/Standard.php 1 patch
Spacing   +38 added lines, -38 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->navigatorBody = $html;
80 80
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$tplconf = 'client/html/catalog/stage/navigator/standard/template-body';
102 102
 		$default = 'catalog/stage/navigator-body-default.php';
103 103
 
104
-		return $view->render( $view->config( $tplconf, $default ) );
104
+		return $view->render($view->config($tplconf, $default));
105 105
 	}
106 106
 
107 107
 
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
114 114
 	 * @return string|null String including HTML tags for the header on error
115 115
 	 */
116
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
116
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
117 117
 	{
118
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
118
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
119 119
 
120 120
 		$html = '';
121
-		foreach( $this->getSubClients() as $subclient ) {
122
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
121
+		foreach ($this->getSubClients() as $subclient) {
122
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
123 123
 		}
124 124
 		$view->navigatorHeader = $html;
125 125
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		$tplconf = 'client/html/catalog/stage/navigator/standard/template-header';
148 148
 		$default = 'catalog/stage/navigator-header-default.php';
149 149
 
150
-		return $view->render( $view->config( $tplconf, $default ) );
150
+		return $view->render($view->config($tplconf, $default));
151 151
 	}
152 152
 
153 153
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @param string|null $name Name of the sub-client (Default if null)
159 159
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
160 160
 	 */
161
-	public function getSubClient( $type, $name = null )
161
+	public function getSubClient($type, $name = null)
162 162
 	{
163 163
 		/** client/html/catalog/stage/navigator/decorators/excludes
164 164
 		 * Excludes decorators added by the "common" option from the catalog stage navigator html client
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		 * @see client/html/catalog/stage/navigator/decorators/global
235 235
 		 */
236 236
 
237
-		return $this->createSubClient( 'catalog/stage/navigator/' . $type, $name );
237
+		return $this->createSubClient('catalog/stage/navigator/'.$type, $name);
238 238
 	}
239 239
 
240 240
 
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
 	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
246 246
 	 * @return string Modified body content
247 247
 	 */
248
-	public function modifyBody( $content, $uid )
248
+	public function modifyBody($content, $uid)
249 249
 	{
250
-		return $this->replaceSection( $content, $this->getBody( $uid ), 'catalog.stage.navigator' );
250
+		return $this->replaceSection($content, $this->getBody($uid), 'catalog.stage.navigator');
251 251
 	}
252 252
 
253 253
 
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
 	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
259 259
 	 * @return string Modified body content
260 260
 	 */
261
-	public function modifyHeader( $content, $uid )
261
+	public function modifyHeader($content, $uid)
262 262
 	{
263
-		return $this->replaceSection( $content, $this->getHeader( $uid ), 'catalog.stage.navigator' );
263
+		return $this->replaceSection($content, $this->getHeader($uid), 'catalog.stage.navigator');
264 264
 	}
265 265
 
266 266
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	 */
272 272
 	protected function getSubClientNames()
273 273
 	{
274
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
274
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
275 275
 	}
276 276
 
277 277
 
@@ -283,13 +283,13 @@  discard block
 block discarded – undo
283 283
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
284 284
 	 * @return \Aimeos\MW\View\Iface Modified view object
285 285
 	 */
286
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
286
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
287 287
 	{
288
-		if( !isset( $this->view ) )
288
+		if (!isset($this->view))
289 289
 		{
290
-			if( ( $pos = $view->param( 'l_pos' ) ) !== null && ( $pid = $view->param( 'd_prodid' ) ) !== null )
290
+			if (($pos = $view->param('l_pos')) !== null && ($pid = $view->param('d_prodid')) !== null)
291 291
 			{
292
-				if( $pos < 1 ) {
292
+				if ($pos < 1) {
293 293
 					$start = 0; $size = 2;
294 294
 				} else {
295 295
 					$start = $pos - 1; $size = 3;
@@ -297,43 +297,43 @@  discard block
 block discarded – undo
297 297
 
298 298
 				$context = $this->getContext();
299 299
 				$site = $context->getLocale()->getSite()->getCode();
300
-				$params = $context->getSession()->get( 'aimeos/catalog/lists/params/last/' . $site, array() );
300
+				$params = $context->getSession()->get('aimeos/catalog/lists/params/last/'.$site, array());
301 301
 
302
-				$filter = $this->getProductListFilterByParam( $params );
303
-				$filter->setSlice( $start, $size );
302
+				$filter = $this->getProductListFilterByParam($params);
303
+				$filter->setSlice($start, $size);
304 304
 				$total = null;
305 305
 
306
-				$controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' );
307
-				$products = $controller->getIndexItems( $filter, array( 'text' ), $total );
306
+				$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog');
307
+				$products = $controller->getIndexItems($filter, array('text'), $total);
308 308
 
309
-				if( ( $count = count( $products ) ) > 1 )
309
+				if (($count = count($products)) > 1)
310 310
 				{
311 311
 					$enc = $view->encoder();
312
-					$listPos = array_search( $pid, array_keys( $products ) );
312
+					$listPos = array_search($pid, array_keys($products));
313 313
 
314
-					$target = $view->config( 'client/html/catalog/detail/url/target' );
315
-					$controller = $view->config( 'client/html/catalog/detail/url/controller', 'catalog' );
316
-					$action = $view->config( 'client/html/catalog/detail/url/action', 'detail' );
317
-					$config = $view->config( 'client/html/catalog/detail/url/config', array() );
314
+					$target = $view->config('client/html/catalog/detail/url/target');
315
+					$controller = $view->config('client/html/catalog/detail/url/controller', 'catalog');
316
+					$action = $view->config('client/html/catalog/detail/url/action', 'detail');
317
+					$config = $view->config('client/html/catalog/detail/url/config', array());
318 318
 
319
-					if( $listPos > 0 && ( $product = reset( $products ) ) !== false )
319
+					if ($listPos > 0 && ($product = reset($products)) !== false)
320 320
 					{
321 321
 						$param = array(
322 322
 							'd_prodid' => $product->getId(),
323
-							'd_name' => $enc->url( $product->getName( 'url ' ) ),
323
+							'd_name' => $enc->url($product->getName('url ')),
324 324
 							'l_pos' => $pos - 1
325 325
 						);
326
-						$view->navigationPrev = $view->url( $target, $controller, $action, $param, array(), $config );
326
+						$view->navigationPrev = $view->url($target, $controller, $action, $param, array(), $config);
327 327
 					}
328 328
 
329
-					if( $listPos < $count - 1 && ( $product = end( $products ) ) !== false )
329
+					if ($listPos < $count - 1 && ($product = end($products)) !== false)
330 330
 					{
331 331
 						$param = array(
332 332
 							'd_prodid' => $product->getId(),
333
-							'd_name' => $enc->url( $product->getName( 'url' ) ),
333
+							'd_name' => $enc->url($product->getName('url')),
334 334
 							'l_pos' => $pos + 1
335 335
 						);
336
-						$view->navigationNext = $view->url( $target, $controller, $action, $param, array(), $config );
336
+						$view->navigationNext = $view->url($target, $controller, $action, $param, array(), $config);
337 337
 					}
338 338
 				}
339 339
 			}
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Stage/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/catalog/stage/name
37 37
 		 * Class name of the used catalog stage 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/catalog/stage/name', 'Standard' );
69
+		if ($name === null) {
70
+			$name = $context->getConfig()->get('client/html/catalog/stage/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\\Catalog\\Stage\\' . $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\\Catalog\\Stage\\'.$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\\Catalog\\Stage\\' . $name;
80
+		$classname = '\\Aimeos\\Client\\Html\\Catalog\\Stage\\'.$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, 'catalog/stage' );
84
+		return self::addClientDecorators($context, $client, $templatePaths, 'catalog/stage');
85 85
 	}
86 86
 }
87 87
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Stage/Standard.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @since 2014.09
90 90
 	 * @category Developer
91 91
 	 */
92
-	private $subPartNames = array( 'image', 'breadcrumb', 'navigator' );
92
+	private $subPartNames = array('image', 'breadcrumb', 'navigator');
93 93
 
94 94
 	private $tags = array();
95 95
 	private $expire;
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
105 105
 	 * @return string HTML code
106 106
 	 */
107
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
107
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
108 108
 	{
109
-		$prefixes = array( 'f' );
109
+		$prefixes = array('f');
110 110
 		$context = $this->getContext();
111 111
 
112 112
 		/** client/html/catalog/stage
@@ -121,41 +121,41 @@  discard block
 block discarded – undo
121 121
 		 */
122 122
 		$confkey = 'client/html/catalog/stage';
123 123
 
124
-		if( $context->getUserId() != null || ( $html = $this->getCached( 'body', $uid, $prefixes, $confkey ) ) === null )
124
+		if ($context->getUserId() != null || ($html = $this->getCached('body', $uid, $prefixes, $confkey)) === null)
125 125
 		{
126 126
 			$view = $this->getView();
127 127
 
128 128
 			try
129 129
 			{
130
-				$view = $this->setViewParams( $view, $tags, $expire );
130
+				$view = $this->setViewParams($view, $tags, $expire);
131 131
 
132 132
 				$output = '';
133
-				foreach( $this->getSubClients() as $subclient ) {
134
-					$output .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
133
+				foreach ($this->getSubClients() as $subclient) {
134
+					$output .= $subclient->setView($view)->getBody($uid, $tags, $expire);
135 135
 				}
136 136
 				$view->stageBody = $output;
137 137
 			}
138
-			catch( \Aimeos\Client\Html\Exception $e )
138
+			catch (\Aimeos\Client\Html\Exception $e)
139 139
 			{
140
-				$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
141
-				$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
140
+				$error = array($context->getI18n()->dt('client', $e->getMessage()));
141
+				$view->stageErrorList = $view->get('stageErrorList', array()) + $error;
142 142
 			}
143
-			catch( \Aimeos\Controller\Frontend\Exception $e )
143
+			catch (\Aimeos\Controller\Frontend\Exception $e)
144 144
 			{
145
-				$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
146
-				$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
145
+				$error = array($context->getI18n()->dt('controller/frontend', $e->getMessage()));
146
+				$view->stageErrorList = $view->get('stageErrorList', array()) + $error;
147 147
 			}
148
-			catch( \Aimeos\MShop\Exception $e )
148
+			catch (\Aimeos\MShop\Exception $e)
149 149
 			{
150
-				$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
151
-				$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
150
+				$error = array($context->getI18n()->dt('mshop', $e->getMessage()));
151
+				$view->stageErrorList = $view->get('stageErrorList', array()) + $error;
152 152
 			}
153
-			catch( \Exception $e )
153
+			catch (\Exception $e)
154 154
 			{
155
-				$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
155
+				$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
156 156
 
157
-				$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
158
-				$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
157
+				$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
158
+				$view->stageErrorList = $view->get('stageErrorList', array()) + $error;
159 159
 			}
160 160
 
161 161
 			/** client/html/catalog/stage/standard/template-body
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
 			$tplconf = 'client/html/catalog/stage/standard/template-body';
182 182
 			$default = 'catalog/stage/body-default.php';
183 183
 
184
-			$html = $view->render( $view->config( $tplconf, $default ) );
184
+			$html = $view->render($view->config($tplconf, $default));
185 185
 
186
-			$this->setCached( 'body', $uid, $prefixes, $confkey, $html, $tags, $expire );
186
+			$this->setCached('body', $uid, $prefixes, $confkey, $html, $tags, $expire);
187 187
 		}
188 188
 		else
189 189
 		{
190
-			$html = $this->modifyBody( $html, $uid );
190
+			$html = $this->modifyBody($html, $uid);
191 191
 		}
192 192
 
193 193
 		return $html;
@@ -202,29 +202,29 @@  discard block
 block discarded – undo
202 202
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
203 203
 	 * @return string|null String including HTML tags for the header on error
204 204
 	 */
205
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
205
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
206 206
 	{
207
-		$prefixes = array( 'f' );
207
+		$prefixes = array('f');
208 208
 		$context = $this->getContext();
209 209
 		$confkey = 'client/html/catalog/stage';
210 210
 
211
-		if( $context->getUserId() != null || ( $html = $this->getCached( 'header', $uid, $prefixes, $confkey ) ) === null )
211
+		if ($context->getUserId() != null || ($html = $this->getCached('header', $uid, $prefixes, $confkey)) === null)
212 212
 		{
213 213
 			$view = $this->getView();
214 214
 
215 215
 			try
216 216
 			{
217
-				$view = $this->setViewParams( $view, $tags, $expire );
217
+				$view = $this->setViewParams($view, $tags, $expire);
218 218
 
219 219
 				$html = '';
220
-				foreach( $this->getSubClients() as $subclient ) {
221
-					$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
220
+				foreach ($this->getSubClients() as $subclient) {
221
+					$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
222 222
 				}
223 223
 				$view->stageHeader = $html;
224 224
 			}
225
-			catch( \Exception $e )
225
+			catch (\Exception $e)
226 226
 			{
227
-				$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
227
+				$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
228 228
 			}
229 229
 
230 230
 			/** client/html/catalog/stage/standard/template-header
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 			$tplconf = 'client/html/catalog/stage/standard/template-header';
252 252
 			$default = 'catalog/stage/header-default.php';
253 253
 
254
-			$html = $view->render( $view->config( $tplconf, $default ) );
254
+			$html = $view->render($view->config($tplconf, $default));
255 255
 
256
-			$this->setCached( 'header', $uid, $prefixes, $confkey, $html, $tags, $expire );
256
+			$this->setCached('header', $uid, $prefixes, $confkey, $html, $tags, $expire);
257 257
 		}
258 258
 		else
259 259
 		{
260
-			$html = $this->modifyHeader( $html, $uid );
260
+			$html = $this->modifyHeader($html, $uid);
261 261
 		}
262 262
 
263 263
 		return $html;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	 * @param string|null $name Name of the sub-client (Default if null)
272 272
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
273 273
 	 */
274
-	public function getSubClient( $type, $name = null )
274
+	public function getSubClient($type, $name = null)
275 275
 	{
276 276
 		/** client/html/catalog/stage/decorators/excludes
277 277
 		 * Excludes decorators added by the "common" option from the catalog stage html client
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 		 * @see client/html/catalog/stage/decorators/excludes
347 347
 		 * @see client/html/catalog/stage/decorators/global
348 348
 		 */
349
-		return $this->createSubClient( 'catalog/stage/' . $type, $name );
349
+		return $this->createSubClient('catalog/stage/'.$type, $name);
350 350
 	}
351 351
 
352 352
 
@@ -363,28 +363,28 @@  discard block
 block discarded – undo
363 363
 		{
364 364
 			parent::process();
365 365
 		}
366
-		catch( \Aimeos\Client\Html\Exception $e )
366
+		catch (\Aimeos\Client\Html\Exception $e)
367 367
 		{
368
-			$error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) );
369
-			$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
368
+			$error = array($this->getContext()->getI18n()->dt('client', $e->getMessage()));
369
+			$view->stageErrorList = $view->get('stageErrorList', array()) + $error;
370 370
 		}
371
-		catch( \Aimeos\Controller\Frontend\Exception $e )
371
+		catch (\Aimeos\Controller\Frontend\Exception $e)
372 372
 		{
373
-			$error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
374
-			$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
373
+			$error = array($this->getContext()->getI18n()->dt('controller/frontend', $e->getMessage()));
374
+			$view->stageErrorList = $view->get('stageErrorList', array()) + $error;
375 375
 		}
376
-		catch( \Aimeos\MShop\Exception $e )
376
+		catch (\Aimeos\MShop\Exception $e)
377 377
 		{
378
-			$error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
379
-			$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
378
+			$error = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
379
+			$view->stageErrorList = $view->get('stageErrorList', array()) + $error;
380 380
 		}
381
-		catch( \Exception $e )
381
+		catch (\Exception $e)
382 382
 		{
383 383
 			$context = $this->getContext();
384
-			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
384
+			$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
385 385
 
386
-			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
387
-			$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
386
+			$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
387
+			$view->stageErrorList = $view->get('stageErrorList', array()) + $error;
388 388
 		}
389 389
 	}
390 390
 
@@ -396,15 +396,15 @@  discard block
 block discarded – undo
396 396
 	 * @param array $prefixes List of prefixes the parameters must start with
397 397
 	 * @return array Associative list of parameters used by the html client
398 398
 	 */
399
-	protected function getClientParams( array $params, array $prefixes = array( 'f', 'l', 'd', 'a' ) )
399
+	protected function getClientParams(array $params, array $prefixes = array('f', 'l', 'd', 'a'))
400 400
 	{
401
-		$list = parent::getClientParams( $params, array_merge( $prefixes, array( 'l', 'd' ) ) );
401
+		$list = parent::getClientParams($params, array_merge($prefixes, array('l', 'd')));
402 402
 
403
-		if( isset( $list['l_pos'] ) && isset( $list['d_prodid'] ) )
403
+		if (isset($list['l_pos']) && isset($list['d_prodid']))
404 404
 		{
405 405
 			$context = $this->getContext();
406 406
 			$site = $context->getLocale()->getSite()->getCode();
407
-			$list += (array) $context->getSession()->get( 'aimeos/catalog/lists/params/last/' . $site, array() );
407
+			$list += (array) $context->getSession()->get('aimeos/catalog/lists/params/last/'.$site, array());
408 408
 		}
409 409
 
410 410
 		return $list;
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 	 */
419 419
 	protected function getSubClientNames()
420 420
 	{
421
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
421
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
422 422
 	}
423 423
 
424 424
 
@@ -430,26 +430,26 @@  discard block
 block discarded – undo
430 430
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
431 431
 	 * @return \Aimeos\MW\View\Iface Modified view object
432 432
 	 */
433
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
433
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
434 434
 	{
435
-		if( !isset( $this->cache ) )
435
+		if (!isset($this->cache))
436 436
 		{
437
-			$params = $this->getClientParams( $view->param(), array( 'f' ) );
437
+			$params = $this->getClientParams($view->param(), array('f'));
438 438
 
439
-			if( isset( $params['f_catid'] ) && $params['f_catid'] != '' )
439
+			if (isset($params['f_catid']) && $params['f_catid'] != '')
440 440
 			{
441 441
 				$context = $this->getContext();
442 442
 				$config = $context->getConfig();
443
-				$controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' );
443
+				$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog');
444 444
 
445
-				$default = array( 'attribute', 'media', 'text' );
445
+				$default = array('attribute', 'media', 'text');
446 446
 
447 447
 				/** client/html/catalog/domains
448 448
 				 * A list of domain names whose items should be available in the catalog view templates
449 449
 				 *
450 450
 				 * @see client/html/catalog/stage/domains
451 451
 				 */
452
-				$domains = $config->get( 'client/html/catalog/domains', $default );
452
+				$domains = $config->get('client/html/catalog/domains', $default);
453 453
 
454 454
 				/** client/html/catalog/stage/standard/domains
455 455
 				 * A list of domain names whose items should be available in the catalog stage view template
@@ -472,15 +472,15 @@  discard block
 block discarded – undo
472 472
 				 * @see client/html/catalog/detail/domains
473 473
 				 * @see client/html/catalog/lists/domains
474 474
 				 */
475
-				$domains = $config->get( 'client/html/catalog/stage/standard/domains', $domains );
476
-				$stageCatPath = $controller->getCatalogPath( $params['f_catid'], $domains );
475
+				$domains = $config->get('client/html/catalog/stage/standard/domains', $domains);
476
+				$stageCatPath = $controller->getCatalogPath($params['f_catid'], $domains);
477 477
 
478
-				if( ( $categoryItem = end( $stageCatPath ) ) !== false ) {
478
+				if (($categoryItem = end($stageCatPath)) !== false) {
479 479
 					$view->stageCurrentCatItem = $categoryItem;
480 480
 				}
481 481
 
482
-				$this->addMetaItem( $stageCatPath, 'catalog', $this->expire, $this->tags );
483
-				$this->addMetaList( array_keys( $stageCatPath ), 'catalog', $this->expire );
482
+				$this->addMetaItem($stageCatPath, 'catalog', $this->expire, $this->tags);
483
+				$this->addMetaList(array_keys($stageCatPath), 'catalog', $this->expire);
484 484
 
485 485
 				$view->stageCatPath = $stageCatPath;
486 486
 			}
@@ -490,8 +490,8 @@  discard block
 block discarded – undo
490 490
 			$this->cache = $view;
491 491
 		}
492 492
 
493
-		$expire = $this->expires( $this->expire, $expire );
494
-		$tags = array_merge( $tags, $this->tags );
493
+		$expire = $this->expires($this->expire, $expire);
494
+		$tags = array_merge($tags, $this->tags);
495 495
 
496 496
 		return $this->cache;
497 497
 	}
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Stage/Image/Standard.php 1 patch
Spacing   +19 added lines, -19 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->imageBody = $html;
80 80
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$tplconf = 'client/html/catalog/stage/image/standard/template-body';
102 102
 		$default = 'catalog/stage/image-body-default.php';
103 103
 
104
-		return $view->render( $view->config( $tplconf, $default ) );
104
+		return $view->render($view->config($tplconf, $default));
105 105
 	}
106 106
 
107 107
 
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
114 114
 	 * @return string|null String including HTML tags for the header on error
115 115
 	 */
116
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
116
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
117 117
 	{
118
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
118
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
119 119
 
120 120
 		$html = '';
121
-		foreach( $this->getSubClients() as $subclient ) {
122
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
121
+		foreach ($this->getSubClients() as $subclient) {
122
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
123 123
 		}
124 124
 		$view->imageHeader = $html;
125 125
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		$tplconf = 'client/html/catalog/stage/image/standard/template-header';
148 148
 		$default = 'catalog/stage/image-header-default.php';
149 149
 
150
-		return $view->render( $view->config( $tplconf, $default ) );
150
+		return $view->render($view->config($tplconf, $default));
151 151
 	}
152 152
 
153 153
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @param string|null $name Name of the sub-client (Default if null)
159 159
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
160 160
 	 */
161
-	public function getSubClient( $type, $name = null )
161
+	public function getSubClient($type, $name = null)
162 162
 	{
163 163
 		/** client/html/catalog/stage/image/decorators/excludes
164 164
 		 * Excludes decorators added by the "common" option from the catalog stage image html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/catalog/stage/image/decorators/excludes
234 234
 		 * @see client/html/catalog/stage/image/decorators/global
235 235
 		 */
236
-		return $this->createSubClient( 'catalog/stage/image/' . $type, $name );
236
+		return $this->createSubClient('catalog/stage/image/'.$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,18 +256,18 @@  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 263
 			$mediaItems = array();
264
-			$catPath = $view->get( 'stageCatPath', array() );
264
+			$catPath = $view->get('stageCatPath', array());
265 265
 
266
-			foreach( array_reverse( $catPath ) as $catItem )
266
+			foreach (array_reverse($catPath) as $catItem)
267 267
 			{
268
-				$mediaItems = $catItem->getRefItems( 'media', 'default', 'stage' );
268
+				$mediaItems = $catItem->getRefItems('media', 'default', 'stage');
269 269
 
270
-				if( !empty( $mediaItems ) ) {
270
+				if (!empty($mediaItems)) {
271 271
 					break;
272 272
 				}
273 273
 			}
Please login to merge, or discard this patch.