@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | continue; |
68 | 68 | } |
69 | 69 | |
70 | - if( ($item = $items->pop()) === null ) { |
|
70 | + if( ( $item = $items->pop() ) === null ) { |
|
71 | 71 | $item = $manager->createItem(); |
72 | 72 | $item->fromArray( $list ); |
73 | 73 | $supplier->addAddressItem( $item ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $data = $this->getObject()->process( $supplier, $data ); |
81 | 81 | |
82 | 82 | $manager->commit(); |
83 | - } catch ( \Exception $e ) { |
|
83 | + } catch( \Exception $e ) { |
|
84 | 84 | $manager->rollback(); |
85 | 85 | throw $e; |
86 | 86 | } |
@@ -58,7 +58,8 @@ discard block |
||
58 | 58 | $manager = \Aimeos\MShop::create( $this->getContext(), 'supplier/address' ); |
59 | 59 | $manager->begin(); |
60 | 60 | |
61 | - try { |
|
61 | + try |
|
62 | + { |
|
62 | 63 | $map = $this->getMappedChunk( $data, $this->getMapping() ); |
63 | 64 | $items = $this->getAddressItems( $supplier->getId() ); |
64 | 65 | |
@@ -80,7 +81,9 @@ discard block |
||
80 | 81 | $data = $this->getObject()->process( $supplier, $data ); |
81 | 82 | |
82 | 83 | $manager->commit(); |
83 | - } catch ( \Exception $e ) { |
|
84 | + } |
|
85 | + catch ( \Exception $e ) |
|
86 | + { |
|
84 | 87 | $manager->rollback(); |
85 | 88 | throw $e; |
86 | 89 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | protected function tearDown(): void |
52 | 52 | { |
53 | - if( self::$supplier != null ){ |
|
53 | + if( self::$supplier != null ) { |
|
54 | 54 | $this->delete( self::$supplier ); |
55 | 55 | } |
56 | 56 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $suppliersCodes = ['job_csv_test', 'job_csv_test2']; |
78 | 78 | |
79 | - foreach( $suppliersCodes as $code ){ |
|
79 | + foreach( $suppliersCodes as $code ) { |
|
80 | 80 | $this->create( $code ); |
81 | 81 | } |
82 | 82 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $suppliersCodes = ['job_csv_test', 'job_csv_test2']; |
112 | 112 | |
113 | - foreach( $suppliersCodes as $code ){ |
|
113 | + foreach( $suppliersCodes as $code ) { |
|
114 | 114 | $this->create( $code ); |
115 | 115 | } |
116 | 116 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | 3 => 'job_csv_test', |
245 | 245 | ); |
246 | 246 | |
247 | - $this->context->getConfig()->set( 'controller/common/product/import/csv/processor/supplier/listtypes', array('default') ); |
|
247 | + $this->context->getConfig()->set( 'controller/common/product/import/csv/processor/supplier/listtypes', array( 'default' ) ); |
|
248 | 248 | |
249 | 249 | self::$supplier = $this->create( 'job_csv_test' ); |
250 | 250 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $search = $manager->createSearch(); |
321 | 321 | $search->setConditions( $search->compare( '==', 'supplier.code', $code ) ); |
322 | 322 | |
323 | - if( ($item = $manager->searchItems( $search, ['product'] )->first()) === null ) { |
|
323 | + if( ( $item = $manager->searchItems( $search, ['product'] )->first() ) === null ) { |
|
324 | 324 | throw new \RuntimeException( sprintf( 'No supplier item for code "%1$s"', $code ) ); |
325 | 325 | } |
326 | 326 |