Completed
Push — master ( 038e21...b18d9c )
by Aimeos
03:53
created
controller/frontend/src/Controller/Frontend/Product/Standard.php 2 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * Returns the given search filter with the conditions attached for filtering by suppliers.
128 128
 	 *
129 129
 	 * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search
130
-	 * @param array $supIds List of supplier IDs for faceted search
130
+	 * @param integer[] $supIds List of supplier IDs for faceted search
131 131
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
132 132
 	 * @since 2018.07
133 133
 	 */
@@ -338,6 +338,7 @@  discard block
 block discarded – undo
338 338
 	 * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions
339 339
 	 * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too
340 340
 	 * @param integer &$total Parameter where the total number of found products will be stored in
341
+	 * @param integer $total
341 342
 	 * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface
342 343
 	 * @since 2017.03
343 344
 	 */
@@ -351,7 +352,7 @@  discard block
 block discarded – undo
351 352
 	 * Returns the list of catalog IDs for the given catalog tree
352 353
 	 *
353 354
 	 * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item with children
354
-	 * @return array List of catalog IDs
355
+	 * @return string[] List of catalog IDs
355 356
 	 */
356 357
 	protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item )
357 358
 	{
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -31,42 +31,42 @@  discard block
 block discarded – undo
31 31
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
32 32
 	 * @since 2017.03
33 33
 	 */
34
-	public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds )
34
+	public function addFilterAttribute(\Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds)
35 35
 	{
36
-		if( !empty( $attrIds ) )
36
+		if (!empty($attrIds))
37 37
 		{
38
-			$attrIds = $this->validateIds( $attrIds );
38
+			$attrIds = $this->validateIds($attrIds);
39 39
 
40
-			$func = $filter->createFunction( 'index.attributeaggregate', array( $attrIds ) );
40
+			$func = $filter->createFunction('index.attributeaggregate', array($attrIds));
41 41
 			$expr = array(
42
-				$filter->compare( '==', $func, count( $attrIds ) ),
42
+				$filter->compare('==', $func, count($attrIds)),
43 43
 				$filter->getConditions(),
44 44
 			);
45
-			$filter->setConditions( $filter->combine( '&&', $expr ) );
45
+			$filter->setConditions($filter->combine('&&', $expr));
46 46
 		}
47 47
 
48
-		if( !empty( $optIds ) )
48
+		if (!empty($optIds))
49 49
 		{
50
-			$optIds = $this->validateIds( $optIds );
50
+			$optIds = $this->validateIds($optIds);
51 51
 
52
-			$func = $filter->createFunction( 'index.attributeaggregate', array( $optIds ) );
52
+			$func = $filter->createFunction('index.attributeaggregate', array($optIds));
53 53
 			$expr = array(
54
-				$filter->compare( '>', $func, 0 ),
54
+				$filter->compare('>', $func, 0),
55 55
 				$filter->getConditions(),
56 56
 			);
57
-			$filter->setConditions( $filter->combine( '&&', $expr ) );
57
+			$filter->setConditions($filter->combine('&&', $expr));
58 58
 		}
59 59
 
60
-		foreach( $oneIds as $type => $list )
60
+		foreach ($oneIds as $type => $list)
61 61
 		{
62
-			if( ( $list = $this->validateIds( (array) $list ) ) !== [] )
62
+			if (($list = $this->validateIds((array) $list)) !== [])
63 63
 			{
64
-				$func = $filter->createFunction( 'index.attributeaggregate', array( $list ) );
64
+				$func = $filter->createFunction('index.attributeaggregate', array($list));
65 65
 				$expr = array(
66
-					$filter->compare( '>', $func, 0 ),
66
+					$filter->compare('>', $func, 0),
67 67
 					$filter->getConditions(),
68 68
 				);
69
-				$filter->setConditions( $filter->combine( '&&', $expr ) );
69
+				$filter->setConditions($filter->combine('&&', $expr));
70 70
 			}
71 71
 		}
72 72
 
@@ -86,38 +86,38 @@  discard block
 block discarded – undo
86 86
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
87 87
 	 * @since 2017.03
88 88
 	 */
89
-	public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId,
90
-		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default' )
89
+	public function addFilterCategory(\Aimeos\MW\Criteria\Iface $filter, $catId,
90
+		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default')
91 91
 	{
92
-		$catIds = ( !is_array( $catId ) ? explode( ',', $catId ) : $catId );
92
+		$catIds = (!is_array($catId) ? explode(',', $catId) : $catId);
93 93
 
94
-		if( $level != \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE )
94
+		if ($level != \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE)
95 95
 		{
96 96
 			$list = [];
97
-			$cntl = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'catalog' );
97
+			$cntl = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'catalog');
98 98
 
99
-			foreach( $catIds as $catId )
99
+			foreach ($catIds as $catId)
100 100
 			{
101
-				$tree = $cntl->getTree( $catId, [], $level );
102
-				$list = array_merge( $list, $this->getCatalogIdsFromTree( $tree ) );
101
+				$tree = $cntl->getTree($catId, [], $level);
102
+				$list = array_merge($list, $this->getCatalogIdsFromTree($tree));
103 103
 			}
104 104
 
105 105
 			$catIds = $list;
106 106
 		}
107 107
 
108
-		$expr = array( $filter->compare( '==', 'index.catalog.id', array_unique( $catIds ) ) );
108
+		$expr = array($filter->compare('==', 'index.catalog.id', array_unique($catIds)));
109 109
 		$expr[] = $filter->getConditions();
110 110
 
111
-		if( $sort === 'relevance' )
111
+		if ($sort === 'relevance')
112 112
 		{
113
-			$cmpfunc = $filter->createFunction( 'index.catalog.position', array( $listtype, $catIds ) );
114
-			$expr[] = $filter->compare( '>=', $cmpfunc, 0 );
113
+			$cmpfunc = $filter->createFunction('index.catalog.position', array($listtype, $catIds));
114
+			$expr[] = $filter->compare('>=', $cmpfunc, 0);
115 115
 
116
-			$sortfunc = $filter->createFunction( 'sort:index.catalog.position', array( $listtype, $catIds ) );
117
-			$filter->setSortations( array( $filter->sort( $direction, $sortfunc ) ) );
116
+			$sortfunc = $filter->createFunction('sort:index.catalog.position', array($listtype, $catIds));
117
+			$filter->setSortations(array($filter->sort($direction, $sortfunc)));
118 118
 		}
119 119
 
120
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
120
+		$filter->setConditions($filter->combine('&&', $expr));
121 121
 
122 122
 		return $filter;
123 123
 	}
