Completed
Push — master ( d29f07...779818 )
by Aimeos
21:15
created
controller/common/src/Controller/Common/Order/Standard.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
 		foreach( $bundleItems as $bundleItem )
166 166
 		{
167 167
 			foreach( $bundleItem->getRefItems( 'product', null, 'default' ) as $item ) {
168
-				$bundleMap[ $item->getCode() ][] = $bundleItem->getCode();
168
+				$bundleMap[$item->getCode()][] = $bundleItem->getCode();
169 169
 			}
170 170
 		}
171 171
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -333,7 +333,8 @@
 block discarded – undo
333 333
 				{
334 334
 					$stockManager->increase( $item->getProductCode(), $item->getStockType(), $how * $item->getQuantity() );
335 335
 
336
-					switch( $item->getType() ) {
336
+					switch( $item->getType() )
337
+					{
337 338
 						case 'default':
338 339
 							$this->updateStockBundle( $item->getProductId(), $item->getStockType() ); break;
339 340
 						case 'select':
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Criteria/SQLTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		$this->object->setConditions( $this->object->combine( '&&', $expr ) );
121 121
 		$this->assertEquals( "( int_col = 1 AND ( str_col = 'test' ) )", $this->object->getConditionString( $types, $translations ) );
122 122
 
123
-		$types = array( 'column' => \Aimeos\MW\DB\Statement\Base::PARAM_BOOL);
123
+		$types = array( 'column' => \Aimeos\MW\DB\Statement\Base::PARAM_BOOL );
124 124
 		$this->object->setConditions( $this->object->compare( '==', 'column', 1 ) );
125 125
 		$this->assertEquals( "column = 1", $this->object->getConditionString( $types ) );
126 126
 	}
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
 		$types = array( 'int_column' => \Aimeos\MW\DB\Statement\Base::PARAM_INT );
132 132
 
133 133
 		$this->object->setConditions( $this->object->compare( '==', 'icol', 10 ) );
134
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
134
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
135 135
 		$this->object->getConditionString( $types );
136 136
 	}
137 137
 
138 138
 
139 139
 	public function testGetConditionStringInvalidOperator()
140 140
 	{
141
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
141
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
142 142
 		$this->object->setConditions( $this->object->compare( '?', 'int_column', 10 ) );
143 143
 	}
144 144
 
@@ -172,14 +172,14 @@  discard block
 block discarded – undo
172 172
 		$translations = array( 'asc_column' => 'asc_int_col' );
173 173
 
174 174
 		$this->object->setSortations( array( $this->object->sort( '+', 'asc_col' ) ) );
175
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
175
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
176 176
 		$this->object->getSortationString( $types, $translations );
177 177
 	}
178 178
 
179 179
 
180 180
 	public function testGetSortationStringInvalidDirection()
181 181
 	{
182
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
182
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
183 183
 		$this->object->setSortations( array( $this->object->sort( '/', 'asc_column' ) ) );
184 184
 	}
185 185
 
@@ -188,10 +188,10 @@  discard block
 block discarded – undo
188 188
 	{
189 189
 		$types = array( 'asc_column' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, 'desc_column' => \Aimeos\MW\DB\Statement\Base::PARAM_STR );
190 190
 
191
-		$this->assertEquals('asc_column ASC', $this->object->getSortationString( $types ) );
191
+		$this->assertEquals( 'asc_column ASC', $this->object->getSortationString( $types ) );
192 192
 
193 193
 		$translations = array( 'asc_column' => 'asc_int_col', 'desc_column' => 'desc_str_col' );
194
-		$this->assertEquals('asc_int_col ASC', $this->object->getSortationString( $types, $translations ));
194
+		$this->assertEquals( 'asc_int_col ASC', $this->object->getSortationString( $types, $translations ) );
195 195
 	}
196 196
 
197 197
 
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Criteria/PHPTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -78,44 +78,44 @@  discard block
 block discarded – undo
78 78
 
79 79
 		$result = $this->object->getConditionString( $types, $translations );
80 80
 		$this->assertEquals( "1 == 1", $result );
