Passed
Push — master ( 47e37b...2360ce )
by Aimeos
05:11
created
lib/mshoplib/tests/MShop/Plugin/Provider/Order/ProductFreeOptionsTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 		$attribute = \Aimeos\MShop::create( $this->context, 'order/base/product/attribute' )->createItem();
47 47
 
48 48
 		$attribute = $attribute->setQuantity( 2 )->setCode( 'size' )->setType( 'config' )
49
-			->setAttributeId( $attrManager->findItem( 'xs', [], 'product', 'size')->getId() );
49
+			->setAttributeId( $attrManager->findItem( 'xs', [], 'product', 'size' )->getId() );
50 50
 
51 51
 		$product = $product->setAttributeItem( $attribute )->setProductId( $prodManager->findItem( 'CNE' )->getId() );
52 52
 
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Service/Provider/Decorator/Postal.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,12 +119,13 @@
 block discarded – undo
119 119
 					return false;
120 120
 				}
121 121
 			}
122
-		}
123
-		elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) // use billing address if no delivery address is available
122
+		} elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) {
123
+			// use billing address if no delivery address is available
124 124
 		{
125 125
 			foreach( $addresses as $address )
126 126
 			{
127 127
 				$code = $address->getPostal();
128
+		}
128 129
 
129 130
 				if( $this->checkPostalCode( $code, 'postal.delivery-include' ) === false
130 131
 					|| $this->checkPostalCode( $code, 'postal.delivery-exclude' ) === true
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Service/Provider/Decorator/Country.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,12 +119,13 @@
 block discarded – undo
119 119
 					return false;
120 120
 				}
121 121
 			}
122
-		}
123
-		elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) // use billing address if no delivery address is available
122
+		} elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) {
123
+			// use billing address if no delivery address is available
124 124
 		{
125 125
 			foreach( $addresses as $address )
126 126
 			{
127 127
 				$code = strtoupper( $address->getCountryId() );
128
+		}
128 129
 
129 130
 				if( $this->checkCountryCode( $code, 'country.delivery-include' ) === false
130 131
 					|| $this->checkCountryCode( $code, 'country.delivery-exclude' ) === true
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Catalog/Manager/StandardTest.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,8 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 	public function testRegisterItemFilter()
79 79
 	{
80
-		$callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index )
81
-		{
80
+		$callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) {
82 81
 			return true;
83 82
 		};
84 83
 
@@ -290,8 +289,7 @@  discard block
 block discarded – undo
290 289
 	{
291 290
 		$this->assertEquals( 2, count( $this->object->getTree()->getChildren() ) );
292 291
 
293
-		$callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index )
294
-		{
292
+		$callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) {
295 293
 			return (bool) $index % 2;
296 294
 		};
297 295
 
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Plugin/Provider/Order/ProductFreeOptions.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
 			foreach( $value as $key => $product ) {
54 54
 				$value[$key] = $this->updatePrice( $product );
55 55
 			}
56
-		}
57
-		else
56
+		} else
58 57
 		{
59 58
 			$value = $this->updatePrice( $value );
60 59
 		}
@@ -130,8 +129,7 @@  discard block
 block discarded – undo
130 129
 	{
131 130
 		$priceManager = \Aimeos\MShop::create( $this->getContext(), 'price' );
132 131
 
133
-		$sortFcn = function( $a, $b ) use( $priceManager, $attrQtys )
134
-		{
132
+		$sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) {
135 133
 			if( ( $pricesA = $a->getRefItems( 'price', 'default', 'default' ) ) === [] ) {
136 134
 				return 1;
137 135
 			}
@@ -194,8 +192,7 @@  discard block
 block discarded – undo
194 192
 			{
195 193
 				$list = $this->sortByPrice( $list, $attrQtys );
196 194
 				$priceItem = $this->addPrices( $priceItem, $list, $attrQtys, (int) $prodConf[$type] );
197
-			}
198
-			else
195
+			} else
199 196
 			{
200 197
 				$priceItem = $this->addPrices( $priceItem, $list, $attrQtys, 0 );
201 198
 			}
Please login to merge, or discard this patch.
lib/mshoplib/setup/unitperf/CatalogAddPerfData.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@  discard block
 block discarded – undo
79 79
 				for( $i = 0; $i < $numCatPerLevel; $i++ ){
80 80
 					$treeFcn( $parents, $catItem->getId(), $numCatPerLevel, $level - 1, $catLabel . '-' . ($i+1), $i );
81 81
 				}
82
-			}
83
-			else
82
+			} else
84 83
 			{
85 84
 				$fcn = function( array $parents, $catLabel ) {
86 85
 
@@ -139,9 +138,12 @@  discard block
 block discarded – undo
139 138
 
140 139
 		while( true )
141 140
 		{
142
-			try {
141
+			try
142
+			{
143 143
 				return $catalogManager->insertItem( $item, $parentId );
144
-			} catch( \Aimeos\MW\DB\Exception $e ) {
144
+			}
145
+			catch( \Aimeos\MW\DB\Exception $e )
146
+			{
145 147
 				if( $e->getCode() !== 40001 ) { throw $e; } // transaction deadlock
146 148
 			}
147 149
 		}
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 
77 77
 			if( $level > 0 )
78 78
 			{
79
-				for( $i = 0; $i < $numCatPerLevel; $i++ ){
80
-					$treeFcn( $parents, $catItem->getId(), $numCatPerLevel, $level - 1, $catLabel . '-' . ($i+1), $i );
79
+				for( $i = 0; $i < $numCatPerLevel; $i++ ) {
80
+					$treeFcn( $parents, $catItem->getId(), $numCatPerLevel, $level - 1, $catLabel . '-' . ( $i + 1 ), $i );
81 81
 				}
82 82
 			}
83 83
 			else
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		}
118 118
 
119 119
 		for( $i = $begin; $i < $end; $i++ ) {
120
-			$treeFcn( [$catRootItem], $catRootItem->getId(), $numCatPerLevel, $this->numCatLevels - 1, $i+1, $i );
120
+			$treeFcn( [$catRootItem], $catRootItem->getId(), $numCatPerLevel, $this->numCatLevels - 1, $i + 1, $i );
121 121
 		}
122 122
 
123 123
 		$this->additional->getProcess()->wait();
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			{
164 164
 				if( $item->pos % $fraction === 0 )
165 165
 				{
166
-					$litem = (clone $defListItem)->setRefId( $item->getId() )->setPosition( $start + round( $item->pos / $fraction ) );
166
+					$litem = ( clone $defListItem )->setRefId( $item->getId() )->setPosition( $start + round( $item->pos / $fraction ) );
167 167
 					$catItem->addListItem( 'product', $litem );
168 168
 				}
169 169
 			}
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
 		$listItem = $productListManager->createItem()->setType( 'default' );
200 200
 
201 201
 		foreach( $attrIds as $attrId ) {
202
-			$prodItem->addListItem( 'attribute', (clone $listItem)->setRefId( $attrId ) );
202
+			$prodItem->addListItem( 'attribute', ( clone $listItem )->setRefId( $attrId ) );
203 203
 		}
204 204
 
205 205
 		$listItem = $productListManager->createItem()->setType( 'config' );
206 206
 
207 207
 		foreach( $this->attributes['sticker'] as $attrId => $label ) {
208
-			$prodItem->addListItem( 'attribute', (clone $listItem)->setRefId( $attrId ) );
208
+			$prodItem->addListItem( 'attribute', ( clone $listItem )->setRefId( $attrId ) );
209 209
 		}
210 210
 
211 211
 		return $prodItem;
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 		{
245 245
 			$text = current( $color ) . ' ' . current( $property ) . ' ' . current( $material ) . ' ' . current( $articles );
246 246
 
247
-			$item = (clone $newItem)
247
+			$item = ( clone $newItem )
248 248
 				->setLabel( $text . ' (' . $catLabel . ')' )
249 249
 				->setCode( 'p-' . $i . ':' . $catLabel )
250 250
 				->setStatus( 1 );
@@ -308,18 +308,18 @@  discard block
 block discarded – undo
308 308
 
309 309
 		foreach( array_values( $this->shuffle( range( 0, 3 ) ) ) as $pos => $i )
310 310
 		{
311
-			$num = (($idx + $i) % 4) + 1;
312
-			$mediaItem = (clone $newItem)
313
-				->setLabel( ($pos+1) . '. picture for ' . $prodItem->getLabel() )
311
+			$num = ( ( $idx + $i ) % 4 ) + 1;
312
+			$mediaItem = ( clone $newItem )
313
+				->setLabel( ( $pos + 1 ) . '. picture for ' . $prodItem->getLabel() )
314 314
 				->setPreviews( [1 => $prefix . 'unitperf/' . $num . '.jpg'] )
315 315
 				->setUrl( $prefix . 'unitperf/' . $num . '-big.jpg' )
316 316
 				->setMimeType( 'image/jpeg' )
317 317
 				->setStatus( 1 );
318 318
 
319
-			$prodItem->addListItem( 'media', (clone $litem)->setPosition( $pos ), $mediaItem );
319
+			$prodItem->addListItem( 'media', ( clone $litem )->setPosition( $pos ), $mediaItem );
320 320
 		}
321 321
 
322
-		$mediaItem = (clone $newItem)
322
+		$mediaItem = ( clone $newItem )
323 323
 			->setPreviews( [1 => $prefix . 'unitperf/download-preview.jpg'] )
324 324
 			->setUrl( $prefix . 'unitperf/download.pdf' )
325 325
 			->setMimeType( 'application/pdf' )
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 		$litem = $productListManager->createItem()->setType( 'download' );
330 330
 
331
-		return $prodItem->addListItem( 'media', (clone $litem), $mediaItem );
331
+		return $prodItem->addListItem( 'media', ( clone $litem ), $mediaItem );
332 332
 	}
333 333
 
334 334
 
@@ -343,15 +343,15 @@  discard block
 block discarded – undo
343 343
 
344 344
 		for( $i = 0; $i < 3; $i++ )
345 345
 		{
346
-			$priceItem = (clone $newItem)
346
+			$priceItem = ( clone $newItem )
347 347
 				->setLabel( $prodItem->getLabel() . ': from ' . ( 1 + $i * 5 ) )
348
-				->setValue( 100 + (( $base + $idx ) % 900) - $i * 10 )
348
+				->setValue( 100 + ( ( $base + $idx ) % 900 ) - $i * 10 )
349 349
 				->setQuantity( 1 + $i * 10 )
350 350
 				->setCurrencyId( 'EUR' )
351 351
 				->setRebate( $i * 10 )
352 352
 				->setStatus( 1 );
353 353
 
354
-			$prodItem->addListItem( 'price', (clone $litem)->setPosition( $i ), $priceItem );
354
+			$prodItem->addListItem( 'price', ( clone $litem )->setPosition( $i ), $priceItem );
355 355
 		}
356 356
 
357 357
 		return $prodItem;
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 			{
373 373
 				if( !in_array( $litem->getRefId(), $ids ) )
374 374
 				{
375
-					$prodItem->addListItem( 'product', (clone $listItem)->setRefId( $litem->getRefId() ) );
375
+					$prodItem->addListItem( 'product', ( clone $listItem )->setRefId( $litem->getRefId() ) );
376 376
 					$ids[] = $litem->getRefId();
377 377
 					$num--;
378 378
 				}
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 			->setType( 'url' )
398 398
 			->setStatus( 1 );
399 399
 
400
-		$prodItem->addListItem( 'text', (clone $listItem), $textItem );
400
+		$prodItem->addListItem( 'text', ( clone $listItem ), $textItem );
401 401
 
402 402
 		$textItem = $textManager->createItem()
403 403
 			->setLanguageId( 'en' )
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 			->setType( 'name' )
407 407
 			->setStatus( 1 );
408 408
 
409
-		$prodItem->addListItem( 'text', (clone $listItem)->setPosition( 0 ), $textItem );
409
+		$prodItem->addListItem( 'text', ( clone $listItem )->setPosition( 0 ), $textItem );
410 410
 
411 411
 		$textItem = $textManager->createItem()
412 412
 			->setContent( 'Short description for ' . $label )
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 			->setType( 'short' )
416 416
 			->setStatus( 1 );
417 417
 
418
-		$prodItem->addListItem( 'text', (clone $listItem)->setPosition( 1 ), $textItem );
418
+		$prodItem->addListItem( 'text', ( clone $listItem )->setPosition( 1 ), $textItem );
419 419
 
420 420
 		$textItem = $textManager->createItem()
421 421
 			->setContent( 'Long description for ' . $label . '. This may include some "lorem ipsum" text' )
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 			->setType( 'long' )
425 425
 			->setStatus( 1 );
426 426
 
427
-		$prodItem->addListItem( 'text', (clone $listItem)->setPosition( 2 ), $textItem );
427
+		$prodItem->addListItem( 'text', ( clone $listItem )->setPosition( 2 ), $textItem );
428 428
 
429 429
 		return $prodItem;
430 430
 	}
@@ -447,14 +447,14 @@  discard block
 block discarded – undo
447 447
 		{
448 448
 			$text = current( $length ) . ', ' . current( $width ) . ', ' . $prodItem->getLabel() . ' (' . current( $size ) . ')';
449 449
 
450
-			$item = (clone $newItem)
450
+			$item = ( clone $newItem )
451 451
 				->setCode( 'v-' . $idx . '/' . $i . ':' . $prodItem->getCode() )
452 452
 				->setLabel( $text )
453 453
 				->setStatus( 1 );
454 454
 
455
-			$item->addListItem( 'attribute', (clone $varListItem)->setRefId( key( $length ) ) );
456
-			$item->addListItem( 'attribute', (clone $varListItem)->setRefId( key( $width ) ) );
457
-			$item->addListItem( 'attribute', (clone $varListItem)->setRefId( key( $size ) ) );
455
+			$item->addListItem( 'attribute', ( clone $varListItem )->setRefId( key( $length ) ) );
456
+			$item->addListItem( 'attribute', ( clone $varListItem )->setRefId( key( $width ) ) );
457
+			$item->addListItem( 'attribute', ( clone $varListItem )->setRefId( key( $size ) ) );
458 458
 
459 459
 			$prodItem->addListItem( 'product', clone $defListItem, $item );
460 460
 
Please login to merge, or discard this patch.
lib/mshoplib/setup/LocaleRemoveCharConstraints.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
 		) {
54 54
 			$this->execute( 'ALTER TABLE "mshop_locale" DROP FOREIGN KEY "fk_msloc_langid"', 'db-locale' );
55 55
 			$this->status( 'done' );
56
-		}
57
-		else
56
+		} else
58 57
 		{
59 58
 			$this->status( 'OK' );
60 59
 		}
@@ -66,8 +65,7 @@  discard block
 block discarded – undo
66 65
 		) {
67 66
 			$this->execute( 'ALTER TABLE "mshop_locale" DROP FOREIGN KEY "fk_msloc_currid"', 'db-locale' );
68 67
 			$this->status( 'done' );
69
-		}
70
-		else
68
+		} else
71 69
 		{
72 70
 			$this->status( 'OK' );
73 71
 		}
