Passed
Push — master ( 50e989...69e622 )
by Aimeos
05:21
created
lib/mshoplib/setup/unittest/SubscriptionAddTestData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 
74 74
 		foreach( $testdata['subscription'] as $key => $dataset )
75 75
 		{
76
-			$ordProdItem = $this->getOrderProductItem( $dataset['ordprodid'] ) ;
76
+			$ordProdItem = $this->getOrderProductItem( $dataset['ordprodid'] );
77 77
 
78 78
 			$item = $subscriptionManager->createItem();
79 79
 			$item->setOrderBaseId( $ordProdItem->getBaseId() );
Please login to merge, or discard this patch.
lib/mshoplib/setup/unittest/AttributeAddPropertyTestData.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 			$type->setStatus( $dataset['status'] );
88 88
 
89 89
 			$attributePropertyTypeManager->saveItem( $type );
90
-			$typeIds[ $key ] = $type->getId();
90
+			$typeIds[$key] = $type->getId();
91 91
 		}
92 92
 
93 93
 		$prodProperty = $attributePropertyManager->createItem();
94 94
 		foreach( $testdata['attribute/property'] as $key => $dataset )
95 95
 		{
96
-			if( !isset( $typeIds[ $dataset['typeid'] ] ) ) {
96
+			if( !isset( $typeIds[$dataset['typeid']] ) ) {
97 97
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'No attribute property type ID found for "%1$s"', $dataset['typeid'] ) );
98 98
 			}
99 99
 
100 100
 			$prodProperty->setId( null );
101
-			$prodProperty->setParentId( $prodIds[ $dataset['parentid'] ] );
102
-			$prodProperty->setTypeId( $typeIds[ $dataset['typeid'] ] );
101
+			$prodProperty->setParentId( $prodIds[$dataset['parentid']] );
102
+			$prodProperty->setTypeId( $typeIds[$dataset['typeid']] );
103 103
 			$prodProperty->setLanguageId( $dataset['langid'] );
104 104
 			$prodProperty->setValue( $dataset['value'] );
105 105
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$search = $attributeManager->createSearch();
123 123
 
124 124
 		foreach( $attributeManager->searchItems( $search ) as $id => $item ) {
125
-			$entry[ 'attribute/' . $item->getDomain() . '/' . $item->getType() . '/' . $item->getCode() ] = $id;
125
+			$entry['attribute/' . $item->getDomain() . '/' . $item->getType() . '/' . $item->getCode()] = $id;
126 126
 		}
127 127
 
128 128
 		return $entry;
Please login to merge, or discard this patch.
lib/mshoplib/setup/unittest/MediaAddPropertyTestData.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -86,19 +86,19 @@  discard block
 block discarded – undo
86 86
 			$type->setStatus( $dataset['status'] );
87 87
 
88 88
 			$mediaPropertyTypeManager->saveItem( $type );
89
-			$typeIds[ $key ] = $type->getId();
89
+			$typeIds[$key] = $type->getId();
90 90
 		}
91 91
 
92 92
 		$prodProperty = $mediaPropertyManager->createItem();
93 93
 		foreach( $testdata['media/property'] as $key => $dataset )
94 94
 		{
95
-			if( !isset( $typeIds[ $dataset['typeid'] ] ) ) {
95
+			if( !isset( $typeIds[$dataset['typeid']] ) ) {
96 96
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'No media property type ID found for "%1$s"', $dataset['typeid'] ) );
97 97
 			}
98 98
 
99 99
 			$prodProperty->setId( null );
100
-			$prodProperty->setParentId( $prodIds[ $dataset['parentid'] ] );
101
-			$prodProperty->setTypeId( $typeIds[ $dataset['typeid'] ] );
100
+			$prodProperty->setParentId( $prodIds[$dataset['parentid']] );
101
+			$prodProperty->setTypeId( $typeIds[$dataset['typeid']] );
102 102
 			$prodProperty->setLanguageId( $dataset['langid'] );
103 103
 			$prodProperty->setValue( $dataset['value'] );
104 104
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		$search = $mediaManager->createSearch();
122 122
 