@@ -131,16 +131,16 @@  discard block
 block discarded – undo
131 131
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
132 132
 	 * @since 2018.07
133 133
 	 */
134
-	public function addFilterSupplier( \Aimeos\MW\Criteria\Iface $filter, array $supIds )
134
+	public function addFilterSupplier(\Aimeos\MW\Criteria\Iface $filter, array $supIds)
135 135
 	{
136
-		if( !empty( $supIds ) )
136
+		if (!empty($supIds))
137 137
 		{
138
-			$supIds = $this->validateIds( $supIds );
138
+			$supIds = $this->validateIds($supIds);
139 139
 			$expr = array(
140
-				$filter->compare( '==', 'index.supplier.id', $supIds ),
140
+				$filter->compare('==', 'index.supplier.id', $supIds),
141 141
 				$filter->getConditions(),
142 142
 			);
143
-			$filter->setConditions( $filter->combine( '&&', $expr ) );
143
+			$filter->setConditions($filter->combine('&&', $expr));
144 144
 		}
145 145
 
146 146
 		return $filter;
@@ -158,13 +158,13 @@  discard block
 block discarded – undo
158 158
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
159 159
 	 * @since 2017.03
160 160
 	 */
161
-	public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default' )
161
+	public function addFilterText(\Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default')
162 162
 	{
163 163
 		$langid = $this->getContext()->getLocale()->getLanguageId();
164
-		$cmpfunc = $filter->createFunction( 'index.text.relevance', array( $listtype, $langid, $input ) );
165
-		$expr = array( $filter->compare( '>', $cmpfunc, 0 ), $filter->getConditions() );
164
+		$cmpfunc = $filter->createFunction('index.text.relevance', array($listtype, $langid, $input));
165
+		$expr = array($filter->compare('>', $cmpfunc, 0), $filter->getConditions());
166 166
 
167
-		return $filter->setConditions( $filter->combine( '&&', $expr ) );
167
+		return $filter->setConditions($filter->combine('&&', $expr));
168 168
 	}
169 169
 
170 170
 
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 	 * @return array Associative list of key values as key and the product count for this key as value
177 177
 	 * @since 2017.03
178 178
 	 */
179
-	public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key )
179
+	public function aggregate(\Aimeos\MW\Criteria\Iface $filter, $key)
180 180
 	{
181
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->aggregate( $filter, $key );
181
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->aggregate($filter, $key);
182 182
 	}
183 183
 
184 184
 
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
194 194
 	 * @since 2017.03
195 195
 	 */
196
-	public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' )
196
+	public function createFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default')
197 197
 	{
198 198
 		$sortations = [];
199 199
 		$context = $this->getContext();
200
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'index' );
200
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'index');
201 201
 
202 202
 
203 203
 		/** controller/frontend/product/ignore-dates
@@ -212,55 +212,55 @@  discard block
 block discarded – undo
212 212
 		 * @since 2017.10
213 213
 		 * @category Developer
214 214
 		 */
215
-		if( $context->getConfig()->get( 'controller/frontend/product/ignore-dates', false ) )
215
+		if ($context->getConfig()->get('controller/frontend/product/ignore-dates', false))
216 216
 		{
217 217
 			$search = $manager->createSearch();
218
-			$search->setConditions( $search->compare( '>', 'product.status', 0 ) );
218
+			$search->setConditions($search->compare('>', 'product.status', 0));
219 219
 		}
220 220
 		else
221 221
 		{
222
-			$search = $manager->createSearch( true );
222
+			$search = $manager->createSearch(true);
223 223
 		}
224 224
 
225 225
 
226
-		$expr = array( $search->compare( '!=', 'index.catalog.id', null ) );
226
+		$expr = array($search->compare('!=', 'index.catalog.id', null));
227 227
 
228
-		switch( $sort )
228
+		switch ($sort)
229 229
 		{
230 230
 			case 'code':
231
-				$sortations[] = $search->sort( $direction, 'product.code' );
231
+				$sortations[] = $search->sort($direction, 'product.code');
232 232
 				break;
233 233
 
234 234
 			case 'ctime':
235
-				$sortations[] = $search->sort( $direction, 'product.ctime' );
235
+				$sortations[] = $search->sort($direction, 'product.ctime');
236 236
 				break;
237 237
 
238 238
 			case 'name':
239 239
 				$langid = $context->getLocale()->getLanguageId();
240 240
 
241
-				$cmpfunc = $search->createFunction( 'index.text.value', array( $listtype, $langid, 'name', 'product' ) );
242
-				$expr[] = $search->compare( '>=', $cmpfunc, '' );
241
+				$cmpfunc = $search->createFunction('index.text.value', array($listtype, $langid, 'name', 'product'));
242
+				$expr[] = $search->compare('>=', $cmpfunc, '');
243 243
 
244
-				$sortfunc = $search->createFunction( 'sort:index.text.value', array( $listtype, $langid, 'name' ) );
245
-				$sortations[] = $search->sort( $direction, $sortfunc );
244
+				$sortfunc = $search->createFunction('sort:index.text.value', array($listtype, $langid, 'name'));
245
+				$sortations[] = $search->sort($direction, $sortfunc);
246 246
 				break;
247 247
 
248 248
 			case 'price':
249 249
 				$currencyid = $context->getLocale()->getCurrencyId();
250 250
 
251
-				$cmpfunc = $search->createFunction( 'index.price.value', array( $listtype, $currencyid, 'default' ) );
252
-				$expr[] = $search->compare( '>=', $cmpfunc, '0.00' );
251
+				$cmpfunc = $search->createFunction('index.price.value', array($listtype, $currencyid, 'default'));
252
+				$expr[] = $search->compare('>=', $cmpfunc, '0.00');
253 253
 
254
-				$sortfunc = $search->createFunction( 'sort:index.price.value', array( $listtype, $currencyid, 'default' ) );
255
-				$sortations[] = $search->sort( $direction, $sortfunc );
254
+				$sortfunc = $search->createFunction('sort:index.price.value', array($listtype, $currencyid, 'default'));
255
+				$sortations[] = $search->sort($direction, $sortfunc);
256 256
 				break;
257 257
 		}
258 258
 
259 259
 		$expr[] = $search->getConditions();
260 260
 
261
-		$search->setConditions( $search->combine( '&&', $expr ) );
262
-		$search->setSortations( $sortations );
263
-		$search->setSlice( $start, $size );
261
+		$search->setConditions($search->combine('&&', $expr));
262
+		$search->setSortations($sortations);
263
+		$search->setSlice($start, $size);
264 264
 
265 265
 		return $search;
266 266
 	}