Please login to merge, or discard this patch.
lib/mshoplib/setup/unittest/data/text.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
  * @copyright Aimeos (aimeos.org), 2015-2018
7 7
  */
8 8
 
9
-return array (
10
-	'text/type' => array (
9
+return array(
10
+	'text/type' => array(
11 11
 		'attribute/name' => array( 'domain' => 'attribute', 'code' => 'name', 'label' => 'Name', 'status' => 1 ),
12 12
 		'attribute/short' => array( 'domain' => 'attribute', 'code' => 'short', 'label' => 'Short description', 'status' => 1 ),
13 13
 		'attribute/long' => array( 'domain' => 'attribute', 'code' => 'long', 'label' => 'Long description', 'status' => 1 ),
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 		'supplier/long' => array( 'domain' => 'supplier', 'code' => 'long', 'label' => 'Long description', 'status' => 1 ),
49 49
 	),
50 50
 
51
-	'text' => array (
51
+	'text' => array(
52 52
 
53 53
 //supplier
54
-		'text/supplier/description' => array( 'langid' => null, 'type' => 'description', 'domain' => 'supplier', 'label' => 'supplier/description', 'content' => 'Supplier description', 'status' => 1),
54
+		'text/supplier/description' => array( 'langid' => null, 'type' => 'description', 'domain' => 'supplier', 'label' => 'supplier/description', 'content' => 'Supplier description', 'status' => 1 ),
55 55
 //ATTR
56 56
 //size
57 57
 		'text/size/XS' => array( 'langid' => null, 'type' => 'name', 'domain' => 'attribute', 'label' => 'size/XS', 'content' => 'XS', 'status' => 1 ),
Please login to merge, or discard this patch.
lib/mshoplib/setup/unittest/data/customer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 				'customer.address.telefax' => '055544332212', 'customer.address.website' => 'www.example.com',
81 81
 				'customer.address.longitude' => '10.5', 'customer.address.latitude' => '51.0',
82 82
 				'customer.address.position' => '0',
83
-			],[
83
+			], [
84 84
 				'customer.address.company' => 'Example company LLC', 'customer.address.vatid' => 'DE999999999',
85 85
 				'customer.address.salutation' => 'mr', 'customer.address.title' => 'Dr.',
86 86
 				'customer.address.firstname' => 'Good', 'customer.address.lastname' => 'Unittest',
Please login to merge, or discard this patch.