123 123
 		foreach( $mediaManager->searchItems( $search ) as $id => $item ) {
124
-			$entry[ 'media/' . $item->getUrl() ] = $id;
124
+			$entry['media/' . $item->getUrl()] = $id;
125 125
 		}
126 126
 
127 127
 		return $entry;
Please login to merge, or discard this patch.
lib/mshoplib/setup/unittest/CustomerAddPropertyTestData.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 			$type->setStatus( $dataset['status'] );
88 88
 
89 89
 			$customerPropertyTypeManager->saveItem( $type );
90
-			$typeIds[ $key ] = $type->getId();
90
+			$typeIds[$key] = $type->getId();
91 91
 		}
92 92
 
93 93
 		$custProperty = $customerPropertyManager->createItem();
94 94
 		foreach( $testdata['customer/property'] as $key => $dataset )
95 95
 		{
96
-			if( !isset( $typeIds[ $dataset['typeid'] ] ) ) {
96
+			if( !isset( $typeIds[$dataset['typeid']] ) ) {
97 97
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'No customer property type ID found for "%1$s"', $dataset['typeid'] ) );
98 98
 			}
99 99
 
100 100
 			$custProperty->setId( null );
101
-			$custProperty->setParentId( $custIds[ $dataset['parentid'] ] );
102
-			$custProperty->setTypeId( $typeIds[ $dataset['typeid'] ] );
101
+			$custProperty->setParentId( $custIds[$dataset['parentid']] );
102
+			$custProperty->setTypeId( $typeIds[$dataset['typeid']] );
103 103
 			$custProperty->setLanguageId( $dataset['langid'] );
104 104
 			$custProperty->setValue( $dataset['value'] );
105 105
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$search = $customerManager->createSearch();
123 123
 
124 124
 		foreach( $customerManager->searchItems( $search ) as $id => $item ) {
125
-			$entry[ 'customer/' . $item->getCode() ] = $id;
125
+			$entry['customer/' . $item->getCode()] = $id;
126 126
 		}
127 127
 
128 128
 		return $entry;
Please login to merge, or discard this patch.
lib/mshoplib/setup/unittest/SupplierListAddTestData.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 		$ds = DIRECTORY_SEPARATOR;
50 50
 		$path = __DIR__ . $ds . 'data' . $ds . 'supplier-list.php';
51 51
 
52
-		if( ( $testdata = include( $path ) ) == false ){
52
+		if( ( $testdata = include( $path ) ) == false ) {
53 53
 			throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for supplier list domain', $path ) );
54 54
 		}
55 55
 
56 56
 		$refKeys = [];
57 57
 		foreach( $testdata['supplier/lists'] as $dataset ) {
58
-			$refKeys[ $dataset['domain'] ][] = $dataset['refid'];
58
+			$refKeys[$dataset['domain']][] = $dataset['refid'];
59 59
 		}
60 60
 
61 61
 		$refIds = [];
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		$codes = [];
119 119
 		foreach( $keys as $dataset )
120 120
 		{
121
-			if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos+1 ) ) === false ) {
121
+			if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos + 1 ) ) === false ) {
122 122
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for ref products are set wrong "%1$s"', $dataset ) );
123 123
 			}
124 124
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 		$refIds = [];
132 132
 		foreach( $manager->searchItems( $search ) as $item ) {
133
-			$refIds[ 'product/' . $item->getCode() ] = $item->getId();
133
+			$refIds['product/' . $item->getCode()] = $item->getId();
134 134
 		}
135 135
 
136 136
 		return $refIds;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		$labels = [];
151 151
 		foreach( $keys as $dataset )
152 152
 		{
153
-			if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos+1 ) ) === false ) {
153
+			if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos + 1 ) ) === false ) {
154 154
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for ref text are set wrong "%1$s"', $dataset ) );
155 155
 			}
156 156
 
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 		$search->setConditions( $search->compare( '==', 'text.label', $labels ) );
162 162
 
163 163
 		$refIds = [];