@@ -274,15 +274,15 @@  discard block
 block discarded – undo
274 274
 	 * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items
275 275
 	 * @since 2017.03
276 276
 	 */
277
-	public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) )
277
+	public function getItem($productId, array $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text'))
278 278
 	{
279
-		$items = $this->getItems( [$productId], $domains );
279
+		$items = $this->getItems([$productId], $domains);
280 280
 
281
-		if( ( $item = reset( $items ) ) !== false ) {
281
+		if (($item = reset($items)) !== false) {
282 282
 			return $item;
283 283
 		}
284 284
 
285
-		throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Product item with ID "%1$s" not found', $productId ) );
285
+		throw new \Aimeos\Controller\Frontend\Exception(sprintf('Product item with ID "%1$s" not found', $productId));
286 286
 	}
287 287
 
288 288
 
@@ -294,10 +294,10 @@  discard block
 block discarded – undo
294 294
 	 * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values
295 295
 	 * @since 2017.03
296 296
 	 */
297
-	public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) )
297
+	public function getItems(array $productIds, array $domains = array('media', 'price', 'text'))
298 298
 	{
299 299
 		$context = $this->getContext();
300
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
300
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
301 301
 
302 302
 		/** controller/frontend/order/ignore-dates
303 303
 		 * Ignore start and end dates of products
@@ -311,24 +311,24 @@  discard block
 block discarded – undo
311 311
 		 * @since 2017.08
312 312
 		 * @category Developer
313 313
 		 */
314
-		if( $context->getConfig()->get( 'controller/frontend/product/ignore-dates', false ) )
314
+		if ($context->getConfig()->get('controller/frontend/product/ignore-dates', false))
315 315
 		{
316 316
 			$search = $manager->createSearch();
317
-			$search->setConditions( $search->compare( '>', 'product.status', 0 ) );
317
+			$search->setConditions($search->compare('>', 'product.status', 0));
318 318
 		}
319 319
 		else
320 320
 		{
321
-			$search = $manager->createSearch( true );
321
+			$search = $manager->createSearch(true);
322 322
 		}
323 323
 
324 324
 		$expr = array(
325
-			$search->compare( '==', 'product.id', $productIds ),
325
+			$search->compare('==', 'product.id', $productIds),
326 326
 			$search->getConditions(),
327 327
 		);
328
-		$search->setConditions( $search->combine( '&&', $expr ) );
329
-		$search->setSlice( 0, count( $productIds ) );
328
+		$search->setConditions($search->combine('&&', $expr));
329
+		$search->setSlice(0, count($productIds));
330 330
 
331
-		return $manager->searchItems( $search, $domains );
331
+		return $manager->searchItems($search, $domains);
332 332
 	}
333 333
 
334 334
 
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
 	 * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface
342 342
 	 * @since 2017.03
343 343
 	 */
344
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null )
344
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null)
345 345
 	{
346
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->searchItems( $filter, $domains, $total );
346
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->searchItems($filter, $domains, $total);
347 347
 	}
348 348
 
349 349
 
@@ -353,12 +353,12 @@  discard block
 block discarded – undo
353 353
 	 * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item with children
354 354
 	 * @return array List of catalog IDs
355 355
 	 */
356
-	protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item )
356
+	protected function getCatalogIdsFromTree(\Aimeos\MShop\Catalog\Item\Iface $item)
357 357
 	{
358
-		$list = array( $item->getId() );
358
+		$list = array($item->getId());
359 359
 
360
-		foreach( $item->getChildren() as $child ) {
361
-			$list = array_merge( $list, $this->getCatalogIdsFromTree( $child ) );
360
+		foreach ($item->getChildren() as $child) {
361
+			$list = array_merge($list, $this->getCatalogIdsFromTree($child));
362 362
 		}
363 363
 
364 364
 		return $list;
@@ -371,13 +371,13 @@  discard block
 block discarded – undo
371 371
 	 * @param array $ids List of IDs to validate
372 372
 	 * @return array List of validated IDs
373 373
 	 */
374
-	protected function validateIds( array $ids )
374
+	protected function validateIds(array $ids)
375 375
 	{
376 376
 		$list = [];
377 377
 
378
-		foreach( $ids as $id )
378
+		foreach ($ids as $id)
379 379
 		{
380
-			if( $id != '' ) {
380
+			if ($id != '') {
381 381
 				$list[] = (int) $id;
382 382
 			}
383 383
 		}
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Product/Decorator/Base.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 	 * @param \Aimeos\Controller\Frontend\Iface $controller Controller object
31 31
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects
32 32
 	 */
33
-	public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context )
33
+	public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context)
34 34
 	{
35 35
 		$iface = '\Aimeos\Controller\Frontend\Product\Iface';
36
-		if( !( $controller instanceof $iface ) )
36
+		if (!($controller instanceof $iface))
37 37
 		{
38
-			$msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface );
39
-			throw new \Aimeos\Controller\Frontend\Exception( $msg );
38
+			$msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface);
39
+			throw new \Aimeos\Controller\Frontend\Exception($msg);
40 40
 		}
41 41
 
42 42
 		$this->controller = $controller;
43 43
 
44
-		parent::__construct( $context );
44
+		parent::__construct($context);
45 45
 	}
46 46
 
47 47
 
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	 * @return mixed Returns the value of the called method
54 54
 	 * @throws \Aimeos\Controller\Frontend\Exception If method call failed
55 55
 	 */
56
-	public function __call( $name, array $param )
56
+	public function __call($name, array $param)
57 57
 	{
58
-		return @call_user_func_array( array( $this->controller, $name ), $param );
58
+		return @call_user_func_array(array($this->controller, $name), $param);
59 59
 	}
60 60
 
61 61
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
70 70
 	 * @since 2017.03
71 71
 	 */
72
-	public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds )
72
+	public function addFilterAttribute(\Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds)
73 73
 	{
74
-		return $this->controller->addFilterAttribute( $filter, $attrIds, $optIds, $oneIds );
74
+		return $this->controller->addFilterAttribute($filter, $attrIds, $optIds, $oneIds);
75 75
 	}
76 76
 
77 77
 
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
88 88
 	 * @since 2017.03
89 89
 	 */
