@@ -77,8 +77,7 @@ |
||
77 | 77 | { |
78 | 78 | $this->addDemoData(); |
79 | 79 | $this->status( 'added' ); |
80 | - } |
|
81 | - else |
|
80 | + } else |
|
82 | 81 | { |
83 | 82 | $this->status( 'removed' ); |
84 | 83 | } |
@@ -101,7 +101,7 @@ |
||
101 | 101 | protected function addDemoData() |
102 | 102 | { |
103 | 103 | $ds = DIRECTORY_SEPARATOR; |
104 | - $path = __DIR__ . $ds . 'data' . $ds . 'demo-product.php'; |
|
104 | + $path = __DIR__.$ds.'data'.$ds.'demo-product.php'; |
|
105 | 105 | |
106 | 106 | if( ( $data = include( $path ) ) == false ) { |
107 | 107 | throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for product domain', $path ) ); |
@@ -201,9 +201,12 @@ discard block |
||
201 | 201 | ); |
202 | 202 | $dbm = $context->getDatabaseManager(); |
203 | 203 | |
204 | - try { |
|
204 | + try |
|
205 | + { |
|
205 | 206 | $this->object = \Aimeos\MW\Cache\Factory::createManager( $name, $config, $dbm ); |
206 | - } catch( \Exception $e ) { |
|
207 | + } |
|
208 | + catch( \Exception $e ) |
|
209 | + { |
|
207 | 210 | $this->object = \Aimeos\MW\Cache\Factory::createManager( 'DB', $config, $dbm ); |
208 | 211 | } |
209 | 212 | } |
@@ -265,9 +268,12 @@ discard block |
||
265 | 268 | */ |
266 | 269 | public function createItem() |
267 | 270 | { |
268 | - try { |
|
271 | + try |
|
272 | + { |
|
269 | 273 | $values = array( 'siteid' => $this->getContext()->getLocale()->getSiteId() ); |
270 | - } catch( \Exception $e ) { |
|
274 | + } |
|
275 | + catch( \Exception $e ) |
|
276 | + { |
|
271 | 277 | $values = array( 'siteid' => null ); |
272 | 278 | } |
273 | 279 |
@@ -243,8 +243,7 @@ |
||
243 | 243 | $stmt->bind( 8, $pos, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
244 | 244 | |
245 | 245 | $stmt->execute()->finish(); |
246 | - } |
|
247 | - else |
|
246 | + } else |
|
248 | 247 | { |
249 | 248 | $sql = $this->getSqlConfig( $cfgPath . 'getposmax' ); |
250 | 249 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function aggregate( \Aimeos\MW\Criteria\Iface $search, $key ) |
66 | 66 | { |
67 | 67 | $required = array( trim( $this->prefix, '.' ) ); |
68 | - return $this->aggregateBase( $search, $key, $this->getConfigPath() . 'aggregate', $required ); |
|
68 | + return $this->aggregateBase( $search, $key, $this->getConfigPath().'aggregate', $required ); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function createItem() |
78 | 78 | { |
79 | 79 | $values = array( |
80 | - $this->prefix . 'siteid' => $this->getContext()->getLocale()->getSiteId() |
|
80 | + $this->prefix.'siteid' => $this->getContext()->getLocale()->getSiteId() |
|
81 | 81 | ); |
82 | 82 | return $this->createItemBase( $values ); |
83 | 83 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | $time = date( 'Y-m-d H:i:s' ); |
122 | - $stmt = $this->getCachedStatement( $conn, $this->getConfigPath() . $type ); |
|
122 | + $stmt = $this->getCachedStatement( $conn, $this->getConfigPath().$type ); |
|
123 | 123 | |
124 | 124 | $stmt->bind( 1, $item->getParentId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
125 | 125 | $stmt->bind( 2, $item->getTypeId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if( $fetch === true ) |
147 | 147 | { |
148 | 148 | if( $id === null ) { |
149 | - $path = $this->getConfigPath() . 'newid'; |
|
149 | + $path = $this->getConfigPath().'newid'; |
|
150 | 150 | $item->setId( $this->newId( $conn, $path ) ); |
151 | 151 | } else { |
152 | 152 | $item->setId( $id ); // modified false |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function deleteItems( array $ids ) |
174 | 174 | { |
175 | - $this->deleteItemsBase( $ids, $this->getConfigPath() . 'delete' ); |
|
175 | + $this->deleteItemsBase( $ids, $this->getConfigPath().'delete' ); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | $newpos = $pos; |
246 | 246 | |
247 | - $sql = $this->getSqlConfig( $cfgPath . 'move' ); |
|
247 | + $sql = $this->getSqlConfig( $cfgPath.'move' ); |
|
248 | 248 | |
249 | 249 | $stmt = $conn->create( $sql ); |
250 | 250 | $stmt->bind( 1, +1, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | else |
262 | 262 | { |
263 | - $sql = $this->getSqlConfig( $cfgPath . 'getposmax' ); |
|
263 | + $sql = $this->getSqlConfig( $cfgPath.'getposmax' ); |
|
264 | 264 | |
265 | 265 | $stmt = $conn->create( $sql ); |
266 | 266 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | } |
280 | 280 | |
281 | - $sql = $this->getSqlConfig( $cfgPath . 'updatepos' ); |
|
281 | + $sql = $this->getSqlConfig( $cfgPath.'updatepos' ); |
|
282 | 282 | |
283 | 283 | $stmt = $conn->create( $sql ); |
284 | 284 | $stmt->bind( 1, $newpos, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | |
296 | 296 | if( $oldpos > 0 ) |
297 | 297 | { |
298 | - $sql = $this->getSqlConfig( $cfgPath . 'move' ); |
|
298 | + $sql = $this->getSqlConfig( $cfgPath.'move' ); |
|
299 | 299 | |
300 | 300 | $stmt = $conn->create( $sql ); |
301 | 301 | $stmt->bind( 1, -1, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | } |
346 | 346 | |
347 | 347 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
348 | - $cfgPathSearch = $this->getConfigPath() . 'search'; |
|
349 | - $cfgPathCount = $this->getConfigPath() . 'count'; |
|
348 | + $cfgPathSearch = $this->getConfigPath().'search'; |
|
349 | + $cfgPathCount = $this->getConfigPath().'count'; |
|
350 | 350 | |
351 | 351 | $name = trim( $this->prefix, '.' ); |
352 | 352 | $required = array( $name ); |
@@ -355,12 +355,12 @@ discard block |
||
355 | 355 | |
356 | 356 | while( ( $row = $results->fetch() ) !== false ) |
357 | 357 | { |
358 | - if( ( $row[$this->prefix . 'config'] = json_decode( $row[$this->prefix . 'config'], true ) ) === null ) { |
|
359 | - $row[$this->prefix . 'config'] = []; |
|
358 | + if( ( $row[$this->prefix.'config'] = json_decode( $row[$this->prefix.'config'], true ) ) === null ) { |
|
359 | + $row[$this->prefix.'config'] = []; |
|
360 | 360 | } |
361 | 361 | |
362 | - $map[$row[$this->prefix . 'id']] = $row; |
|
363 | - $typeIds[$row[$this->prefix . 'typeid']] = null; |
|
362 | + $map[$row[$this->prefix.'id']] = $row; |
|
363 | + $typeIds[$row[$this->prefix.'typeid']] = null; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | $dbm->release( $conn, $dbname ); |
@@ -375,19 +375,19 @@ discard block |
||
375 | 375 | { |
376 | 376 | $typeManager = $this->getObject()->getSubManager( 'type' ); |
377 | 377 | $typeSearch = $typeManager->createSearch(); |
378 | - $typeSearch->setConditions( $typeSearch->compare( '==', $name . '.type.id', array_keys( $typeIds ) ) ); |
|
378 | + $typeSearch->setConditions( $typeSearch->compare( '==', $name.'.type.id', array_keys( $typeIds ) ) ); |
|
379 | 379 | $typeSearch->setSlice( 0, $search->getSliceSize() ); |
380 | 380 | $typeItems = $typeManager->searchItems( $typeSearch ); |
381 | 381 | |
382 | 382 | foreach( $map as $id => $row ) |
383 | 383 | { |
384 | - if( isset( $typeItems[$row[$this->prefix . 'typeid']] ) ) |
|
384 | + if( isset( $typeItems[$row[$this->prefix.'typeid']] ) ) |
|
385 | 385 | { |
386 | - $row[$this->prefix . 'type'] = $typeItems[$row[$this->prefix . 'typeid']]->getCode(); |
|
387 | - $row[$this->prefix . 'typename'] = $typeItems[$row[$this->prefix . 'typeid']]->getName(); |
|
386 | + $row[$this->prefix.'type'] = $typeItems[$row[$this->prefix.'typeid']]->getCode(); |
|
387 | + $row[$this->prefix.'typename'] = $typeItems[$row[$this->prefix.'typeid']]->getName(); |
|
388 | 388 | } |
389 | 389 | |
390 | - $items[$row[$this->prefix . 'id']] = $this->createItemBase( $row ); |
|
390 | + $items[$row[$this->prefix.'id']] = $this->createItemBase( $row ); |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | } |
427 | 427 | |
428 | 428 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
429 | - $cfgPathSearch = $this->getConfigPath() . 'search'; |
|
430 | - $cfgPathCount = $this->getConfigPath() . 'count'; |
|
429 | + $cfgPathSearch = $this->getConfigPath().'search'; |
|
430 | + $cfgPathCount = $this->getConfigPath().'count'; |
|
431 | 431 | |
432 | 432 | $name = trim( $this->prefix, '.' ); |
433 | 433 | $required = array( $name ); |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | $results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level ); |
436 | 436 | |
437 | 437 | while( ( $row = $results->fetch() ) !== false ) { |
438 | - $map[$row[$this->prefix . 'domain']][] = $row[$this->prefix . 'refid']; |
|
438 | + $map[$row[$this->prefix.'domain']][] = $row[$this->prefix.'refid']; |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | $dbm->release( $conn, $dbname ); |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | |
454 | 454 | $search = $manager->createSearch( true ); |
455 | 455 | $expr = array( |
456 | - $search->compare( '==', str_replace( '/', '.', $domain ) . '.id', $list ), |
|
456 | + $search->compare( '==', str_replace( '/', '.', $domain ).'.id', $list ), |
|
457 | 457 | $search->getConditions(), |
458 | 458 | ); |
459 | 459 | $search->setConditions( $search->combine( '&&', $expr ) ); |
@@ -482,13 +482,13 @@ discard block |
||
482 | 482 | $expr = [$object->getConditions()]; |
483 | 483 | |
484 | 484 | $exprTwo = []; |
485 | - $exprTwo[] = $object->compare( '<=', $prefix . '.datestart', $this->date ); |
|
486 | - $exprTwo[] = $object->compare( '==', $prefix . '.datestart', null ); |
|
485 | + $exprTwo[] = $object->compare( '<=', $prefix.'.datestart', $this->date ); |
|
486 | + $exprTwo[] = $object->compare( '==', $prefix.'.datestart', null ); |
|
487 | 487 | $expr[] = $object->combine( '||', $exprTwo ); |
488 | 488 | |
489 | 489 | $exprTwo = []; |
490 | - $exprTwo[] = $object->compare( '>=', $prefix . '.dateend', $this->date ); |
|
491 | - $exprTwo[] = $object->compare( '==', $prefix . '.dateend', null ); |
|
490 | + $exprTwo[] = $object->compare( '>=', $prefix.'.dateend', $this->date ); |
|
491 | + $exprTwo[] = $object->compare( '==', $prefix.'.dateend', null ); |
|
492 | 492 | $expr[] = $object->combine( '||', $exprTwo ); |
493 | 493 | |
494 | 494 | $object->setConditions( $object->combine( '&&', $expr ) ); |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | */ |
510 | 510 | public function getSubManager( $manager, $name = null ) |
511 | 511 | { |
512 | - return $this->getSubManagerBase( 'common', 'lists/' . $manager, $name ); |
|
512 | + return $this->getSubManagerBase( 'common', 'lists/'.$manager, $name ); |
|
513 | 513 | } |
514 | 514 | |
515 | 515 |
@@ -50,8 +50,7 @@ |
||
50 | 50 | if( isset( $config['fixedrebate.rebate'][$currency] ) ) { |
51 | 51 | $rebate = $config['fixedrebate.rebate'][$currency]; |
52 | 52 | } |
53 | - } |
|
54 | - else |
|
53 | + } else |
|
55 | 54 | { |
56 | 55 | $rebate = $config['fixedrebate.rebate']; |
57 | 56 | } |
@@ -209,7 +209,7 @@ |
||
209 | 209 | { |
210 | 210 | $path = 'mshop/plugin/manager/submanagers'; |
211 | 211 | |
212 | - return $this->getResourceTypeBase( 'plugin', $path, array( 'type'), $withsub ); |
|
212 | + return $this->getResourceTypeBase( 'plugin', $path, array( 'type' ), $withsub ); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 |
@@ -444,8 +444,7 @@ |
||
444 | 444 | * @see mshop/plugin/manager/standard/count/ansi |
445 | 445 | */ |
446 | 446 | $path = 'mshop/plugin/manager/standard/insert'; |
447 | - } |
|
448 | - else |
|
447 | + } else |
|
449 | 448 | { |
450 | 449 | /** mshop/plugin/manager/standard/update/mysql |
451 | 450 | * Updates an existing plugin record in the database |
@@ -118,10 +118,11 @@ |
||
118 | 118 | ) { |
119 | 119 | return false; |
120 | 120 | } |
121 | - } |
|
122 | - else if( isset( $addresses[$paymentType] ) ) // use billing address if no delivery address is available |
|
121 | + } else if( isset( $addresses[$paymentType] ) ) { |
|
122 | + // use billing address if no delivery address is available |
|
123 | 123 | { |
124 | 124 | $code = strtoupper( $addresses[$paymentType]->getCountryId() ); |
125 | + } |
|
125 | 126 | |
126 | 127 | if( $this->checkCountryCode( $code, 'country.delivery-include' ) === false |
127 | 128 | || $this->checkCountryCode( $code, 'country.delivery-exclude' ) === true |
@@ -90,8 +90,8 @@ |
||
90 | 90 | |
91 | 91 | foreach( $required as $entry ) |
92 | 92 | { |
93 | - if ( !isset($params[$entry]) ) { |
|
94 | - throw new \Aimeos\MW\Common\Exception( sprintf('Required parameter "%1$s" is missing', $entry) ); |
|
93 | + if( !isset( $params[$entry] ) ) { |
|
94 | + throw new \Aimeos\MW\Common\Exception( sprintf( 'Required parameter "%1$s" is missing', $entry ) ); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 |
@@ -226,8 +226,7 @@ |
||
226 | 226 | |
227 | 227 | $params[] = implode( ',', $list ); |
228 | 228 | } |
229 | - } |
|
230 | - else |
|
229 | + } else |
|
231 | 230 | { |
232 | 231 | $params[] = $this->escape( '==', $this->getParamType( $string ), $string ); |
233 | 232 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public static function createFunction( $name, array $params ) |
34 | 34 | { |
35 | - return $name . '(' . self::createSignature( $params ) . ')'; |
|
35 | + return $name.'('.self::createSignature( $params ).')'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | case 'double': |
56 | 56 | $list[] = $param; break; |
57 | 57 | case 'array': |
58 | - $list[] = '[' . self::createSignature( $param ) . ']'; break; |
|
58 | + $list[] = '['.self::createSignature( $param ).']'; break; |
|
59 | 59 | default: |
60 | - $list[] = '"' . $param . '"'; |
|
60 | + $list[] = '"'.$param.'"'; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | protected function isFunction( &$name, array &$params ) |
78 | 78 | { |
79 | 79 | $len = strlen( $name ); |
80 | - if( $len === 0 || $name[$len-1] !== ')' ) { return false; } |
|
80 | + if( $len === 0 || $name[$len - 1] !== ')' ) { return false; } |
|
81 | 81 | |
82 | 82 | if( ( $pos = strpos( $name, '(' ) ) === false ) { |
83 | 83 | throw new \Aimeos\MW\Common\Exception( 'Missing opening bracket for function syntax' ); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $params = $this->extractParams( $matches[1] ); |
103 | 103 | } |
104 | 104 | |
105 | - $name = $namestr . '()'; |
|
105 | + $name = $namestr.'()'; |
|
106 | 106 | return true; |
107 | 107 | } |
108 | 108 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $count = count( $params ); |
131 | 131 | |
132 | 132 | for( $i = 0; $i < $count; $i++ ) { |
133 | - $find[$i] = '$' . ( $i + 1 ); |
|
133 | + $find[$i] = '$'.( $i + 1 ); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | return str_replace( $find, $params, $transname ); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | protected function setPlugins( array $plugins ) |
170 | 170 | { |
171 | - \Aimeos\MW\Common\Base::checkClassList('\\Aimeos\\MW\\Criteria\\Plugin\\Iface', $plugins); |
|
171 | + \Aimeos\MW\Common\Base::checkClassList( '\\Aimeos\\MW\\Criteria\\Plugin\\Iface', $plugins ); |
|
172 | 172 | |
173 | 173 | $this->plugins = $plugins; |
174 | 174 | } |
@@ -185,12 +185,10 @@ |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | return 'string'; |
188 | - } |
|
189 | - else if( strpos( $item, '.' ) !== false ) |
|
188 | + } else if( strpos( $item, '.' ) !== false ) |
|
190 | 189 | { |
191 | 190 | return 'float'; |
192 | - } |
|
193 | - else if( ctype_digit( $item ) !== false ) |
|
191 | + } else if( ctype_digit( $item ) !== false ) |
|
194 | 192 | { |
195 | 193 | return 'int'; |
196 | 194 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | protected function createTerm( $name, $type, $value ) |
63 | 63 | { |
64 | 64 | $escaped = $this->escape( $this->getOperator(), $type, $value ); |
65 | - return $name . ' ' . self::$operators[$this->getOperator()] . ' ' . $escaped; |
|
65 | + return $name.' '.self::$operators[$this->getOperator()].' '.$escaped; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | switch( $this->getOperator() ) |
78 | 78 | { |
79 | 79 | case '==': |
80 | - return $name . ' === null'; |
|
80 | + return $name.' === null'; |
|
81 | 81 | case '!=': |
82 | - return $name . ' !== null'; |
|
82 | + return $name.' !== null'; |
|
83 | 83 | default: |
84 | 84 | throw new \Aimeos\MW\Common\Exception( sprintf( 'null value not allowed for operator "%1$s"', $this->getOperator() ) ); |
85 | 85 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | foreach( (array) $this->getValue() as $value ) { |
104 | 104 | $list[] = $this->createTerm( $name, $type, $value ); |
105 | 105 | } |
106 | - return '( ' . implode( ' || ', $list ) . ' )'; |
|
106 | + return '( '.implode( ' || ', $list ).' )'; |
|
107 | 107 | |
108 | 108 | case '!=': |
109 | 109 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach( (array) $this->getValue() as $value ) { |
112 | 112 | $list[] = $this->createTerm( $name, $type, $value ); |
113 | 113 | } |
114 | - return '( ' . implode( ' && ', $list ) . ' )'; |
|
114 | + return '( '.implode( ' && ', $list ).' )'; |
|
115 | 115 | |
116 | 116 | default: |
117 | 117 | throw new \Aimeos\MW\Common\Exception( sprintf( 'List Term not allowed for operator "%1$s"', $this->getOperator() ) ); |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | $string = $this->escape( $this->getOperator(), $type, $val ); |
136 | 136 | |
137 | 137 | while( ( $val = next( $values ) ) !== false ) { |
138 | - $string .= ',' . $this->escape( $this->getOperator(), $type, $val ); |
|
138 | + $string .= ','.$this->escape( $this->getOperator(), $type, $val ); |
|
139 | 139 | } |
140 | 140 | |
141 | - return 'array(' . $string . ')'; |
|
141 | + return 'array('.$string.')'; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | case 'float': |
164 | 164 | $value = (double) $value; break; |
165 | 165 | default: |
166 | - $value = '\'' . addcslashes( $value, '\'' ) . '\''; |
|
166 | + $value = '\''.addcslashes( $value, '\'' ).'\''; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | return $value; |