@@ -196,8 +196,7 @@ discard block |
||
196 | 196 | $ratio = ( $w < $h ? $width / $w : $height / $h ); |
197 | 197 | $newHeight = (int) $h * $ratio; |
198 | 198 | $newWidth = (int) $w * $ratio; |
199 | - } |
|
200 | - else |
|
199 | + } else |
|
201 | 200 | { |
202 | 201 | list( $newWidth, $newHeight ) = $this->getSizeFitted( $w, $h, $width, $height ); |
203 | 202 | |
@@ -261,8 +260,7 @@ discard block |
||
261 | 260 | |
262 | 261 | imagedestroy( $result ); |
263 | 262 | $newMedia->image = $newImage; |
264 | - } |
|
265 | - else |
|
263 | + } else |
|
266 | 264 | { |
267 | 265 | $newMedia->image = $result; |
268 | 266 | } |
@@ -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 | } |
@@ -201,8 +201,7 @@ discard block |
||
201 | 201 | if( $level === \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ) { |
202 | 202 | return $node; |
203 | 203 | } |
204 | - } |
|
205 | - else |
|
204 | + } else |
|
206 | 205 | { |
207 | 206 | $node = $this->getNodeById( $id ); |
208 | 207 | |
@@ -276,15 +275,13 @@ discard block |
||
276 | 275 | $node->left = $refNode->left; |
277 | 276 | $node->right = $refNode->left + 1; |
278 | 277 | $node->level = $refNode->level; |
279 | - } |
|
280 | - else if( $parentId !== null ) |
|
278 | + } else if( $parentId !== null ) |
|
281 | 279 | { |
282 | 280 | $parentNode = $this->getNode( $parentId, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ); |
283 | 281 | $node->left = $parentNode->right; |
284 | 282 | $node->right = $parentNode->right + 1; |
285 | 283 | $node->level = $parentNode->level + 1; |
286 | - } |
|
287 | - else |
|
284 | + } else |
|
288 | 285 | { |
289 | 286 | $node->left = 1; |
290 | 287 | $node->right = 2; |
@@ -375,8 +372,7 @@ discard block |
||
375 | 372 | $moveNodeRightBegin = $node->left + $diff + 1; |
376 | 373 | $moveNodeRightEnd = $node->right + $diff; |
377 | 374 | $movesize = $refNode->left - $node->left - $diff; |
378 | - } |
|
379 | - else |
|
375 | + } else |
|
380 | 376 | { |
381 | 377 | $moveNodeLeftBegin = $node->left; |
382 | 378 | $moveNodeLeftEnd = $node->right - 1; |
@@ -387,8 +383,7 @@ discard block |
||
387 | 383 | |
388 | 384 | $closeNodeLeftBegin = $node->left + $diff; |
389 | 385 | $closeNodeRightBegin = $node->left + $diff; |
390 | - } |
|
391 | - else |
|
386 | + } else |
|
392 | 387 | { |
393 | 388 | $refNode = $this->getNode( $newParentId, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ); |
394 | 389 | |
@@ -414,8 +409,7 @@ discard block |
||
414 | 409 | $moveNodeRightBegin = $node->left + $diff + 1; |
415 | 410 | $moveNodeRightEnd = $node->right + $diff; |
416 | 411 | $movesize = $refNode->right - $node->left - $diff; |
417 | - } |
|
418 | - else |
|
412 | + } else |
|
419 | 413 | { |
420 | 414 | $moveNodeLeftBegin = $node->left; |
421 | 415 | $moveNodeLeftEnd = $node->right - 1; |
@@ -206,8 +206,7 @@ |
||
206 | 206 | */ |
207 | 207 | $path = 'madmin/job/manager/insert'; |
208 | 208 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
209 | - } |
|
210 | - else |
|
209 | + } else |
|
211 | 210 | { |
212 | 211 | /** madmin/job/manager/update/mysql |
213 | 212 | * Updates an existing job record in the database |
@@ -344,7 +344,8 @@ |
||
344 | 344 | { |
345 | 345 | $stockManager->decrease( [$item->getProductId() => -1 * $how * $item->getQuantity()], $item->getStockType() ); |
346 | 346 | |
347 | - switch( $item->getType() ) { |
|
347 | + switch( $item->getType() ) |
|
348 | + { |
|
348 | 349 | case 'default': |
349 | 350 | $this->updateStockBundle( $item->getParentProductId(), $item->getStockType() ); break; |
350 | 351 | case 'select': |
@@ -196,8 +196,7 @@ |
||
196 | 196 | { |
197 | 197 | $item = $this->deletePreviews( $item, $fsname ); |
198 | 198 | $item = $this->addImages( $item, $media, $name, $fsname ); |
199 | - } |
|
200 | - else |
|
199 | + } else |
|
201 | 200 | { |
202 | 201 | $mimetype = $this->getMimeType( $media, 'files' ); |
203 | 202 | $item = $item->setPreviews( [1 => $this->getMimeIcon( $mimetype, $fsname )] ) |
@@ -482,7 +482,7 @@ |
||
482 | 482 | $siteId = $this->context->locale()->getSiteId(); |
483 | 483 | |
484 | 484 | // the "d" after {siteid} is the required extension for Windows (no dots at the and allowed) |
485 | - return "${siteId}d/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
485 | + return "${siteid}d/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
486 | 486 | } |
487 | 487 | |
488 | 488 |
@@ -203,8 +203,7 @@ |
||
203 | 203 | */ |
204 | 204 | $path = 'mshop/tag/manager/insert'; |
205 | 205 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
206 | - } |
|
207 | - else |
|
206 | + } else |
|
208 | 207 | { |
209 | 208 | /** mshop/tag/manager/update/mysql |
210 | 209 | * Updates an existing tag tag record in the database |
@@ -442,8 +442,7 @@ |
||
442 | 442 | */ |
443 | 443 | $path = 'mshop/price/manager/insert'; |
444 | 444 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
445 | - } |
|
446 | - else |
|
445 | + } else |
|
447 | 446 | { |
448 | 447 | /** mshop/price/manager/update/mysql |
449 | 448 | * Updates an existing price record in the database |
@@ -390,8 +390,7 @@ |
||
390 | 390 | */ |
391 | 391 | $path = 'mshop/service/manager/insert'; |
392 | 392 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
393 | - } |
|
394 | - else |
|
393 | + } else |
|
395 | 394 | { |
396 | 395 | /** mshop/service/manager/update/mysql |
397 | 396 | * Updates an existing service record in the database |