Completed
Push — master ( d9c87d...d2fca1 )
by Aimeos
06:49
created
client/html/src/Client/Html/Catalog/Stock/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/stock/name
37 37
 		 * Class name of the used catalog stock 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/stock/name', 'Standard' );
69
+		if ($name === null) {
70
+			$name = $context->getConfig()->get('client/html/catalog/stock/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\\Stock\\' . $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\\Stock\\'.$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\\Stock\\' . $name;
80
+		$classname = '\\Aimeos\\Client\\Html\\Catalog\\Stock\\'.$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/stock' );
84
+		return self::addClientDecorators($context, $client, $templatePaths, 'catalog/stock');
85 85
 	}
86 86
 }
87 87
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Stock/Standard.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -68,15 +68,15 @@  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 73
 		try
74 74
 		{
75
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
75
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
76 76
 
77 77
 			$html = '';
78
-			foreach( $this->getSubClients() as $subclient ) {
79
-				$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
+			foreach ($this->getSubClients() as $subclient) {
79
+				$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
80 80
 			}
81 81
 			$view->stockBody = $html;
82 82
 
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
 			$tplconf = 'client/html/catalog/stock/standard/template-body';
104 104
 			$default = 'catalog/stock/body-default.php';
105 105
 
106
-			return $view->render( $view->config( $tplconf, $default ) );
106
+			return $view->render($view->config($tplconf, $default));
107 107
 		}
108
-		catch( \Exception $e )
108
+		catch (\Exception $e)
109 109
 		{
110
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
110
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
111 111
 		}
112 112
 	}
113 113
 
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
121 121
 	 * @return string|null String including HTML tags for the header on error
122 122
 	 */
123
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
123
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
124 124
 	{
125 125
 		try
126 126
 		{
127
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
127
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
128 128
 
129 129
 			$html = '';
130
-			foreach( $this->getSubClients() as $subclient ) {
131
-				$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
130
+			foreach ($this->getSubClients() as $subclient) {
131
+				$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
132 132
 			}
133 133
 			$view->stockHeader = $html;
134 134
 
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
 			$tplconf = 'client/html/catalog/stock/standard/template-header';
157 157
 			$default = 'catalog/stock/header-default.php';
158 158
 
159
-			return $view->render( $view->config( $tplconf, $default ) );
159
+			return $view->render($view->config($tplconf, $default));
160 160
 		}
161
-		catch( \Exception $e )
161
+		catch (\Exception $e)
162 162
 		{
163
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
163
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
164 164
 		}
165 165
 	}
166 166
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 * @param string|null $name Name of the sub-client (Default if null)
173 173
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
174 174
 	 */
175
-	public function getSubClient( $type, $name = null )
175
+	public function getSubClient($type, $name = null)
176 176
 	{
177 177
 		/** client/html/catalog/stock/decorators/excludes
178 178
 		 * Excludes decorators added by the "common" option from the catalog stock html client
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		 * @see client/html/catalog/stock/decorators/global
249 249
 		 */
250 250
 
251
-		return $this->createSubClient( 'catalog/stock/' . $type, $name );
251
+		return $this->createSubClient('catalog/stock/'.$type, $name);
252 252
 	}
253 253
 
254 254
 
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 		{
264 264
 			parent::process();
265 265
 		}
266
-		catch( \Exception $e )
266
+		catch (\Exception $e)
267 267
 		{
268
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
268
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
269 269
 		}
270 270
 	}
271 271
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	 */
278 278
 	protected function getSubClientNames()
279 279
 	{
280
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
280
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
281 281
 	}
282 282
 
283 283
 
@@ -289,9 +289,9 @@  discard block
 block discarded – undo
289 289
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
290 290
 	 * @return \Aimeos\MW\View\Iface Modified view object
291 291
 	 */
