@@ -71,9 +71,12 @@ |
||
71 | 71 | */ |
72 | 72 | public function execute() : \Aimeos\MW\DB\Result\Iface |
73 | 73 | { |
74 | - try { |
|
74 | + try |
|
75 | + { |
|
75 | 76 | $stmt = $this->exec(); |
76 | - } catch( \PDOException $e ) { |
|
77 | + } |
|
78 | + catch( \PDOException $e ) |
|
79 | + { |
|
77 | 80 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql . map( $this->binds )->col( 0 )->toJson(), $e->getCode() ); |
78 | 81 | } |
79 | 82 |
@@ -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 |
@@ -110,9 +110,12 @@ |
||
110 | 110 | throw new Exception( 'Unable to fork new process: ' . pcntl_strerror( pcntl_get_last_error() ) ); |
111 | 111 | } |
112 | 112 | |
113 | - if( $pid === 0 ) // child process |
|
113 | + if( $pid === 0 ) { |
|
114 | + // child process |
|
114 | 115 | { |
115 | - $this->list = []; // use own child process list |
|
116 | + $this->list = []; |
|
117 | + } |
|
118 | + // use own child process list |
|
116 | 119 | exit( $this->exec( $fcn, $data ) ); |
117 | 120 | } |
118 | 121 |
@@ -82,8 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | $this->executeList( $this->updates ); |
84 | 84 | $this->status( 'done' ); |
85 | - } |
|
86 | - else |
|
85 | + } else |
|
87 | 86 | { |
88 | 87 | $this->status( 'OK' ); |
89 | 88 | } |
@@ -96,8 +95,7 @@ discard block |
||
96 | 95 | { |
97 | 96 | $this->execute( $this->column ); |
98 | 97 | $this->status( 'done' ); |
99 | - } |
|
100 | - else |
|
98 | + } else |
|
101 | 99 | { |
102 | 100 | $this->status( 'OK' ); |
103 | 101 | } |
@@ -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 | } |
@@ -107,7 +107,9 @@ discard block |
||
107 | 107 | $fs->copy( $preview, $newPath ); |
108 | 108 | $previews[$size] = $newPath; |
109 | 109 | } |
110 | - catch( \Aimeos\MW\Filesystem\Exception $e ) {} // mime icons can't be copied |
|
110 | + catch( \Aimeos\MW\Filesystem\Exception $e ) |
|
111 | + { |
|
112 | +} // mime icons can't be copied |
|
111 | 113 | } |
112 | 114 | } |
113 | 115 | |
@@ -369,7 +371,9 @@ discard block |
||
369 | 371 | $fs->rm( $preview ); |
370 | 372 | } |
371 | 373 | } |
372 | - catch( \Exception $e ) { ; } // continue if removing file fails |
|
374 | + catch( \Exception $e ) |
|
375 | + { |
|
376 | +; } // continue if removing file fails |
|
373 | 377 | } |
374 | 378 | |
375 | 379 | return $item->setPreviews( [] ); |
@@ -454,7 +454,7 @@ |
||
454 | 454 | $siteId = $this->context->getLocale()->getSiteId(); |
455 | 455 | |
456 | 456 | // the "d" after {siteid} is the required extension for Windows (no dots at the and allowed) |
457 | - return "${siteId}d/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
457 | + return "${siteid}d/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
458 | 458 | } |
459 | 459 | |
460 | 460 |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | $previews = $item->getPreviews(); |
389 | 389 | // don't delete first (smallest) image because it's referenced in past orders |
390 | - if ( 'product' === $item->getDomain() ) { |
|
390 | + if( 'product' === $item->getDomain() ) { |
|
391 | 391 | $previews = array_slice( $previews, 1 ); |
392 | 392 | } |
393 | 393 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $fs->rm( $preview ); |
400 | 400 | } |
401 | 401 | } |
402 | - catch( \Exception $e ) { ; } // continue if removing file fails |
|
402 | + catch( \Exception $e ) {; } // continue if removing file fails |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | return $item->setPreviews( [] ); |
@@ -103,8 +103,7 @@ |
||
103 | 103 | { |
104 | 104 | $this->cache[$name] = $value; |
105 | 105 | unset( $this->negCache[$name] ); |
106 | - } |
|
107 | - else |
|
106 | + } else |
|
108 | 107 | { |
109 | 108 | $this->negCache[$name] = true; |
110 | 109 | } |