@@ -323,8 +323,7 @@ |
||
323 | 323 | */ |
324 | 324 | $path = 'mshop/review/manager/insert'; |
325 | 325 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
326 | - } |
|
327 | - else |
|
326 | + } else |
|
328 | 327 | { |
329 | 328 | /** mshop/review/manager/update/mysql |
330 | 329 | * Updates an existing review record in the database |
@@ -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->insert( $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 | } |
@@ -721,9 +721,12 @@ discard block |
||
721 | 721 | |
722 | 722 | foreach( $sitePath as $siteId ) |
723 | 723 | { |
724 | - try { |
|
724 | + try |
|
725 | + { |
|
725 | 726 | $path = $this->createTreeManager( $siteId )->getPath( $id ); |
726 | - } catch( \Exception $e ) { |
|
727 | + } |
|
728 | + catch( \Exception $e ) |
|
729 | + { |
|
727 | 730 | continue; |
728 | 731 | } |
729 | 732 | |
@@ -759,9 +762,12 @@ discard block |
||
759 | 762 | |
760 | 763 | foreach( $sitePath as $siteId ) |
761 | 764 | { |
762 | - try { |
|
765 | + try |
|
766 | + { |
|
763 | 767 | $node = $this->createTreeManager( $siteId )->getNode( $id, $level, $criteria ); |
764 | - } catch( \Aimeos\MW\Tree\Exception $e ) { |
|
768 | + } |
|
769 | + catch( \Aimeos\MW\Tree\Exception $e ) |
|
770 | + { |
|
765 | 771 | continue; |
766 | 772 | } |
767 | 773 | |
@@ -842,8 +848,7 @@ discard block |
||
842 | 848 | if( $child->getParentId() !== $item->getParentId() ) { |
843 | 849 | $this->move( $child->getId(), $item->getParentId(), $child->getParentId() ); |
844 | 850 | } |
845 | - } |
|
846 | - else |
|
851 | + } else |
|
847 | 852 | { |
848 | 853 | $this->insert( $child, $item->getId() ); |
849 | 854 | } |
@@ -1002,8 +1007,7 @@ discard block |
||
1002 | 1007 | */ |
1003 | 1008 | $path = 'mshop/catalog/manager/update-usage'; |
1004 | 1009 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ), false ); |
1005 | - } |
|
1006 | - else |
|
1010 | + } else |
|
1007 | 1011 | { |
1008 | 1012 | /** mshop/catalog/manager/insert-usage/mysql |
1009 | 1013 | * Updates the config, editor, ctime and mtime value of an inserted record |
@@ -1067,8 +1071,7 @@ discard block |
||
1067 | 1071 | { |
1068 | 1072 | $stmt->bind( $idx++, $siteid ); |
1069 | 1073 | $stmt->bind( $idx++, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
1070 | - } |
|
1071 | - else |
|
1074 | + } else |
|
1072 | 1075 | { |
1073 | 1076 | $stmt->bind( $idx++, $date ); // ctime |
1074 | 1077 | $stmt->bind( $idx++, $siteid ); |
@@ -72,9 +72,12 @@ |
||
72 | 72 | */ |
73 | 73 | public function execute() : \Aimeos\MW\DB\Result\Iface |
74 | 74 | { |
75 | - try { |
|
75 | + try |
|
76 | + { |
|
76 | 77 | $stmt = $this->exec(); |
77 | - } catch( \PDOException $e ) { |
|
78 | + } |
|
79 | + catch( \PDOException $e ) |
|
80 | + { |
|
78 | 81 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql . map( $this->binds )->col( 0 )->toJson(), $e->getCode(), $e->errorInfo ); |
79 | 82 | } |
80 | 83 |
@@ -178,8 +178,7 @@ discard block |
||
178 | 178 | $search->compare( '==', $prefix . '.lists.domain', $key ), |
179 | 179 | $search->compare( '==', $prefix . '.lists.type', $domain ), |
180 | 180 | ] ); |
181 | - } |
|
182 | - else |
|
181 | + } else |
|
183 | 182 | { |
184 | 183 | $list[] = $search->compare( '==', $prefix . '.lists.domain', $domain ); |
185 | 184 | } |
@@ -187,8 +186,7 @@ discard block |
||
187 | 186 | |
188 | 187 | $expr[] = $search->or( $list ); |
189 | 188 | $search->setConditions( $search->and( $expr ) ); |
190 | - } |
|
191 | - else |
|
189 | + } else |
|
192 | 190 | { |
193 | 191 | $search->setConditions( $search->compare( '==', $prefix . '.lists.parentid', $ids ) ); |
194 | 192 | } |
@@ -378,8 +378,7 @@ |
||
378 | 378 | */ |
379 | 379 | $path = 'mshop/rule/manager/insert'; |
380 | 380 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
381 | - } |
|
382 | - else |
|
381 | + } else |
|
383 | 382 | { |
384 | 383 | /** mshop/rule/manager/update/mysql |
385 | 384 | * Updates an existing rule record in the database |
@@ -38,25 +38,21 @@ |
||
38 | 38 | if( ( $content = stream_get_contents( $file ) ) === false ) { |
39 | 39 | throw new \Aimeos\MW\Media\Exception( sprintf( 'Unable to read from stream' ) ); |
40 | 40 | } |
41 | - } |
|
42 | - elseif( $file instanceof \Psr\Http\Message\StreamInterface ) |
|
41 | + } elseif( $file instanceof \Psr\Http\Message\StreamInterface ) |
|
43 | 42 | { |
44 | 43 | $content = $file->getContents(); |
45 | - } |
|
46 | - elseif( is_string( $file ) ) |
|
44 | + } elseif( is_string( $file ) ) |
|
47 | 45 | { |
48 | 46 | if( strpos( $file, "\0" ) === false && is_file( $file ) ) |
49 | 47 | { |
50 | 48 | if( ( $content = file_get_contents( $file ) ) === false ) { |
51 | 49 | throw new \Aimeos\MW\Media\Exception( sprintf( 'Unable to read from file "%1$s"', $file ) ); |
52 | 50 | } |
53 | - } |
|
54 | - else |
|
51 | + } else |
|
55 | 52 | { |
56 | 53 | $content = $file; |
57 | 54 | } |
58 | - } |
|
59 | - else |
|
55 | + } else |
|
60 | 56 | { |
61 | 57 | throw new \Aimeos\MW\Media\Exception( 'Unsupported file parameter type' ); |
62 | 58 | } |
@@ -463,7 +463,7 @@ |
||
463 | 463 | |
464 | 464 | try { |
465 | 465 | $stmt->execute()->finish(); |
466 | - } catch( \Aimeos\MW\DB\Exception $e ) { ; } // Ignore duplicates |
|
466 | + } catch( \Aimeos\MW\DB\Exception $e ) {; } // Ignore duplicates |
|
467 | 467 | } |
468 | 468 | } |
469 | 469 | } |
@@ -497,9 +497,13 @@ |
||
497 | 497 | $stmt->bind( 7, $date ); //mtime |
498 | 498 | $stmt->bind( 8, $siteid ); |
499 | 499 | |
500 | - try { |
|
500 | + try |
|
501 | + { |
|
501 | 502 | $stmt->execute()->finish(); |
502 | - } catch( \Aimeos\MW\DB\Exception $e ) { ; } // Ignore duplicates |
|
503 | + } |
|
504 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
505 | + { |
|
506 | +; } // Ignore duplicates |
|
503 | 507 | } |
504 | 508 | } |
505 | 509 | } |
@@ -46,9 +46,12 @@ |
||
46 | 46 | |
47 | 47 | foreach( $data as $entry ) |
48 | 48 | { |
49 | - try { |
|
49 | + try |
|
50 | + { |
|
50 | 51 | $manager->find( $entry['catalog.code'] ); |
51 | - } catch( \Aimeos\MW\Exception $e ) { |
|
52 | + } |
|
53 | + catch( \Aimeos\MW\Exception $e ) |
|
54 | + { |
|
52 | 55 | $manager->insert( $manager->create()->fromArray( $entry ) ); |
53 | 56 | } |
54 | 57 | } |