164
-		foreach( $textManager->searchItems( $search ) as $item )	{
165
-			$refIds[ 'text/'.$item->getLabel() ] = $item->getId();
164
+		foreach( $textManager->searchItems( $search ) as $item ) {
165
+			$refIds['text/' . $item->getLabel()] = $item->getId();
166 166
 		}
167 167
 
168 168
 		return $refIds;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 		$itemCode = [];
187 187
 		foreach( $testdata['supplier/lists'] as $dataset )
188 188
 		{
189
-			if( ( $pos = strpos( $dataset['parentid'], '/' ) ) === false || ( $str = substr( $dataset['parentid'], $pos+1 ) ) === false ) {
189
+			if( ( $pos = strpos( $dataset['parentid'], '/' ) ) === false || ( $str = substr( $dataset['parentid'], $pos + 1 ) ) === false ) {
190 190
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for parentid are set wrong "%1$s"', $dataset['parentid'] ) );
191 191
 			}
192 192
 
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
 		}
195 195
 
196 196
 		$search = $supplierManager->createSearch();
197
-		$search->setConditions( $search->compare( '==', 'supplier.code', $itemCode) );
197
+		$search->setConditions( $search->compare( '==', 'supplier.code', $itemCode ) );
198 198
 
199 199
 		$parentIds = [];
200
-		foreach( $supplierManager->searchItems( $search ) as $item )	{
201
-			$parentIds[ 'supplier/'.$item->getCode() ] = $item->getId();
200
+		foreach( $supplierManager->searchItems( $search ) as $item ) {
201
+			$parentIds['supplier/' . $item->getCode()] = $item->getId();
202 202
 		}
203 203
 
204 204
 		$listItemTypeIds = [];
@@ -215,28 +215,28 @@  discard block
 block discarded – undo
215 215
 			$listItemType->setStatus( $dataset['status'] );
216 216
 
217 217
 			$supplierListTypeManager->saveItem( $listItemType );
218
-			$listItemTypeIds[ $key ] = $listItemType->getId();
218
+			$listItemTypeIds[$key] = $listItemType->getId();
219 219
 		}
220 220
 
221 221
 		$listItem = $supplierListManager->createItem();
222 222
 		foreach( $testdata['supplier/lists'] as $dataset )
223 223
 		{
224
-			if( !isset( $parentIds[ $dataset['parentid'] ] ) ) {
224
+			if( !isset( $parentIds[$dataset['parentid']] ) ) {
225 225
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'No supplier ID found for "%1$s"', $dataset['parentid'] ) );
226 226
 			}
227 227
 
228
-			if( !isset( $refIds[ $dataset['domain'] ][ $dataset['refid'] ] ) ) {
228
+			if( !isset( $refIds[$dataset['domain']][$dataset['refid']] ) ) {
229 229
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'No "%2$s" ref ID found for "%1$s"', $dataset['refid'], $dataset['domain'] ) );
230 230
 			}
231 231
 
232
-			if( !isset( $listItemTypeIds[ $dataset['typeid'] ] ) ) {
232
+			if( !isset( $listItemTypeIds[$dataset['typeid']] ) ) {
233 233
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'No supplier list type ID found for "%1$s"', $dataset['typeid'] ) );
234 234
 			}
235 235
 
236 236
 			$listItem->setId( null );
237
-			$listItem->setParentId( $parentIds[ $dataset['parentid'] ] );
238
-			$listItem->setTypeId( $listItemTypeIds[ $dataset['typeid'] ] );
239
-			$listItem->setRefId( $refIds[ $dataset['domain'] ] [ $dataset['refid'] ] );
237
+			$listItem->setParentId( $parentIds[$dataset['parentid']] );
238
+			$listItem->setTypeId( $listItemTypeIds[$dataset['typeid']] );
239
+			$listItem->setRefId( $refIds[$dataset['domain']] [$dataset['refid']] );
240 240
 			$listItem->setDomain( $dataset['domain'] );
241 241
 			$listItem->setDateStart( $dataset['start'] );
242 242
 			$listItem->setDateEnd( $dataset['end'] );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Common/Manager/Address/Base.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
 			$stmt->bind( 6, $item->getFirstname() );
140 140
 			$stmt->bind( 7, $item->getLastname() );
141 141
 			$stmt->bind( 8, $item->getAddress1() );
142
-			$stmt->bind( 9, $item->getAddress2());
142
+			$stmt->bind( 9, $item->getAddress2() );
143 143
 			$stmt->bind( 10, $item->getAddress3() );
