@@ -167,8 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | $this->executeList( $schemaDiff->toSaveSql( $platform ), $rname ); |
169 | 169 | $this->status( 'done' ); |
170 | - } |
|
171 | - else |
|
170 | + } else |
|
172 | 171 | { |
173 | 172 | $this->status( 'OK' ); |
174 | 173 | } |
@@ -207,8 +206,7 @@ discard block |
||
207 | 206 | |
208 | 207 | $this->executeList( $schemaDiff->toSaveSql( $platform ), $rname ); |
209 | 208 | $this->status( 'done' ); |
210 | - } |
|
211 | - else |
|
209 | + } else |
|
212 | 210 | { |
213 | 211 | $this->status( 'OK' ); |
214 | 212 | } |
@@ -229,8 +227,7 @@ discard block |
||
229 | 227 | if( $schema->columnExists( $table, 'typeid' ) ) { |
230 | 228 | $this->execute( $stmt, $rname ); |
231 | 229 | $this->status( 'done' ); |
232 | - } |
|
233 | - else |
|
230 | + } else |
|
234 | 231 | { |
235 | 232 | $this->status( 'OK' ); |
236 | 233 | } |
@@ -76,8 +76,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | ->setPreview( $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 | ->setPreview( $prefix . 'unitperf/download-preview.jpg' ) |
324 | 324 | ->setUrl( $prefix . 'unitperf/download.pdf' ) |
325 | 325 | ->setMimeType( 'application/pdf' ) |
@@ -328,7 +328,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -79,8 +79,7 @@ discard block |
||
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 |
||
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 | } |
@@ -108,9 +108,12 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function createItem( array $values = [] ) |
110 | 110 | { |
111 | - try { |
|
111 | + try |
|
112 | + { |
|
112 | 113 | $values['locale.currency.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
113 | - } catch( \Exception $e ) { |
|
114 | + } |
|
115 | + catch( \Exception $e ) |
|
116 | + { |
|
114 | 117 | $values['locale.currency.siteid'] = null; |
115 | 118 | } |
116 | 119 | |
@@ -180,8 +183,7 @@ discard block |
||
180 | 183 | * @see mshop/locale/manager/currency/standard/count/ansi |
181 | 184 | */ |
182 | 185 | $path = 'mshop/locale/manager/currency/standard/insert'; |
183 | - } |
|
184 | - else |
|
186 | + } else |
|
185 | 187 | { |
186 | 188 | /** mshop/locale/manager/currency/standard/update/mysql |
187 | 189 | * Updates an existing currency record in the database |
@@ -108,9 +108,12 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function createItem( array $values = [] ) |
110 | 110 | { |
111 | - try { |
|
111 | + try |
|
112 | + { |
|
112 | 113 | $values['locale.language.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
113 | - } catch( \Exception $ex ) { |
|
114 | + } |
|
115 | + catch( \Exception $ex ) |
|
116 | + { |
|
114 | 117 | $values['locale.language.siteid'] = null; |
115 | 118 | } |
116 | 119 | |
@@ -177,8 +180,7 @@ discard block |
||
177 | 180 | * @see mshop/locale/manager/language/standard/count/ansi |
178 | 181 | */ |
179 | 182 | $path = 'mshop/locale/manager/language/standard/insert'; |
180 | - } |
|
181 | - else |
|
183 | + } else |
|
182 | 184 | { |
183 | 185 | /** mshop/locale/manager/language/standard/update/mysql |
184 | 186 | * Updates an existing language record in the database |
@@ -155,9 +155,12 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function createItem( array $values = [] ) |
157 | 157 | { |
158 | - try { |
|
158 | + try |
|
159 | + { |
|
159 | 160 | $values['log.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
160 | - } catch( \Exception $e ) { |
|
161 | + } |
|
162 | + catch( \Exception $e ) |
|
163 | + { |
|
161 | 164 | $values['log.siteid'] = null; |
162 | 165 | } |
163 | 166 | |
@@ -182,9 +185,12 @@ discard block |
||
182 | 185 | |
183 | 186 | $context = $this->getContext(); |
184 | 187 | |
185 | - try { |
|
188 | + try |
|
189 | + { |
|
186 | 190 | $siteid = $context->getLocale()->getSiteId(); |
187 | - } catch( \Exception $e ) { |
|
191 | + } |
|
192 | + catch( \Exception $e ) |
|
193 | + { |
|
188 | 194 | $siteid = null; |
189 | 195 | } |
190 | 196 | |
@@ -234,8 +240,7 @@ discard block |
||
234 | 240 | * @see madmin/log/manager/standard/count/ansi |
235 | 241 | */ |
236 | 242 | $path = 'madmin/log/manager/standard/insert'; |
237 | - } |
|
238 | - else |
|
243 | + } else |
|
239 | 244 | { |
240 | 245 | /** madmin/log/manager/standard/update/mysql |
241 | 246 | * Updates an existing log record in the database |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function checkClass( $name, $object ) |
32 | 32 | { |
33 | - if( ($object instanceof $name) === false ) { |
|
33 | + if( ( $object instanceof $name ) === false ) { |
|
34 | 34 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Object doesn\'t implement "%1$s"', $name ) ); |
35 | 35 | } |
36 | 36 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | foreach( $list as $object ) |
52 | 52 | { |
53 | - if( ($object instanceof $name) === false ) { |
|
53 | + if( ( $object instanceof $name ) === false ) { |
|
54 | 54 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Object doesn\'t implement "%1$s"', $name ) ); |
55 | 55 | } |
56 | 56 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | throw new \Aimeos\MW\Cache\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
45 | 45 | } |
46 | 46 | |
47 | - $object = new $classname( $config, $resource ); |
|
47 | + $object = new $classname( $config, $resource ); |
|
48 | 48 | |
49 | 49 | if( !( $object instanceof $iface ) ) { |
50 | 50 | throw new \Aimeos\MW\Cache\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $iface ) ); |
@@ -217,9 +217,12 @@ discard block |
||
217 | 217 | ); |
218 | 218 | $dbm = $context->getDatabaseManager(); |
219 | 219 | |
220 | - try { |
|
220 | + try |
|
221 | + { |
|
221 | 222 | $this->object = \Aimeos\MW\Cache\Factory::create( $name, $config, $dbm ); |
222 | - } catch( \Exception $e ) { |
|
223 | + } |
|
224 | + catch( \Exception $e ) |
|
225 | + { |
|
223 | 226 | $this->object = \Aimeos\MW\Cache\Factory::create( 'DB', $config, $dbm ); |
224 | 227 | } |
225 | 228 | } |
@@ -288,9 +291,12 @@ discard block |
||
288 | 291 | */ |
289 | 292 | public function createItem( array $values = [] ) |
290 | 293 | { |
291 | - try { |
|
294 | + try |
|
295 | + { |
|
292 | 296 | $values['siteid'] = $this->getContext()->getLocale()->getSiteId(); |
293 | - } catch( \Exception $e ) { |
|
297 | + } |
|
298 | + catch( \Exception $e ) |
|
299 | + { |
|
294 | 300 | $values['siteid'] = null; |
295 | 301 | } |
296 | 302 |
@@ -404,7 +404,7 @@ |
||
404 | 404 | * Removes multiple items specified by ids in the array. |
405 | 405 | * |
406 | 406 | * @param string[] $ids List of IDs |
407 | - * @return \Aimeos\MAdmin\Cache\Manager\Iface Manager object for chaining method calls |
|
407 | + * @return \Aimeos\MAdmin\Cache\Manager\Iface Manager object for chaining method calls |
|
408 | 408 | */ |
409 | 409 | public function deleteItems( array $ids ) |
410 | 410 | { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $localeManager = \Aimeos\MShop\Locale\Manager\Factory::create( $this->additional, 'Standard' ); |
52 | 52 | |
53 | 53 | |
54 | - $filename = __DIR__ . $ds . 'default'. $ds . 'data'. $ds . 'language.php'; |
|
54 | + $filename = __DIR__ . $ds . 'default' . $ds . 'data' . $ds . 'language.php'; |
|
55 | 55 | |
56 | 56 | if( ( $data = include( $filename ) ) == false ) { |
57 | 57 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'No data file "%1$s" found', $filename ) ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | - $filename = __DIR__ . $ds . 'default'. $ds . 'data'. $ds . 'currency.php'; |
|
65 | + $filename = __DIR__ . $ds . 'default' . $ds . 'data' . $ds . 'currency.php'; |
|
66 | 66 | |
67 | 67 | if( ( $data = include( $filename ) ) == false ) { |
68 | 68 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'No data file "%1$s" found', $filename ) ); |