90
-	public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId,
91
-		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default' )
90
+	public function addFilterCategory(\Aimeos\MW\Criteria\Iface $filter, $catId,
91
+		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default')
92 92
 	{
93
-		return $this->controller->addFilterCategory( $filter, $catId, $level, $sort, $direction, $listtype );
93
+		return $this->controller->addFilterCategory($filter, $catId, $level, $sort, $direction, $listtype);
94 94
 	}
95 95
 
96 96
 
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
103 103
 	 * @since 2018.07
104 104
 	 */
105
-	public function addFilterSupplier( \Aimeos\MW\Criteria\Iface $filter, array $supIds )
105
+	public function addFilterSupplier(\Aimeos\MW\Criteria\Iface $filter, array $supIds)
106 106
 	{
107
-		return $this->controller->addFilterSupplier( $filter, $supIds );
107
+		return $this->controller->addFilterSupplier($filter, $supIds);
108 108
 	}
109 109
 
110 110
 
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
120 120
 	 * @since 2017.03
121 121
 	 */
122
-	public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default' )
122
+	public function addFilterText(\Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default')
123 123
 	{
124
-		return $this->controller->addFilterText( $filter, $input, $sort, $direction, $listtype );
124
+		return $this->controller->addFilterText($filter, $input, $sort, $direction, $listtype);
125 125
 	}
126 126
 
127 127
 
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
 	 * @return array Associative list of key values as key and the product count for this key as value
134 134
 	 * @since 2015.08
135 135
 	 */
136
-	public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key )
136
+	public function aggregate(\Aimeos\MW\Criteria\Iface $filter, $key)
137 137
 	{
138
-		return $this->controller->aggregate( $filter, $key );
138
+		return $this->controller->aggregate($filter, $key);
139 139
 	}
140 140
 
141 141
 
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
151 151
 	 * @since 2015.08
152 152
 	 */
153
-	public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' )
153
+	public function createFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default')
154 154
 	{
155
-		return $this->controller->createFilter( $sort, $direction, $start, $size, $listtype );
155
+		return $this->controller->createFilter($sort, $direction, $start, $size, $listtype);
156 156
 	}
157 157
 
158 158
 
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 	 * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items
165 165
 	 * @since 2017.03
166 166
 	 */
167
-	public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) )
167
+	public function getItem($productId, array $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text'))
168 168
 	{
169
-		return $this->controller->getItem( $productId, $domains );
169
+		return $this->controller->getItem($productId, $domains);
170 170
 	}
171 171
 
172 172
 
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 	 * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values
179 179
 	 * @since 2017.03
180 180
 	 */
181
-	public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) )
181
+	public function getItems(array $productIds, array $domains = array('media', 'price', 'text'))
182 182
 	{
183
-		return $this->controller->getItems( $productIds, $domains );
183
+		return $this->controller->getItems($productIds, $domains);
184 184
 	}
185 185
 
186 186
 
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
 	 * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface
194 194
 	 * @since 2015.08
195 195
 	 */
196
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null )
196
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null)
197 197
 	{
198
-		return $this->controller->searchItems( $filter, $domains, $total );
198
+		return $this->controller->searchItems($filter, $domains, $total);
199 199
 	}
200 200
 
201 201
 
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Product/Iface.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
31 31
 	 * @since 2017.03
32 32
 	 */
33
-	public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds );
33
+	public function addFilterAttribute(\Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds);
34 34
 
35 35
 
36 36
 	/**
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
46 46
 	 * @since 2017.03
47 47
 	 */
48
-	public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId,
49
-		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default' );
48
+	public function addFilterCategory(\Aimeos\MW\Criteria\Iface $filter, $catId,
49
+		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default');
50 50
 
51 51
 
52 52
 	/**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
58 58
 	 * @since 2018.07
59 59
 	 */
60
-	public function addFilterSupplier( \Aimeos\MW\Criteria\Iface $filter, array $supIds );
60
+	public function addFilterSupplier(\Aimeos\MW\Criteria\Iface $filter, array $supIds);
61 61
 
62 62
 
63 63
 	/**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
72 72
 	 * @since 2017.03
73 73
 	 */
74
-	public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default' );
74
+	public function addFilterText(\Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default');
75 75
 
76 76
 
77 77
 	/**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @return array Associative list of key values as key and the product count for this key as value
83 83
 	 * @since 2017.03
84 84
 	 */
85
-	public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key );
85
+	public function aggregate(\Aimeos\MW\Criteria\Iface $filter, $key);
86 86
 
87 87
 
88 88
 	/**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
97 97
 	 * @since 2017.03
98 98
 	 */
99
-	public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' );
99
+	public function createFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default');
100 100
 
101 101
 
102 102
 	/**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items
108 108
 	 * @since 2017.03
109 109
 	 */
110
-	public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) );
110
+	public function getItem($productId, array $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text'));
111 111
 
112 112
 
113 113
 	/**
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values
119 119
 	 * @since 2017.03
120 120
 	 */
121
-	public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) );
121
+	public function getItems(array $productIds, array $domains = array('media', 'price', 'text'));
122 122
 
123 123
 
124 124
 	/**
@@ -130,5 +130,5 @@  discard block
 block discarded – undo
130 130
 	 * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface
131 131
 	 * @since 2017.03
132 132
 	 */
133
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null );
133
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null);
134 134
 }
Please login to merge, or discard this patch.
frontend/tests/Controller/Frontend/Product/Decorator/BaseTest.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -20,161 +20,161 @@
 block discarded – undo
20 20
 	{
21 21
 		$this->context = \TestHelperFrontend::getContext();
22 22
 
23
-		$this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Standard' )
23
+		$this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\Standard')
24 24
 			->disableOriginalConstructor()
25 25
 			->getMock();
26 26
 
27
-		$this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Decorator\Base' )
28
-			->setConstructorArgs( [$this->stub, $this->context] )
27
+		$this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\Decorator\Base')
28
+			->setConstructorArgs([$this->stub, $this->context])
29 29
 			->getMockForAbstractClass();
30 30
 	}
31 31
 
32 32
 
33 33
 	protected function tearDown()
34 34
 	{
35
-		unset( $this->context, $this->object, $this->stub );
35
+		unset($this->context, $this->object, $this->stub);
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testConstructException()
40 40
 	{
41
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock();
41
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock();
42 42
 
43
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' );
43
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Exception');
44 44
 
45
-		$this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Decorator\Base' )
46
-			->setConstructorArgs( [$stub, $this->context] )
45
+		$this->getMockBuilder('\Aimeos\Controller\Frontend\Product\Decorator\Base')
46
+			->setConstructorArgs([$stub, $this->context])
47 47
 			->getMockForAbstractClass();
48 48
 	}
49 49
 
50 50
 
51 51
 	public function testCall()
52 52
 	{
53
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Standard' )
53
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\Standard')
54 54
 			->disableOriginalConstructor()
55
-			->setMethods( ['invalid'] )
55
+			->setMethods(['invalid'])
56 56
 			->getMock();
57 57
 
58
-		$object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Decorator\Base' )
59
-			->setConstructorArgs( [$stub, $this->context] )
58
+		$object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\Decorator\Base')
59
+			->setConstructorArgs([$stub, $this->context])
60 60
 			->getMockForAbstractClass();
61 61
 
62
-		$stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) );
62
+		$stub->expects($this->once())->method('invalid')->will($this->returnValue(true));
63 63
 