144 144
 			$stmt->bind( 11, $item->getPostal() );
145 145
 			$stmt->bind( 12, $item->getCity() );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Common/Manager/Property/Base.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
 			$results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level );
230 230
 			while( ( $row = $results->fetch() ) !== false )
231 231
 			{
232
-				$map[ $row[$this->prefix . 'id'] ] = $row;
233
-				$typeIds[ $row[$this->prefix . 'typeid'] ] = null;
232
+				$map[$row[$this->prefix . 'id']] = $row;
233
+				$typeIds[$row[$this->prefix . 'typeid']] = null;
234 234
 			}
235 235
 
236 236
 			$dbm->release( $conn, $dbname );
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
 
252 252
 			foreach( $map as $id => $row )
253 253
 			{
254
-				if( isset( $typeItems[ $row[$this->prefix . 'typeid'] ] ) )
254
+				if( isset( $typeItems[$row[$this->prefix . 'typeid']] ) )
255 255
 				{
256
-					$row[$this->prefix . 'type'] = $typeItems[ $row[$this->prefix . 'typeid'] ]->getCode();
257
-					$row[$this->prefix . 'typename'] = $typeItems[ $row[$this->prefix . 'typeid'] ]->getName();
256
+					$row[$this->prefix . 'type'] = $typeItems[$row[$this->prefix . 'typeid']]->getCode();
257
+					$row[$this->prefix . 'typename'] = $typeItems[$row[$this->prefix . 'typeid']]->getName();
258 258
 				}
259 259
 
260 260
 				$items[$id] = $this->createItemBase( $row );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Common/Item/Helper/Password/Hash.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@
 block discarded – undo
55 55
 		$iterations = ( isset( $this->options['iterations'] ) ? (int) $this->options['iterations'] : 1 );
56 56
 
57 57
 		$salted = sprintf( $format, $password, $salt );
58
-		$digest = hash( $this->options['algorithm'], $salted, true);
58
+		$digest = hash( $this->options['algorithm'], $salted, true );
59 59
 
60 60
 		// "stretch" hash
61
-		for ($i = 1; $i < $iterations; $i++ ) {
62
-			$digest = hash( $this->options['algorithm'], $digest . $salted, true);
61
+		for( $i = 1; $i < $iterations; $i++ ) {
62
+			$digest = hash( $this->options['algorithm'], $digest . $salted, true );
63 63
 		}
64 64
 
65 65
 		return ( $encode ? base64_encode( $digest ) : bin2hex( $digest ) );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Index/Manager/Attribute/Standard.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -713,7 +713,7 @@
 block discarded – undo
713 713
 
714 714
 				try {
715 715
 					$stmt->execute()->finish();
716
-				} catch( \Aimeos\MW\DB\Exception $e ) { ; } // Ignore duplicates
716
+				} catch( \Aimeos\MW\DB\Exception $e ) {; } // Ignore duplicates
717 717
 			}
718 718
 		}
719 719
 	}
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,7 +73,8 @@  discard block
 block discarded – undo
73 73
 			$siteIds = array_merge( $siteIds, $locale->getSiteSubTree() );
74 74
 		}
75 75
 
76
-		$this->searchConfig['index.attribute:all']['function'] = function( $source, array $params ) {
76
+		$this->searchConfig['index.attribute:all']['function'] = function( $source, array $params )
77
+		{
77 78
 			return [$params[0], count( explode( ',', $params[0] ) )];
78 79
 		};
79 80
 
@@ -673,9 +674,13 @@  discard block
 block discarded – undo
673 674
 				$stmt->bind( 6, $date ); // mtime
674 675
 				$stmt->bind( 7, $siteid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
675 676
 
676
-				try {
677
+				try
678
+				{
677 679
 					$stmt->execute()->finish();
678
-				} catch( \Aimeos\MW\DB\Exception $e ) { ; } // Ignore duplicates
680
+				}
681
+				catch( \Aimeos\MW\DB\Exception $e )
682
+				{
683
+; } // Ignore duplicates
679 684
 			}
680 685
 		}
681 686
 	}
Please login to merge, or discard this patch.