81
-		$this->assertEquals( true, eval( 'return ' . $result . ';' ) );
81
+		$this->assertEquals( true, eval( 'return '.$result.';' ) );
82 82
 
83 83
 		$expr = array( $this->object->compare( '==', 'int_value', 'a' ), $this->object->compare( '==', 'str_value', 'test' ) );
84 84
 		$this->object->setConditions( $this->object->combine( '&&', $expr ) );
85 85
 		$result = $this->object->getConditionString( $types, $translations, $plugins );
86 86
 		$this->assertEquals( "( \$intval == 10 && \$strval == 'test' )", $result );
87
-		$this->assertEquals( false, eval( 'return ' . $result . ';' ) );
87
+		$this->assertEquals( false, eval( 'return '.$result.';' ) );
88 88
 
89 89
 		$expr = array( $this->object->compare( '==', 'int_value', array( 1, 2, 4, 8 ) ), $this->object->compare( '==', 'str_value', 'test' ) );
90 90
 		$this->object->setConditions( $this->object->combine( '&&', $expr ) );
91 91
 		$result = $this->object->getConditionString( $types, $translations );
92 92
 		$this->assertEquals( "( ( \$intval == 1 || \$intval == 2 || \$intval == 4 || \$intval == 8 ) && \$strval == 'test' )", $result );
93
-		$this->assertEquals( true, eval( 'return ' . $result . ';' ) );
93
+		$this->assertEquals( true, eval( 'return '.$result.';' ) );
94 94
 
95 95
 		$expr = array( $this->object->compare( '==', 'int_value', 1 ), $this->object->compare( '!=', 'int_value', 2 ) );
96 96
 		$this->object->setConditions( $this->object->combine( '!', array( $this->object->combine( '&&', $expr ) ) ) );
97 97
 		$result = $this->object->getConditionString( $types, $translations );
98 98
 		$this->assertEquals( " ! ( \$intval == 1 && \$intval != 2 )", $result );
99
-		$this->assertEquals( false, eval( 'return ' . $result . ';' ) );
99
+		$this->assertEquals( false, eval( 'return '.$result.';' ) );
100 100
 
101 101
 		$expr = array( $this->object->compare( '==', 'int_value', null ), $this->object->compare( '!=', 'str_value', null ) );
102 102
 		$this->object->setConditions( $this->object->combine( '&&', $expr ) );
103 103
 		$result = $this->object->getConditionString( $types, $translations );
104 104
 		$this->assertEquals( "( \$intval === null && \$strval !== null )", $result );
105
-		$this->assertEquals( false, eval( 'return ' . $result . ';' ) );
105
+		$this->assertEquals( false, eval( 'return '.$result.';' ) );
106 106
 
107 107
 		$expr = array( $this->object->compare( '==', 'int_value', 1 ) );
108 108
 		$this->object->setConditions( $this->object->combine( '&&', $expr ) );
109 109
 		$result = $this->object->getConditionString( $types, $translations );
110 110
 		$this->assertEquals( "( \$intval == 1 )", $result );
111
-		$this->assertEquals( true, eval( 'return ' . $result . ';' ) );
111
+		$this->assertEquals( true, eval( 'return '.$result.';' ) );
112 112
 
113 113
 		$expr = array( $this->object->compare( '==', 'str_value', 'test' ) );
114 114
 		$expr = array( $this->object->compare( '==', 'int_value', 1 ), $this->object->combine( '&&', $expr ) );
115 115
 		$this->object->setConditions( $this->object->combine( '&&', $expr ) );
116 116
 		$result = $this->object->getConditionString( $types, $translations );
117 117
 		$this->assertEquals( "( \$intval == 1 && ( \$strval == 'test' ) )", $result );
118
-		$this->assertEquals( true, eval( 'return ' . $result . ';' ) );
118
+		$this->assertEquals( true, eval( 'return '.$result.';' ) );
119 119
 
120 120
 		$types = array( 'column' => 'bool' );
121 121
 		$this->object->setConditions( $this->object->compare( '==', 'column', 1 ) );
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
 		$types = array( 'int_value' => \Aimeos\MW\DB\Statement\Base::PARAM_INT );