64
-		$this->assertTrue( $object->invalid() );
64
+		$this->assertTrue($object->invalid());
65 65
 	}
66 66
 
67 67
 
68 68
 	public function testAddFilterAttribute()
69 69
 	{
70
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
70
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
71 71
 
72
-		$this->stub->expects( $this->once() )->method( 'addFilterAttribute' )
73
-			->will( $this->returnArgument( 0 ) );
72
+		$this->stub->expects($this->once())->method('addFilterAttribute')
73
+			->will($this->returnArgument(0));
74 74
 
75
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterAttribute( $search, [], [], [] ) );
75
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterAttribute($search, [], [], []));
76 76
 	}
77 77
 
78 78
 
79 79
 	public function testAddFilterCategory()
80 80
 	{
81
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
81
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
82 82
 
83
-		$this->stub->expects( $this->once() )->method( 'addFilterCategory' )
84
-			->will( $this->returnArgument( 0 ) );
83
+		$this->stub->expects($this->once())->method('addFilterCategory')
84
+			->will($this->returnArgument(0));
85 85
 
86
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterCategory( $search, -1 ) );
86
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterCategory($search, -1));
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testAddFilterSupplier()
91 91
 	{
92
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
92
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
93 93
 
94
-		$this->stub->expects( $this->once() )->method( 'addFilterSupplier' )
95
-			->will( $this->returnArgument( 0 ) );
94
+		$this->stub->expects($this->once())->method('addFilterSupplier')
95
+			->will($this->returnArgument(0));
96 96
 
97
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterSupplier( $search, [] ) );
97
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterSupplier($search, []));
98 98
 	}
99 99
 
100 100
 
101 101
 	public function testAddFilterText()
102 102
 	{
103
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
103
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
104 104
 
105
-		$this->stub->expects( $this->once() )->method( 'addFilterText' )
106
-			->will( $this->returnArgument( 0 ) );
105
+		$this->stub->expects($this->once())->method('addFilterText')
106
+			->will($this->returnArgument(0));
107 107
 
108
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterText( $search, 'test' ) );
108
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterText($search, 'test'));
109 109
 	}
110 110
 
111 111
 
112 112
 	public function testAggregate()
113 113
 	{
114
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
114
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
115 115
 
116
-		$this->stub->expects( $this->once() )->method( 'aggregate' )
117
-			->will( $this->returnValue( [] ) );
116
+		$this->stub->expects($this->once())->method('aggregate')
117
+			->will($this->returnValue([]));
118 118
 
119
-		$this->assertEquals( [], $this->object->aggregate( $search, 'test' ) );
119
+		$this->assertEquals([], $this->object->aggregate($search, 'test'));
120 120
 	}
121 121
 
122 122
 
123 123
 	public function testCreateFilter()
124 124
 	{
125
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
125
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
126 126
 
127
-		$this->stub->expects( $this->once() )->method( 'createFilter' )
128
-			->will( $this->returnValue( $search ) );
127
+		$this->stub->expects($this->once())->method('createFilter')
128
+			->will($this->returnValue($search));
129 129
 
130
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() );
130
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter());
131 131
 	}
132 132
 
133 133
 
134 134
 	public function testGetItem()
135 135
 	{
136
-		$prodItem = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createItem();
136
+		$prodItem = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createItem();
137 137
 
138
-		$this->stub->expects( $this->once() )->method( 'getItem' )
139
-			->will( $this->returnValue( $prodItem ) );
138
+		$this->stub->expects($this->once())->method('getItem')
139
+			->will($this->returnValue($prodItem));
140 140
 
141
-		$this->assertInstanceOf( '\Aimeos\MShop\Product\Item\Iface', $this->object->getItem( -1 ) );
141
+		$this->assertInstanceOf('\Aimeos\MShop\Product\Item\Iface', $this->object->getItem( -1 ));
142 142
 	}
143 143
 
144 144
 
145 145
 	public function testGetItems()
146 146
 	{
147
-		$this->stub->expects( $this->once() )->method( 'getItems' )
148
-			->will( $this->returnValue( [] ) );
147
+		$this->stub->expects($this->once())->method('getItems')
148
+			->will($this->returnValue([]));
149 149
 
150
-		$this->assertEquals( [], $this->object->getItems( [-1] ) );
150
+		$this->assertEquals([], $this->object->getItems([-1]));
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testSearchItems()
155 155
 	{
156
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
156
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
157 157
 
158
-		$this->stub->expects( $this->once() )->method( 'searchItems' )
159
-			->will( $this->returnValue( [] ) );
158
+		$this->stub->expects($this->once())->method('searchItems')
159
+			->will($this->returnValue([]));
160 160
 
161
-		$this->assertEquals( [], $this->object->searchItems( $search ) );
161
+		$this->assertEquals([], $this->object->searchItems($search));
162 162
 	}
163 163
 
164 164
 
165 165
 	public function testGetController()
166 166
 	{
167
-		$result = $this->access( 'getController' )->invokeArgs( $this->object, [] );
167
+		$result = $this->access('getController')->invokeArgs($this->object, []);
168 168
 
169
-		$this->assertSame( $this->stub, $result );
169
+		$this->assertSame($this->stub, $result);
170 170
 	}
171 171
 
172 172
 
173
-	protected function access( $name )
173
+	protected function access($name)
174 174
 	{
175
-		$class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Product\Decorator\Base' );
176
-		$method = $class->getMethod( $name );
177
-		$method->setAccessible( true );
175
+		$class = new \ReflectionClass('\Aimeos\Controller\Frontend\Product\Decorator\Base');
176
+		$method = $class->getMethod($name);
177
+		$method->setAccessible(true);
178 178
 
179 179
 		return $method;
180 180
 	}
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Product/StandardTest.php 1 patch
Spacing   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -17,22 +17,22 @@  discard block
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperFrontend::getContext();
20
-		$this->object = new \Aimeos\Controller\Frontend\Product\Standard( $this->context );
20
+		$this->object = new \Aimeos\Controller\Frontend\Product\Standard($this->context);
21 21
 	}
22 22
 
23 23
 
24 24
 	protected function tearDown()
25 25
 	{
26
-		unset( $this->object );
26
+		unset($this->object);
27 27
 	}
