@@ -260,7 +260,7 @@ |
||
260 | 260 | |
261 | 261 | public function reloadSupplier( &$supplier ) |
262 | 262 | { |
263 | - $supplier = self::$supplierManager->getItem( $supplier->getId(), [ 'supplier/address' ] ); |
|
263 | + $supplier = self::$supplierManager->getItem( $supplier->getId(), ['supplier/address'] ); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 3 => 'job_csv_test2', |
76 | 76 | ); |
77 | 77 | |
78 | - $suppliersCodes = [ 'job_csv_test', 'job_csv_test2' ]; |
|
78 | + $suppliersCodes = ['job_csv_test', 'job_csv_test2']; |
|
79 | 79 | |
80 | 80 | foreach( $suppliersCodes as $code ) |
81 | 81 | { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 1 => "job_csv_test\njob_csv_test2", |
112 | 112 | ); |
113 | 113 | |
114 | - $suppliersCodes = [ 'job_csv_test', 'job_csv_test2' ]; |
|
114 | + $suppliersCodes = ['job_csv_test', 'job_csv_test2']; |
|
115 | 115 | |
116 | 116 | foreach( $suppliersCodes as $code ) |
117 | 117 | { |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $search = $manager->createSearch(); |
326 | 326 | $search->setConditions( $search->compare( '==', 'supplier.code', $code ) ); |
327 | 327 | |
328 | - if( ($item = $manager->searchItems( $search, [ 'product' ] )->first()) === null ) |
|
328 | + if( ( $item = $manager->searchItems( $search, ['product'] )->first() ) === null ) |
|
329 | 329 | { |
330 | 330 | throw new \RuntimeException( sprintf( 'No supplier item for code "%1$s"', $code ) ); |
331 | 331 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | foreach( $listItems as $listItem ) |
122 | 122 | { |
123 | - if( ($refItem = $listItem->getRefItem()) !== null ) |
|
123 | + if( ( $refItem = $listItem->getRefItem() ) !== null ) |
|
124 | 124 | { |
125 | 125 | $listMap[$refItem->getUrl()][$refItem->getType()][$listItem->getType()] = $listItem; |
126 | 126 | } |
@@ -176,13 +176,13 @@ discard block |
||
176 | 176 | return false; |
177 | 177 | } |
178 | 178 | |
179 | - if( ($type = $this->getValue( $list, 'supplier.lists.type' )) && !isset( $this->listTypes[$type] ) ) |
|
179 | + if( ( $type = $this->getValue( $list, 'supplier.lists.type' ) ) && !isset( $this->listTypes[$type] ) ) |
|
180 | 180 | { |
181 | 181 | $msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'supplier list' ); |
182 | 182 | throw new \Aimeos\Controller\Common\Exception( $msg ); |
183 | 183 | } |
184 | 184 | |
185 | - if( ($type = $this->getValue( $list, 'media.type' )) && !isset( $this->types[$type] ) ) |
|
185 | + if( ( $type = $this->getValue( $list, 'media.type' ) ) && !isset( $this->types[$type] ) ) |
|
186 | 186 | { |
187 | 187 | $msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'media' ); |
188 | 188 | throw new \Aimeos\Controller\Common\Exception( $msg ); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | foreach( $listItems as $listItem ) |
120 | 120 | { |
121 | - if( ($refItem = $listItem->getRefItem()) !== null ) |
|
121 | + if( ( $refItem = $listItem->getRefItem() ) !== null ) |
|
122 | 122 | { |
123 | 123 | $listMap[$refItem->getContent()][$refItem->getType()][$listItem->getType()] = $listItem; |
124 | 124 | } |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | return false; |
174 | 174 | } |
175 | 175 | |
176 | - if( ($type = $this->getValue( $list, 'supplier.lists.type' )) && !isset( $this->listTypes[$type] ) ) |
|
176 | + if( ( $type = $this->getValue( $list, 'supplier.lists.type' ) ) && !isset( $this->listTypes[$type] ) ) |
|
177 | 177 | { |
178 | 178 | $msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'supplier list' ); |
179 | 179 | throw new \Aimeos\Controller\Common\Exception( $msg ); |
180 | 180 | } |
181 | 181 | |
182 | - if( ($type = $this->getValue( $list, 'text.type' )) && !isset( $this->types[$type] ) ) |
|
182 | + if( ( $type = $this->getValue( $list, 'text.type' ) ) && !isset( $this->types[$type] ) ) |
|
183 | 183 | { |
184 | 184 | $msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'text' ); |
185 | 185 | throw new \Aimeos\Controller\Common\Exception( $msg ); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | continue; |
71 | 71 | } |
72 | 72 | |
73 | - if( ($item = $items->pop()) === null ) |
|
73 | + if( ( $item = $items->pop() ) === null ) |
|
74 | 74 | { |
75 | 75 | $item = $manager->createItem(); |
76 | 76 | } |
@@ -82,7 +82,8 @@ |
||
82 | 82 | $data = $this->getObject()->process( $supplier, $data ); |
83 | 83 | |
84 | 84 | $manager->commit(); |
85 | - } catch( \Exception $e ) |
|
85 | + } |
|
86 | + catch( \Exception $e ) |
|
86 | 87 | { |
87 | 88 | $manager->rollback(); |
88 | 89 | throw $e; |
@@ -74,7 +74,7 @@ |
||
74 | 74 | $search->setConditions( $search->compare( '==', 'supplier.code', $code ) ); |
75 | 75 | |
76 | 76 | |
77 | - if( ($item = $manager->searchItems( $search )->first()) !== null ) |
|
77 | + if( ( $item = $manager->searchItems( $search )->first() ) !== null ) |
|
78 | 78 | { |
79 | 79 | $this->suppliers[$code] = $item->getId(); |
80 | 80 | return $item->getId(); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | { |
154 | 154 | $code = trim( $code ); |
155 | 155 | |
156 | - if( ($catid = $this->cache->get( $code )) === null ) |
|
156 | + if( ( $catid = $this->cache->get( $code ) ) === null ) |
|
157 | 157 | { |
158 | 158 | $msg = 'No supplier for code "%1$s" available when importing product with code "%2$s"'; |
159 | 159 | throw new \Aimeos\Controller\Jobs\Exception( sprintf( $msg, $code, $product->getCode() ) ); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | return false; |
228 | 228 | } |
229 | 229 | |
230 | - if( ($type = $this->getValue( $list, 'supplier.lists.type' )) && !isset( $this->listTypes[$type] ) ) |
|
230 | + if( ( $type = $this->getValue( $list, 'supplier.lists.type' ) ) && !isset( $this->listTypes[$type] ) ) |
|
231 | 231 | { |
232 | 232 | $msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'supplier list' ); |
233 | 233 | throw new \Aimeos\Controller\Common\Exception( $msg ); |
@@ -181,7 +181,8 @@ |
||
181 | 181 | $data = $this->getObject()->process( $product, $data ); |
182 | 182 | |
183 | 183 | $manager->commit(); |
184 | - } catch( \Exception $e ) |
|
184 | + } |
|
185 | + catch( \Exception $e ) |
|
185 | 186 | { |
186 | 187 | $manager->rollback(); |
187 | 188 | throw $e; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @see controller/common/supplier/import/csv/mapping |
228 | 228 | * @see controller/common/supplier/import/csv/converter |
229 | 229 | */ |
230 | - $maxcnt = (int)$config->get( 'controller/common/supplier/import/csv/max-size', 1000 ); |
|
230 | + $maxcnt = (int) $config->get( 'controller/common/supplier/import/csv/max-size', 1000 ); |
|
231 | 231 | |
232 | 232 | |
233 | 233 | /** controller/jobs/supplier/import/csv/skip-lines |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * @see controller/jobs/supplier/import/csv/backup |
250 | 250 | * @see controller/common/supplier/import/csv/max-size |
251 | 251 | */ |
252 | - $skiplines = (int)$config->get( 'controller/jobs/supplier/import/csv/skip-lines', 0 ); |
|
252 | + $skiplines = (int) $config->get( 'controller/jobs/supplier/import/csv/skip-lines', 0 ); |
|
253 | 253 | |
254 | 254 | |
255 | 255 | /** controller/jobs/supplier/import/csv/strict |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * @see controller/jobs/supplier/import/csv/backup |
274 | 274 | * @see controller/common/supplier/import/csv/max-size |
275 | 275 | */ |
276 | - $strict = (bool)$config->get( 'controller/jobs/supplier/import/csv/strict', true ); |
|
276 | + $strict = (bool) $config->get( 'controller/jobs/supplier/import/csv/strict', true ); |
|
277 | 277 | |
278 | 278 | |
279 | 279 | /** controller/jobs/supplier/import/csv/backup |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $content->next(); |
341 | 341 | } |
342 | 342 | |
343 | - while( ($data = $this->getData( $content, $maxcnt, $codePos )) !== [] ) |
|
343 | + while( ( $data = $this->getData( $content, $maxcnt, $codePos ) ) !== [] ) |
|
344 | 344 | { |
345 | 345 | $data = $this->convertData( $convlist, $data ); |
346 | 346 | $errcnt = $this->import( $supplierMap, $data, $mappings['item'], $processor, $strict ); |
@@ -356,7 +356,8 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | $container->close(); |
359 | - } catch( \Exception $e ) |
|
359 | + } |
|
360 | + catch( \Exception $e ) |
|
360 | 361 | { |
361 | 362 | $logger->log( 'Supplier import error: ' . $e->getMessage() . "\n" . $e->getTraceAsString() ); |
362 | 363 | $this->mail( 'Supplier CSV import error', $e->getMessage() . "\n" . $e->getTraceAsString() ); |
@@ -576,7 +577,8 @@ discard block |
||
576 | 577 | } |
577 | 578 | |
578 | 579 | $manager->commit(); |
579 | - } catch( \Exception $e ) |
|
580 | + } |
|
581 | + catch( \Exception $e ) |
|
580 | 582 | { |
581 | 583 | $manager->rollback(); |
582 | 584 |