129 129
 
130 130
 		$this->object->setConditions( $this->object->compare( '==', 'ival', 10 ) );
131
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
131
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
132 132
 		$this->object->getConditionString( $types );
133 133
 	}
134 134
 
135 135
 
136 136
 	public function testGetConditionStringInvalidOperator()
137 137
 	{
138
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
138
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
139 139
 		$this->object->setConditions( $this->object->compare( '?', 'int_value', 10 ) );
140 140
 	}
141 141
 
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
 		$translations = array( 'asc_array' => 'asc_int_list' );
177 177
 
178 178
 		$this->object->setSortations( array( $this->object->sort( '+', 'asc_col' ) ) );
179
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
179
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
180 180
 		$this->object->getSortationString( $types, $translations );
181 181
 	}
182 182
 
183 183
 
184 184
 	public function testGetSortationStringInvalidDirection()
185 185
 	{
186
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
186
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
187 187
 		$this->object->setSortations( array( $this->object->sort( '/', 'asc_array' ) ) );
188 188
 	}
189 189
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		$translations = array( 'asc_array' => '$ascIntList', 'desc_array' => '$descStrList' );
197 197
 
198 198
 		$result = $this->object->getSortationString( $types, $translations );
199
-		$this->assertEquals('asort($ascIntList);', $result);
199
+		$this->assertEquals( 'asort($ascIntList);', $result );
200 200
 		$this->assertEquals( array( 0 => 1, 2 => 5, 1 => 9 ), $ascIntList );
201 201
 	}
202 202
 
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Criteria/Expression/Compare/PHPTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 			'undefined' => '$undefined',
78 78
 		);
79 79
 
80
-		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'listitem', array('a', 'b', 'c') );
80
+		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'listitem', array( 'a', 'b', 'c' ) );
81 81
 		$this->assertEquals( "( \$listitem == 'a' || \$listitem == 'b' || \$listitem == 'c' )", $expr->toString( $types, $translations ) );
82 82
 
83
-		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '!=', 'listitem', array('a', 'b') );
83
+		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '!=', 'listitem', array( 'a', 'b' ) );
84 84
 		$this->assertEquals( "( \$listitem != 'a' && \$listitem != 'b' )", $expr->toString( $types, $translations ) );
85 85
 
86 86
 		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'stringvar', 'value' );
@@ -89,16 +89,16 @@  discard block
 block discarded – undo
89 89
 		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '<', 'floatvar', 0.1 );
90 90
 		$this->assertEquals( '$floatvar < 0.1', $expr->toString( $types, $translations ) );
91 91
 
92
-		$expr= new \Aimeos\MW\Criteria\Expression\Compare\PHP( '>', 'intvar', 10 );
92
+		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '>', 'intvar', 10 );
93 93
 		$this->assertEquals( '$intvar > 10', $expr->toString( $types, $translations ) );
94 94
 
95
-		$expr= new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'boolvar', true );
95
+		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'boolvar', true );
96 96
 		$this->assertEquals( '$boolvar == 1', $expr->toString( $types, $translations ) );
97 97
 
98
-		$expr= new \Aimeos\MW\Criteria\Expression\Compare\PHP( '!=', 'undefined', null );
98
+		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '!=', 'undefined', null );
99 99
 		$this->assertEquals( '$undefined !== null', $expr->toString( $types, $translations ) );
100 100
 
101
-		$expr= new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'undefined', null );
101
+		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'undefined', null );
102 102
 		$this->assertEquals( '$undefined === null', $expr->toString( $types, $translations ) );
103 103
 
104 104
 
@@ -124,15 +124,15 @@  discard block
 block discarded – undo
124 124
 			'undefined' => '$undefined',
125 125
 		);
126 126
 
127
-		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '>=', 'listitem', array('a', 'b') );
128
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
127
+		$expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '>=', 'listitem', array( 'a', 'b' ) );
128
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
129 129
 		$expr->toString( $types, $translations );
130 130
 	}
131 131
 
132 132
 	public function testToStringExcept2()