28 28
 
29 29
 
30 30
 	public function testAggregate()
31 31
 	{
32 32
 		$filter = $this->object->createFilter();
33
-		$list = $this->object->aggregate( $filter, 'index.attribute.id' );
33
+		$list = $this->object->aggregate($filter, 'index.attribute.id');
34 34
 
35
-		$this->assertGreaterThan( 0, count( $list ) );
35
+		$this->assertGreaterThan(0, count($list));
36 36
 	}
37 37
 
38 38
 
@@ -40,129 +40,129 @@  discard block
 block discarded – undo
40 40
 	{
41 41
 		$filter = $this->object->createFilter();
42 42
 
43
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
44
-		$this->assertEquals( [], $filter->getSortations() );
45
-		$this->assertEquals( 0, $filter->getSliceStart() );
46
-		$this->assertEquals( 100, $filter->getSliceSize() );
43
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
44
+		$this->assertEquals([], $filter->getSortations());
45
+		$this->assertEquals(0, $filter->getSliceStart());
46
+		$this->assertEquals(100, $filter->getSliceSize());
47 47
 	}
48 48
 
49 49
 
50 50
 	public function testCreateFilterIgnoreDates()
51 51
 	{
52
-		$this->context->getConfig()->set( 'controller/frontend/product/ignore-dates', true );
52
+		$this->context->getConfig()->set('controller/frontend/product/ignore-dates', true);
53 53
 
54 54
 		$filter = $this->object->createFilter();
55 55
 
56
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
56
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
57 57
 	}
58 58
 
59 59
 
60 60
 	public function testAddFilterAttribute()
61 61
 	{
62 62
 		$filter = $this->object->createFilter();
63
-		$filter = $this->object->addFilterAttribute( $filter, array( 0, 1 ), [], [] );
63
+		$filter = $this->object->addFilterAttribute($filter, array(0, 1), [], []);
64 64
 
65 65
 		$list = $filter->getConditions()->getExpressions();
66 66
 
67
-		if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) {
68
-			throw new \RuntimeException( 'Wrong expression' );
67
+		if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) {
68
+			throw new \RuntimeException('Wrong expression');
69 69
 		}
70 70
 
71
-		$this->assertEquals( 'index.attributeaggregate([0,1])', $list[0]->getName() );
72
-		$this->assertEquals( 2, $list[0]->getValue() );
71
+		$this->assertEquals('index.attributeaggregate([0,1])', $list[0]->getName());
72
+		$this->assertEquals(2, $list[0]->getValue());
73 73
 	}
74 74
 
75 75
 
76 76
 	public function testAddFilterAttributeOptions()
77 77
 	{
78 78
 		$filter = $this->object->createFilter();
79
-		$filter = $this->object->addFilterAttribute( $filter, [], array( 1 ), [] );
79
+		$filter = $this->object->addFilterAttribute($filter, [], array(1), []);
80 80
 
81 81
 		$list = $filter->getConditions()->getExpressions();
82 82
 
83
-		if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) {
84
-			throw new \RuntimeException( 'Wrong expression' );
83
+		if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) {
84
+			throw new \RuntimeException('Wrong expression');
85 85
 		}
86 86
 
87
-		$this->assertEquals( 'index.attributeaggregate([1])', $list[0]->getName() );
88
-		$this->assertEquals( 0, $list[0]->getValue() );
87
+		$this->assertEquals('index.attributeaggregate([1])', $list[0]->getName());
88
+		$this->assertEquals(0, $list[0]->getValue());
89 89
 	}
90 90
 
91 91
 
92 92
 	public function testAddFilterAttributeOne()
93 93
 	{
94 94
 		$filter = $this->object->createFilter();
95
-		$filter = $this->object->addFilterAttribute( $filter, [], [], array( 'test' => array( 2 ) ) );
95
+		$filter = $this->object->addFilterAttribute($filter, [], [], array('test' => array(2)));
96 96
 
97 97
 		$list = $filter->getConditions()->getExpressions();
98 98
 
99
-		if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) {
100
-			throw new \RuntimeException( 'Wrong expression' );
99
+		if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) {
100
+			throw new \RuntimeException('Wrong expression');
101 101
 		}
102 102
 
103
-		$this->assertEquals( 'index.attributeaggregate([2])', $list[0]->getName() );
104
-		$this->assertEquals( 0, $list[0]->getValue() );
103
+		$this->assertEquals('index.attributeaggregate([2])', $list[0]->getName());
104
+		$this->assertEquals(0, $list[0]->getValue());
105 105
 	}
106 106
 
107 107
 
108 108
 	public function testAddFilterCategory()
109 109
 	{
110 110
 		$context = \TestHelperFrontend::getContext();
111
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'catalog' );
111
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'catalog');
112 112
 
113
-		$catId = $manager->findItem( 'root' )->getId();
113
+		$catId = $manager->findItem('root')->getId();
114 114
 		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_LIST;
115 115
 
116 116
 		$filter = $this->object->createFilter();
117
-		$filter = $this->object->addFilterCategory( $filter, $catId, $level );
117
+		$filter = $this->object->addFilterCategory($filter, $catId, $level);
118 118
 
119 119
 		$list = $filter->getConditions()->getExpressions();
120 120
 
121
-		if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) {
122
-			throw new \RuntimeException( 'Wrong expression' );
121
+		if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) {
122
+			throw new \RuntimeException('Wrong expression');
123 123
 		}
124 124
 
125
-		$this->assertEquals( 'index.catalog.id', $list[0]->getName() );
126
-		$this->assertEquals( 3, count( $list[0]->getValue() ) );
127
-		$this->assertEquals( [], $filter->getSortations() );
125
+		$this->assertEquals('index.catalog.id', $list[0]->getName());
126
+		$this->assertEquals(3, count($list[0]->getValue()));
127
+		$this->assertEquals([], $filter->getSortations());
128 128
 	}
129 129
 
130 130
 
131 131
 	public function testAddFilterSupplier()
132 132
 	{
133 133
 		$filter = $this->object->createFilter();
134
-		$filter = $this->object->addFilterSupplier( $filter, [0, 1] );
134
+		$filter = $this->object->addFilterSupplier($filter, [0, 1]);
135 135
 
136 136
 		$list = $filter->getConditions()->getExpressions();
137 137
 
138
-		if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) {
139
-			throw new \RuntimeException( 'Wrong expression' );
138
+		if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) {
139
+			throw new \RuntimeException('Wrong expression');
140 140
 		}
141 141
 