292
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
292
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
293 293
 	{
294
-		if( !isset( $this->cache ) )
294
+		if (!isset($this->cache))
295 295
 		{
296 296
 			$context = $this->getContext();
297 297
 			$siteConfig = $context->getLocale()->getSite()->getConfig();
@@ -310,58 +310,58 @@  discard block
 block discarded – undo
310 310
 			 * @category Developer
311 311
 			 * @see client/html/catalog/stock/level/low
312 312
 			 */
313
-			$sortkey = $context->getConfig()->get( 'client/html/catalog/stock/sort', 'product.stock.warehouseid' );
314
-			$productIds = $view->param( 's_prodid' );
313
+			$sortkey = $context->getConfig()->get('client/html/catalog/stock/sort', 'product.stock.warehouseid');
314
+			$productIds = $view->param('s_prodid');
315 315
 
316
-			if( !is_array( $productIds ) ) {
317
-				$productIds = explode( ' ', $productIds );
316
+			if (!is_array($productIds)) {
317
+				$productIds = explode(' ', $productIds);
318 318
 			}
319 319
 
320 320
 
321
-			$stockManager = \Aimeos\MShop\Factory::createManager( $context, 'product/stock' );
321
+			$stockManager = \Aimeos\MShop\Factory::createManager($context, 'product/stock');
322 322
 
323
-			$search = $stockManager->createSearch( true );
324
-			$expr = array( $search->compare( '==', 'product.stock.parentid', $productIds ) );
323
+			$search = $stockManager->createSearch(true);
324
+			$expr = array($search->compare('==', 'product.stock.parentid', $productIds));
325 325
 
326
-			if( isset( $siteConfig['warehouse'] ) ) {
327
-				$expr[] = $search->compare( '==', 'product.stock.warehouse.code', $siteConfig['warehouse'] );
326
+			if (isset($siteConfig['warehouse'])) {
327
+				$expr[] = $search->compare('==', 'product.stock.warehouse.code', $siteConfig['warehouse']);
328 328
 			}
329 329
 
330 330
 			$expr[] = $search->getConditions();
331 331
 
332 332
 			$sortations = array(
333
-				$search->sort( '+', 'product.stock.parentid' ),
334
-				$search->sort( '+', $sortkey ),
333
+				$search->sort('+', 'product.stock.parentid'),
334
+				$search->sort('+', $sortkey),
335 335
 			);
336 336
 
337
-			$search->setConditions( $search->combine( '&&', $expr ) );
338
-			$search->setSortations( $sortations );
339
-			$search->setSlice( 0, 0x7fffffff );
337
+			$search->setConditions($search->combine('&&', $expr));
338
+			$search->setSortations($sortations);
339
+			$search->setSlice(0, 0x7fffffff);
340 340
 
341
-			$stockItems = $stockManager->searchItems( $search );
341
+			$stockItems = $stockManager->searchItems($search);
342 342
 
343 343
 
344
-			if( !empty( $stockItems ) )
344
+			if (!empty($stockItems))
345 345
 			{
346 346
 				$warehouseIds = $stockItemsByProducts = array();
347 347
 
348
-				foreach( $stockItems as $item )
348
+				foreach ($stockItems as $item)
349 349
 				{
350 350
 					$warehouseIds[$item->getWarehouseId()] = null;
351 351
 					$stockItemsByProducts[$item->getParentId()][] = $item;
352 352
 				}
353 353
 
354
-				$warehouseIds = array_keys( $warehouseIds );
354
+				$warehouseIds = array_keys($warehouseIds);
355 355
 
356 356
 
357
-				$warehouseManager = \Aimeos\MShop\Factory::createManager( $context, 'product/stock/warehouse' );
357
+				$warehouseManager = \Aimeos\MShop\Factory::createManager($context, 'product/stock/warehouse');
358 358
 
359 359
 				$search = $warehouseManager->createSearch();
360
-				$search->setConditions( $search->compare( '==', 'product.stock.warehouse.id', $warehouseIds ) );
361
-				$search->setSlice( 0, count( $warehouseIds ) );
360
+				$search->setConditions($search->compare('==', 'product.stock.warehouse.id', $warehouseIds));
361
+				$search->setSlice(0, count($warehouseIds));
362 362
 
363 363
 
364
-				$view->stockWarehouseItems = $warehouseManager->searchItems( $search );
364
+				$view->stockWarehouseItems = $warehouseManager->searchItems($search);
365 365
 				$view->stockItemsByProducts = $stockItemsByProducts;
366 366
 			}
367 367
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Count/Attribute/Standard.php 1 patch
Spacing   +21 added lines, -21 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->attributeBody = $html;
80 80
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$tplconf = 'client/html/catalog/count/attribute/standard/template-body';
102 102
 		$default = 'catalog/count/attribute-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->attributeHeader = $html;
125 125
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		$tplconf = 'client/html/catalog/count/attribute/standard/template-header';
148 148
 		$default = 'catalog/count/attribute-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/count/attribute/decorators/excludes
164 164
 		 * Excludes decorators added by the "common" option from the catalog count attribute html client
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		 * @see client/html/catalog/count/attribute/decorators/global
235 235
 		 */
236 236
 
237
-		return $this->createSubClient( 'catalog/count/attribute/' . $type, $name );
237
+		return $this->createSubClient('catalog/count/attribute/'.$type, $name);
238 238
 	}
239 239
 
240 240
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 */
246 246
 	protected function getSubClientNames()
247 247
 	{
248
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
248
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
249 249
 	}
250 250
 
251 251
 
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
258 258
 	 * @return \Aimeos\MW\View\Iface Modified view object
259 259
 	 */
260
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
260
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
261 261
 	{
262
-		if( !isset( $this->cache ) )
262
+		if (!isset($this->cache))
263 263
 		{
264 264
 			$context = $this->getContext();
265 265
 			$config = $context->getConfig();
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			 * @category Developer
277 277
 			 * @category User
278 278
 			 */
279
-			if( $config->get( 'client/html/catalog/count/attribute/aggregate', true ) == true )
279
+			if ($config->get('client/html/catalog/count/attribute/aggregate', true) == true)
280 280
 			{
281 281
 				/** client/html/catalog/count/limit
282 282
 				 * Limits the number of records that are used for product counts in the catalog filter
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 				 * @category Developer
302 302
 				 * @category User
303 303
 				 */
304
-				$filter = $this->getProductListFilter( $view );
305
-				$filter->setSlice( 0, $config->get( 'client/html/catalog/count/limit', 10000 ) );
306
-				$filter->setSortations( array() ); // it's not necessary and slows down the query
304
+				$filter = $this->getProductListFilter($view);
305
+				$filter->setSlice(0, $config->get('client/html/catalog/count/limit', 10000));
306
+				$filter->setSortations(array()); // it's not necessary and slows down the query
307 307
 
308
-				$controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' );
309
-				$view->attributeCountList = $controller->aggregateIndex( $filter, 'index.attribute.id' );
308
+				$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog');
309
+				$view->attributeCountList = $controller->aggregateIndex($filter, 'index.attribute.id');
310 310
 			}
311 311
 
312 312
 			$this->cache = $view;
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Count/Tree/Standard.php 1 patch
Spacing   +21 added lines, -21 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->treeBody = $html;
80 80
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$tplconf = 'client/html/catalog/count/tree/standard/template-body';
102 102
 		$default = 'catalog/count/tree-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->treeHeader = $html;
125 125
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		$tplconf = 'client/html/catalog/count/tree/standard/template-header';
148 148
 		$default = 'catalog/count/tree-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/count/tree/decorators/excludes
164 164
 		 * Excludes decorators added by the "common" option from the catalog count tree html client
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		 * @see client/html/catalog/count/tree/decorators/global
235 235
 		 */
236 236
 
237
-		return $this->createSubClient( 'catalog/count/tree/' . $type, $name );
237
+		return $this->createSubClient('catalog/count/tree/'.$type, $name);
238 238
 	}
239 239
 
240 240
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 */
246 246
 	protected function getSubClientNames()
247 247
 	{
248
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
248
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
249 249
 	}
250 250
 
251 251
 
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
258 258
 	 * @return \Aimeos\MW\View\Iface Modified view object
259 259
 	 */
260
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
260
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
261 261
 	{
262
-		if( !isset( $this->cache ) )
262
+		if (!isset($this->cache))
263 263
 		{
264 264
 			$context = $this->getContext();
265 265
 			$config = $context->getConfig();
@@ -274,17 +274,17 @@  discard block
 block discarded – undo
274 274
 			 * @since 2014.03
275 275
 			 * @see client/html/catalog/count/limit
276 276
 			 */
277
-			if( $config->get( 'client/html/catalog/count/tree/aggregate', true ) == true )
277
+			if ($config->get('client/html/catalog/count/tree/aggregate', true) == true)
278 278
 			{
279 279
 				/** client/html/catalog/count/limit
280 280
 				 * @see client/html/catalog/count/tree/aggregate
281 281
 				 */
282
-				$filter = $this->getProductListFilter( $view, false );
283
-				$filter->setSlice( 0, $config->get( 'client/html/catalog/count/limit', 10000 ) );
284
-				$filter->setSortations( array() ); // it's not necessary and slows down the query
282
+				$filter = $this->getProductListFilter($view, false);
283
+				$filter->setSlice(0, $config->get('client/html/catalog/count/limit', 10000));
284
+				$filter->setSortations(array()); // it's not necessary and slows down the query
285 285
 
286
-				$controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' );
287
-				$view->treeCountList = $controller->aggregateIndex( $filter, 'index.catalog.id' );
286
+				$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog');
287
+				$view->treeCountList = $controller->aggregateIndex($filter, 'index.catalog.id');
288 288
 			}
289 289
 
290 290
 			$this->cache = $view;
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Count/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 Count 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/count/name
37 37
 		 * Class name of the used catalog count 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/count/name', 'Standard' );
69
+		if ($name === null) {
70
+			$name = $context->getConfig()->get('client/html/catalog/count/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\\Count\\' . $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\\Count\\'.$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\\Count\\' . $name;
80
+		$classname = '\\Aimeos\\Client\\Html\\Catalog\\Count\\'.$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/count' );
84
+		return self::addClientDecorators($context, $client, $templatePaths, 'catalog/count');
85 85
 	}
86 86
 
87 87
 }
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Count/Standard.php 1 patch
Spacing   +20 added lines, -20 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( 'tree', 'attribute' );
81
+	private $subPartNames = array('tree', 'attribute');
82 82
 
83 83
 
84 84
 	/**
@@ -89,15 +89,15 @@  discard block
 block discarded – undo
89 89
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
90 90
 	 * @return string HTML code
91 91
 	 */
92
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
92
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
93 93
 	{
94 94
 		try
95 95
 		{
96
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
96
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
97 97
 
98 98
 			$html = '';
99
-			foreach( $this->getSubClients() as $subclient ) {
100
-				$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
99
+			foreach ($this->getSubClients() as $subclient) {
100
+				$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
101 101
 			}
102 102
 			$view->countBody = $html;
103 103
 
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 			$tplconf = 'client/html/catalog/count/standard/template-body';
125 125
 			$default = 'catalog/count/body-default.php';
126 126
 
127
-			return $view->render( $view->config( $tplconf, $default ) );
127
+			return $view->render($view->config($tplconf, $default));
128 128
 		}
129
-		catch( \Exception $e )
129
+		catch (\Exception $e)
130 130
 		{
131
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
131
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
132 132
 		}
133 133
 	}
134 134
 
@@ -141,15 +141,15 @@  discard block
 block discarded – undo
141 141
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
142 142
 	 * @return string|null String including HTML tags for the header on error
143 143
 	 */
144
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
144
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
145 145
 	{
146 146
 		try
147 147
 		{
148
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
148
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
149 149
 
150 150
 			$html = '';
151
-			foreach( $this->getSubClients() as $subclient ) {
152
-				$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
151
+			foreach ($this->getSubClients() as $subclient) {
152
+				$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
153 153
 			}
154 154
 			$view->countHeader = $html;
155 155
 
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
 			$tplconf = 'client/html/catalog/count/standard/template-header';
178 178
 			$default = 'catalog/count/header-default.php';
179 179
 
180
-			return $view->render( $view->config( $tplconf, $default ) );
180
+			return $view->render($view->config($tplconf, $default));
181 181
 		}
182
-		catch( \Exception $e )
182
+		catch (\Exception $e)
183 183
 		{
184
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
184
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
185 185
 		}
186 186
 	}
187 187
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 * @param string|null $name Name of the sub-client (Default if null)
194 194
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
195 195
 	 */
196
-	public function getSubClient( $type, $name = null )
196
+	public function getSubClient($type, $name = null)
197 197
 	{
198 198
 		/** client/html/catalog/count/decorators/excludes
199 199
 		 * Excludes decorators added by the "common" option from the catalog count html client
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		 * @see client/html/catalog/count/decorators/global
270 270
 		 */
271 271
 
272
-		return $this->createSubClient( 'catalog/count/' . $type, $name );
272
+		return $this->createSubClient('catalog/count/'.$type, $name);
273 273
 	}
274 274
 
275 275
 
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
 		{
285 285
 			parent::process();
286 286
 		}
287
-		catch( \Exception $e )
287
+		catch (\Exception $e)
288 288
 		{
289
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
289
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
290 290
 		}
291 291
 	}
292 292
 
@@ -298,6 +298,6 @@  discard block
 block discarded – undo
298 298
 	 */
299 299
 	protected function getSubClientNames()
300 300
 	{
301
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
301
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
302 302
 	}
303 303
 }
304 304
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Suggest/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/suggest/name
37 37
 		 * Class name of the used catalog suggest client implementation
@@ -66,22 +66,22 @@  discard block
 block discarded – undo
66 66
 		 * @since 2015.02
67 67
 		 * @category Developer
68 68
 		 */
69
-		if( $name === null ) {
70
-			$name = $context->getConfig()->get( 'client/html/catalog/suggest/name', 'Standard' );
69
+		if ($name === null) {
70
+			$name = $context->getConfig()->get('client/html/catalog/suggest/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\\Suggest\\' . $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\\Suggest\\'.$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\\Suggest\\' . $name;
80
+		$classname = '\\Aimeos\\Client\\Html\\Catalog\\Suggest\\'.$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/suggest' );
84
+		return self::addClientDecorators($context, $client, $templatePaths, 'catalog/suggest');
85 85
 	}
86 86
 }
87 87
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Suggest/Standard.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -72,21 +72,21 @@  discard block
 block discarded – undo
72 72
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
73 73
 	 * @return string HTML code
74 74
 	 */
75
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
75
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
76 76
 	{
77 77
 		try
78 78
 		{
79
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
79
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
80 80
 
81 81
 			$html = '';
82
-			foreach( $this->getSubClients() as $subclient ) {
83
-				$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
82
+			foreach ($this->getSubClients() as $subclient) {
83
+				$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
84 84
 			}
85 85
 			$view->suggestBody = $html;
86 86
 		}
87
-		catch( \Exception $e )
87
+		catch (\Exception $e)
88 88
 		{
89
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
89
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
90 90
 			return;
91 91
 		}
92 92
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		$tplconf = 'client/html/catalog/suggest/standard/template-body';
117 117
 		$default = 'catalog/suggest/body-default.php';
118 118
 
119
-		return $view->render( $view->config( $tplconf, $default ) );
119
+		return $view->render($view->config($tplconf, $default));
120 120
 	}
121 121
 
122 122
 
@@ -128,21 +128,21 @@  discard block
 block discarded – undo
128 128
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
129 129
 	 * @return string|null String including HTML tags for the header on error
130 130
 	 */
131
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
131
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
132 132
 	{
133 133
 		try
134 134
 		{
135
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
135
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
136 136
 
137 137
 			$html = '';
138
-			foreach( $this->getSubClients() as $subclient ) {
139
-				$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
138
+			foreach ($this->getSubClients() as $subclient) {
139
+				$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
140 140
 			}
141 141
 			$view->suggestHeader = $html;
142 142
 		}
143
-		catch( \Exception $e )
143
+		catch (\Exception $e)
144 144
 		{
145
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
145
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
146 146
 			return;
147 147
 		}
148 148
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		$tplconf = 'client/html/catalog/suggest/standard/template-header';
174 174
 		$default = 'catalog/suggest/header-default.php';
175 175
 
176
-		return $view->render( $view->config( $tplconf, $default ) );
176
+		return $view->render($view->config($tplconf, $default));
177 177
 	}
178 178
 
179 179
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 * @param string|null $name Name of the sub-client (Default if null)
185 185
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
186 186
 	 */
187
-	public function getSubClient( $type, $name = null )
187
+	public function getSubClient($type, $name = null)
188 188
 	{
189 189
 		/** client/html/catalog/suggest/decorators/excludes
190 190
 		 * Excludes decorators added by the "common" option from the catalog suggest html client
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 		 * @see client/html/catalog/suggest/decorators/global
261 261
 		 */
262 262
 
263
-		return $this->createSubClient( 'catalog/suggest/' . $type, $name );
263
+		return $this->createSubClient('catalog/suggest/'.$type, $name);
264 264
 	}
265 265
 
266 266
 
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
 		{
276 276
 			parent::process();
277 277
 		}
278
-		catch( \Exception $e )
278
+		catch (\Exception $e)
279 279
 		{
280
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
280
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
281 281
 		}
282 282
 	}
283 283
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	 */
290 290
 	protected function getSubClientNames()
291 291
 	{
292
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
292
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
293 293
 	}
294 294
 
295 295
 
@@ -301,20 +301,20 @@  discard block
 block discarded – undo
301 301
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
302 302
 	 * @return \Aimeos\MW\View\Iface Modified view object
303 303
 	 */
304
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
304
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
305 305
 	{
306
-		if( !isset( $this->cache ) )
306
+		if (!isset($this->cache))
307 307
 		{
308
-			$input = $view->param( 'f_search' );
308
+			$input = $view->param('f_search');
309 309
 
310
-			$controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'catalog' );
310
+			$controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'catalog');
311 311
 
312
-			$filter = $controller->createTextFilter( $input );
313
-			$items = $controller->getTextList( $filter );
312
+			$filter = $controller->createTextFilter($input);
313
+			$items = $controller->getTextList($filter);
314 314
 
315 315
 			$suggestTextItems = array();
316
-			foreach( $items as $id => $name ) {
317
-				$suggestTextItems[] = array( "id" => $id, "name" => $name );
316
+			foreach ($items as $id => $name) {
317
+				$suggestTextItems[] = array("id" => $id, "name" => $name);
318 318
 			}
319 319
 
320 320
 			$view->suggestTextItems = $suggestTextItems;
Please login to merge, or discard this patch.
client/html/src/Client/Html/Catalog/Filter/Attribute/Standard.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
71 71
 	 * @return string HTML code
72 72
 	 */
73
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
73
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
74 74
 	{
75
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
75
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
76 76
 
77 77
 		$html = '';
78
-		foreach( $this->getSubClients() as $subclient ) {
79
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
+		foreach ($this->getSubClients() as $subclient) {
79
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
80 80
 		}
81 81
 		$view->attributeBody = $html;
82 82
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		$tplconf = 'client/html/catalog/filter/attribute/standard/template-body';
104 104
 		$default = 'catalog/filter/attribute-body-default.php';
105 105
 
106
-		return $view->render( $view->config( $tplconf, $default ) );
106
+		return $view->render($view->config($tplconf, $default));
107 107
 	}
108 108
 
109 109
 
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
116 116
 	 * @return string|null String including HTML tags for the header on error
117 117
 	 */
118
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
119 119
 	{
120
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
120
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
121 121
 
122 122
 		$html = '';
123
-		foreach( $this->getSubClients() as $subclient ) {
124
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
123
+		foreach ($this->getSubClients() as $subclient) {
124
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
125 125
 		}
126 126
 		$view->attributeHeader = $html;
127 127
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		$tplconf = 'client/html/catalog/filter/attribute/standard/template-header';
150 150
 		$default = 'catalog/filter/attribute-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/catalog/filter/attribute/decorators/excludes
166 166
 		 * Excludes decorators added by the "common" option from the catalog filter attribute html client
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		 * @see client/html/catalog/filter/attribute/decorators/global
237 237
 		 */
238 238
 
239
-		return $this->createSubClient( 'catalog/filter/attribute/' . $type, $name );
239
+		return $this->createSubClient('catalog/filter/attribute/'.$type, $name);
240 240
 	}
241 241
 
242 242
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	protected function getSubClientNames()
249 249
 	{
250
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
250
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
251 251
 	}
252 252
 
253 253
 
@@ -259,12 +259,12 @@  discard block
 block discarded – undo
259 259
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260 260
 	 * @return \Aimeos\MW\View\Iface Modified view object
261 261
 	 */
262
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
262
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
263 263
 	{
264
-		if( !isset( $this->cache ) )
264
+		if (!isset($this->cache))
265 265
 		{
266 266
 			$attrMap = array();
267
-			$controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'catalog' );
267
+			$controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'catalog');
268 268
 
269 269
 			/** client/html/catalog/filter/attribute/types
270 270
 			 * List of attribute types that should be displayed in this order in the catalog filter
@@ -286,24 +286,24 @@  discard block
 block discarded – undo
286 286
 			 * @category Developer
287 287
 			 * @see client/html/catalog/filter/attribute/domains
288 288
 			 */
289
-			$attrTypes = $view->config( 'client/html/catalog/filter/attribute/types', array() );
289
+			$attrTypes = $view->config('client/html/catalog/filter/attribute/types', array());
290 290
 
291
-			$manager = $controller->createManager( 'attribute' );
292
-			$search = $manager->createSearch( true );
291
+			$manager = $controller->createManager('attribute');
292
+			$search = $manager->createSearch(true);
293 293
 
294 294
 			$expr = array();
295
-			if( !empty( $attrTypes ) ) {
296
-				$expr[] = $search->compare( '==', 'attribute.type.code', $attrTypes );
295
+			if (!empty($attrTypes)) {
296
+				$expr[] = $search->compare('==', 'attribute.type.code', $attrTypes);
297 297
 			}
298 298
 
299
-			$expr[] = $search->compare( '==', 'attribute.domain', 'product' );
299
+			$expr[] = $search->compare('==', 'attribute.domain', 'product');
300 300
 			$expr[] = $search->getConditions();
301 301
 
302
-			$sort = array( $search->sort( '+', 'attribute.position' ) );
302
+			$sort = array($search->sort('+', 'attribute.position'));
303 303
 
304
-			$search->setConditions( $search->combine( '&&', $expr ) );
305
-			$search->setSortations( $sort );
306
-			$search->setSlice( 0, 0x7fffffff );
304
+			$search->setConditions($search->combine('&&', $expr));
305
+			$search->setSortations($sort);
306
+			$search->setSlice(0, 0x7fffffff);
307 307
 
308 308
 			/** client/html/catalog/filter/attribute/domains
309 309
 			 * List of domain names whose items should be fetched with the filter attributes
@@ -321,21 +321,21 @@  discard block
 block discarded – undo
321 321
 			 * @category Developer
322 322
 			 * @see client/html/catalog/filter/attribute/types
323 323
 			 */
324
-			$domains = $view->config( 'client/html/catalog/filter/attribute/domains', array( 'text', 'media' ) );
324
+			$domains = $view->config('client/html/catalog/filter/attribute/domains', array('text', 'media'));
325 325
 
326
-			$attributes = $manager->searchItems( $search, $domains );
326
+			$attributes = $manager->searchItems($search, $domains);
327 327
 
328
-			foreach( $attributes as $id => $item ) {
328
+			foreach ($attributes as $id => $item) {
329 329
 				$attrMap[$item->getType()][$id] = $item;
330 330
 			}
331 331
 
332
-			if( !empty( $attrTypes ) )
332
+			if (!empty($attrTypes))
333 333
 			{
334 334
 				$sortedMap = array();
335 335
 
336
-				foreach( $attrTypes as $type )
336
+				foreach ($attrTypes as $type)
337 337
 				{
338
-					if( isset( $attrMap[$type] ) ) {
338
+					if (isset($attrMap[$type])) {
339 339
 						$sortedMap[$type] = $attrMap[$type];
340 340
 					}
341 341
 				}
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
 			}
345 345
 			else
346 346
 			{
347
-				ksort( $attrMap );
347
+				ksort($attrMap);
348 348
 			}
349 349
 
350
-			$this->addMetaItem( $attributes, 'attribute', $this->expire, $this->tags );
351
-			$this->addMetaList( array_keys( $attributes ), 'attribute', $this->expire );
350
+			$this->addMetaItem($attributes, 'attribute', $this->expire, $this->tags);
351
+			$this->addMetaList(array_keys($attributes), 'attribute', $this->expire);
352 352
 
353 353
 			// Delete cache when attributes are added or deleted even in "tag-all" mode
354 354
 			$this->tags[] = 'attribute';
@@ -359,8 +359,8 @@  discard block
 block discarded – undo
359 359
 			$this->cache = $view;
360 360
 		}
361 361
 
362
-		$expire = $this->expires( $this->expire, $expire );
363
-		$tags = array_merge( $tags, $this->tags );
362
+		$expire = $this->expires($this->expire, $expire);
363
+		$tags = array_merge($tags, $this->tags);
364 364
 
365 365
 		return $this->cache;
366 366
 	}
Please login to merge, or discard this patch.