133 133
 	{
134
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
135
-		new \Aimeos\MW\Criteria\Expression\Compare\PHP('=', 'undefined', null);
134
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
135
+		new \Aimeos\MW\Criteria\Expression\Compare\PHP( '=', 'undefined', null );
136 136
 	}
137 137
 
138 138
 	public function testToStringFunction()
Please login to merge, or discard this patch.
lib/mshoplib/setup/OrderMigrateFlag.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,8 +78,7 @@  discard block
 block discarded – undo
78 78
 			{
79 79
 				$this->execute( $stmts['index'] );
80 80
 				$this->status( 'dropped' );
81
-			}
82
-			else
81
+			} else
83 82
 			{
84 83
 				$this->status( 'OK' );
85 84
 			}
@@ -125,8 +124,7 @@  discard block
 block discarded – undo
125 124
 				} else {
126 125
 					$this->status( 'OK' );
127 126
 				}
128
-			}
129
-			else
127
+			} else
130 128
 			{
131 129
 				$this->status( 'OK' );
132 130
 			}
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Service/Provider/Decorator/BaseTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@
 block discarded – undo
19 19
 
20 20
 		$servManager = \Aimeos\MShop\Service\Manager\Factory::createManager( $this->context );
21 21
 		$search = $servManager->createSearch();
22
-		$search->setConditions($search->compare('==', 'service.provider', 'Standard'));
23
-		$result = $servManager->searchItems($search, array('price'));
22
+		$search->setConditions( $search->compare( '==', 'service.provider', 'Standard' ) );
23
+		$result = $servManager->searchItems( $search, array( 'price' ) );
24 24
 
25 25
 		if( ( $item = reset( $result ) ) === false ) {
26 26
 			throw new \RuntimeException( 'No order base item found' );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Catalog/Manager/Base.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 	 * Creates the catalog item objects.
66 66
 	 *
67 67
 	 * @param array $itemMap Associative list of catalog ID / tree node pairs
68
-	 * @param array $domains List of domains (e.g. text, media) whose items should be attached to the catalog items
68
+	 * @param string[] $domains List of domains (e.g. text, media) whose items should be attached to the catalog items
69 69
 	 * @param string $prefix Domain prefix
70 70
 	 * @param array $local Associative list of IDs as keys and the associative array of items as values
71 71
 	 * @return array List of items implementing \Aimeos\MShop\Catalog\Item\Iface
Please login to merge, or discard this patch.
lib/mwlib/src/MW/DB/Statement/Base.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,9 +132,9 @@
 block discarded – undo
132 132
 					&& ( $count += substr_count( $pr, '\'' ) ) % 2 !== 0 )
133 133
 				{
134 134
 					if( ( $part = next( $parts ) ) === false ) {
135
-						throw new \Aimeos\MW\DB\Exception( 'Number of apostrophes don\'t match: ' . $sql );
135
+						throw new \Aimeos\MW\DB\Exception( 'Number of apostrophes don\'t match: '.$sql );
136 136
 					}
137
-					$temp .= '?' . $part;
137
+					$temp .= '?'.$part;
138 138
 				}
139 139
 				$result[] = $temp;
140 140
 			}
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
 	 * Reconnects to the database server if not in a transaction
175 175
 	 *
176 176
 	 * @param \Exception $e Exception to throw if a transaction is running
177
-	 * @return \Aimeos\MW\DB\Statement\Iface Object for method chaining
177
+	 * @return Base Object for method chaining
178 178
 	 * @throws \Exception If a transaction is running
179 179
 	 */
180 180
 	protected function reconnect( \Exception $e )
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Order/Manager/Base/StandardTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -335,7 +335,7 @@
 block discarded – undo
335 335
 
336 336
 	public function testSearchItemsDefault()
337 337
 	{
338
-		$search = $this->object->createSearch(  true );
338
+		$search = $this->object->createSearch( true );
339 339
 		$items = $this->object->searchItems( $search );
340 340
 
341 341
 		$this->assertEquals( 0, count( $items ) );
Please login to merge, or discard this patch.