142
-		$this->assertEquals( 'index.supplier.id', $list[0]->getName() );
143
-		$this->assertEquals( 2, count( $list[0]->getValue() ) );
142
+		$this->assertEquals('index.supplier.id', $list[0]->getName());
143
+		$this->assertEquals(2, count($list[0]->getValue()));
144 144
 	}
145 145
 
146 146
 
147 147
 	public function testAddFilterText()
148 148
 	{
149 149
 		$filter = $this->object->createFilter();
150
-		$filter = $this->object->addFilterText( $filter, 'Espresso' );
150
+		$filter = $this->object->addFilterText($filter, 'Espresso');
151 151
 
152
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
152
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
153 153
 
154 154
 		$list = $filter->getConditions()->getExpressions();
155 155
 
156 156
 
157
-		if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) {
158
-			throw new \RuntimeException( 'Wrong expression' );
157
+		if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) {
158
+			throw new \RuntimeException('Wrong expression');
159 159
 		}
160
-		$this->assertEquals( 'index.text.relevance("default","de","Espresso")', $list[0]->getName() );
161
-		$this->assertEquals( 0, $list[0]->getValue() );
160
+		$this->assertEquals('index.text.relevance("default","de","Espresso")', $list[0]->getName());
161
+		$this->assertEquals(0, $list[0]->getValue());
162 162
 
163
-		$this->assertEquals( [], $filter->getSortations() );
164
-		$this->assertEquals( 0, $filter->getSliceStart() );
165
-		$this->assertEquals( 100, $filter->getSliceSize() );
163
+		$this->assertEquals([], $filter->getSortations());
164
+		$this->assertEquals(0, $filter->getSliceStart());
165
+		$this->assertEquals(100, $filter->getSliceSize());
166 166
 	}
167 167
 
168 168
 
@@ -171,177 +171,177 @@  discard block
 block discarded – undo
171 171
 		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE;
172 172
 
173 173
 		$filter = $this->object->createFilter();
174
-		$filter = $this->object->addFilterCategory( $filter, 0, $level, 'relevance', '-', 'test' );
174
+		$filter = $this->object->addFilterCategory($filter, 0, $level, 'relevance', '-', 'test');
175 175
 
176
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
176
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
177 177
 
178 178
 		$sort = $filter->getSortations();
179
-		if( ( $item = reset( $sort ) ) === false ) {
180
-			throw new \RuntimeException( 'Sortation not set' );
179
+		if (($item = reset($sort)) === false) {
180
+			throw new \RuntimeException('Sortation not set');
181 181
 		}
182 182
 
183
-		$this->assertEquals( 'sort:index.catalog.position("test",["0"])', $item->getName() );
184
-		$this->assertEquals( '-', $item->getOperator() );
183
+		$this->assertEquals('sort:index.catalog.position("test",["0"])', $item->getName());
184
+		$this->assertEquals('-', $item->getOperator());
185 185
 	}
186 186
 
187 187
 
188 188
 	public function testCreateFilterSortRelevanceText()
189 189
 	{
190
-		$filter = $this->object->createFilter( 'relevance', '-', 1, 2, 'test' );
191
-		$filter = $this->object->addFilterText( $filter, 'Espresso' );
190
+		$filter = $this->object->createFilter('relevance', '-', 1, 2, 'test');
191
+		$filter = $this->object->addFilterText($filter, 'Espresso');
192 192
 
193
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
194
-		$this->assertEquals( [], $filter->getSortations() );
195
-		$this->assertEquals( 1, $filter->getSliceStart() );
196
-		$this->assertEquals( 2, $filter->getSliceSize() );
193
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
194
+		$this->assertEquals([], $filter->getSortations());
195
+		$this->assertEquals(1, $filter->getSliceStart());
196
+		$this->assertEquals(2, $filter->getSliceSize());
197 197
 	}
198 198
 
199 199
 
200 200
 	public function testCreateFilterSortCode()
201 201
 	{
202
-		$filter = $this->object->createFilter( 'code' );
202
+		$filter = $this->object->createFilter('code');
203 203
 
204
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
204
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
205 205
 
206 206
 		$sort = $filter->getSortations();
207
-		if( ( $item = reset( $sort ) ) === false ) {
208
-			throw new \RuntimeException( 'Sortation not set' );
207
+		if (($item = reset($sort)) === false) {
208
+			throw new \RuntimeException('Sortation not set');
209 209
 		}
210 210
 
211
-		$this->assertEquals( 'product.code', $item->getName() );
211
+		$this->assertEquals('product.code', $item->getName());
212 212
 	}
213 213
 
214 214
 
215 215
 	public function testCreateFilterSortCtime()
216 216
 	{
217
-		$filter = $this->object->createFilter( 'ctime' );
217
+		$filter = $this->object->createFilter('ctime');
218 218
 
219
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
219
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
220 220
 
221 221
 		$sort = $filter->getSortations();
222
-		if( ( $item = reset( $sort ) ) === false ) {
223
-			throw new \RuntimeException( 'Sortation not set' );
222
+		if (($item = reset($sort)) === false) {
223
+			throw new \RuntimeException('Sortation not set');
224 224
 		}
225 225
 
226
-		$this->assertEquals( 'product.ctime', $item->getName() );
226
+		$this->assertEquals('product.ctime', $item->getName());
227 227
 	}
228 228
 
229 229
 
230 230
 	public function testCreateFilterSortName()
231 231
 	{
232
-		$filter = $this->object->createFilter( 'name' );
232
+		$filter = $this->object->createFilter('name');
233 233
 
234
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
234
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
235 235
 
236 236
 		$sort = $filter->getSortations();
237
-		if( ( $item = reset( $sort ) ) === false ) {
238
-			throw new \RuntimeException( 'Sortation not set' );
237
+		if (($item = reset($sort)) === false) {
238
+			throw new \RuntimeException('Sortation not set');
239 239
 		}
240 240
 
241
-		$this->assertEquals( 'sort:index.text.value("default","de","name")', $item->getName() );
241
+		$this->assertEquals('sort:index.text.value("default","de","name")', $item->getName());
242 242
 	}
243 243
 
244 244
 
245 245
 	public function testCreateFilterSortPrice()
246 246
 	{
247
-		$filter = $this->object->createFilter( 'price' );
247
+		$filter = $this->object->createFilter('price');
248 248
 
249
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
249
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
250 250
 
251 251
 		$sort = $filter->getSortations();
252
-		if( ( $item = reset( $sort ) ) === false ) {
253
-			throw new \RuntimeException( 'Sortation not set' );
252
+		if (($item = reset($sort)) === false) {
253
+			throw new \RuntimeException('Sortation not set');
254 254
 		}
255 255
 
256
-		$this->assertStringStartsWith( 'sort:index.price.value("default","EUR","default")', $item->getName() );
256
+		$this->assertStringStartsWith('sort:index.price.value("default","EUR","default")', $item->getName());
257 257
 	}
258 258
 
259 259
 
260 260
 	public function testCreateFilterSortInvalid()
261 261
 	{
262
-		$filter = $this->object->createFilter( '', 'failure' );
262
+		$filter = $this->object->createFilter('', 'failure');
263 263
 
264
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
265
-		$this->assertEquals( [], $filter->getSortations() );
264
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
265
+		$this->assertEquals([], $filter->getSortations());
266 266
 	}
267 267
 
268 268
 
269 269
 	public function testGetItem()
270 270
 	{
271 271
 		$context = \TestHelperFrontend::getContext();
272
-		$id = \Aimeos\MShop\Factory::createManager( $context, 'product' )->findItem( 'CNC' )->getId();
272
+		$id = \Aimeos\MShop\Factory::createManager($context, 'product')->findItem('CNC')->getId();
273 273
 
274
-		$result = $this->object->getItem( $id );
274
+		$result = $this->object->getItem($id);
275 275
 
276
-		$this->assertInstanceOf( '\Aimeos\MShop\Product\Item\Iface', $result );
277
-		$this->assertGreaterThan( 0, $result->getPropertyItems() );
278
-		$this->assertGreaterThan( 0, $result->getRefItems( 'attribute' ) );
279
-		$this->assertGreaterThan( 0, $result->getRefItems( 'media' ) );
280
-		$this->assertGreaterThan( 0, $result->getRefItems( 'price' ) );
281
-		$this->assertGreaterThan( 0, $result->getRefItems( 'product' ) );
282
-		$this->assertGreaterThan( 0, $result->getRefItems( 'text' ) );
276
+		$this->assertInstanceOf('\Aimeos\MShop\Product\Item\Iface', $result);
277
+		$this->assertGreaterThan(0, $result->getPropertyItems());
278
+		$this->assertGreaterThan(0, $result->getRefItems('attribute'));
279
+		$this->assertGreaterThan(0, $result->getRefItems('media'));
280
+		$this->assertGreaterThan(0, $result->getRefItems('price'));
281
+		$this->assertGreaterThan(0, $result->getRefItems('product'));
282
+		$this->assertGreaterThan(0, $result->getRefItems('text'));
283 283
 	}
284 284
 
285 285
 
286 286
 	public function testGetItems()
287 287
 	{
288 288
 		$context = \TestHelperFrontend::getContext();
289
-		$context->getConfig()->set( 'controller/frontend/product/ignore-dates', true );
289
+		$context->getConfig()->set('controller/frontend/product/ignore-dates', true);
290 290
 
291
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
291
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
292 292
 
293 293
 		$search = $manager->createSearch();
294
-		$search->setConditions( $search->compare( '==', 'product.code', array( 'CNC', 'CNE' ) ) );
294
+		$search->setConditions($search->compare('==', 'product.code', array('CNC', 'CNE')));
295 295
 
296 296
 		$ids = [];
297
-		foreach( $manager->searchItems( $search ) as $productItem ) {
297
+		foreach ($manager->searchItems($search) as $productItem) {
298 298
 			$ids[] = $productItem->getId();
299 299
 		}
300 300
 
301 301
 
302
-		$result = $this->object->getItems( $ids );
302
+		$result = $this->object->getItems($ids);
303 303
 
304
-		$this->assertEquals( 2, count( $result ) );
304
+		$this->assertEquals(2, count($result));
305 305
 
306
-		foreach( $result as $productItem ) {
307
-			$this->assertInstanceOf( '\Aimeos\MShop\Product\Item\Iface', $productItem );
306
+		foreach ($result as $productItem) {
307
+			$this->assertInstanceOf('\Aimeos\MShop\Product\Item\Iface', $productItem);
308 308
 		}
309 309
 	}
310 310
 
311 311
 
312 312
 	public function testSearchItemsCategory()
313 313
 	{
314
-		$catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( \TestHelperFrontend::getContext() );
314
+		$catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager(\TestHelperFrontend::getContext());
315 315
 		$search = $catalogManager->createSearch();
316 316
 
317
-		$search->setConditions( $search->compare( '==', 'catalog.code', 'new' ) );
318
-		$search->setSlice( 0, 1 );
319
-		$items = $catalogManager->searchItems( $search );
317
+		$search->setConditions($search->compare('==', 'catalog.code', 'new'));
318
+		$search->setSlice(0, 1);
319
+		$items = $catalogManager->searchItems($search);
320 320
 
321
-		if( ( $item = reset( $items ) ) === false ) {
322
-			throw new \RuntimeException( 'Product item not found' );
321
+		if (($item = reset($items)) === false) {
322
+			throw new \RuntimeException('Product item not found');
323 323
 		}
324 324
 
325
-		$filter = $this->object->createFilter( 'position', '+', 1, 1 );
326
-		$filter = $this->object->addFilterCategory( $filter, $item->getId() );
325
+		$filter = $this->object->createFilter('position', '+', 1, 1);
326
+		$filter = $this->object->addFilterCategory($filter, $item->getId());
327 327
 
328 328
 		$total = 0;
329
-		$results = $this->object->searchItems( $filter, [], $total );
329
+		$results = $this->object->searchItems($filter, [], $total);
330 330
 
331
-		$this->assertEquals( 3, $total );
332
-		$this->assertEquals( 1, count( $results ) );
331
+		$this->assertEquals(3, $total);
332
+		$this->assertEquals(1, count($results));
333 333
 	}
334 334
 
335 335
 
336 336
 	public function testSearchItemsText()
337 337
 	{
338
-		$filter = $this->object->createFilter( 'relevance', '+', 0, 1, 'unittype13' );
339
-		$filter = $this->object->addFilterText( $filter, 'Expresso', 'relevance', '+', 'unittype13' );
338
+		$filter = $this->object->createFilter('relevance', '+', 0, 1, 'unittype13');
339
+		$filter = $this->object->addFilterText($filter, 'Expresso', 'relevance', '+', 'unittype13');
340 340
 
341 341
 		$total = 0;
342
-		$results = $this->object->searchItems( $filter, [], $total );
342
+		$results = $this->object->searchItems($filter, [], $total);
343 343
 
344
-		$this->assertEquals( 2, $total );
345
-		$this->assertEquals( 1, count( $results ) );
344
+		$this->assertEquals(2, $total);
345
+		$this->assertEquals(1, count($results));
346 346
 	}
347 347
 }
Please login to merge, or discard this patch.