@@ -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; |
@@ -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 | |
@@ -155,8 +155,7 @@ |
||
| 155 | 155 | $files[] = $entry->getPathname(); |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | - } |
|
| 159 | - else |
|
| 158 | + } else |
|
| 160 | 159 | { |
| 161 | 160 | $files[] = $location; |
| 162 | 161 | } |
@@ -720,7 +720,7 @@ |
||
| 720 | 720 | $lastPos++; |
| 721 | 721 | } |
| 722 | 722 | } |
| 723 | - catch( \Exception $e ) { ; } // If no delivery service is available |
|
| 723 | + catch( \Exception $e ) {; } // If no delivery service is available |
|
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | |
@@ -725,7 +725,9 @@ |
||
| 725 | 725 | $lastPos++; |
| 726 | 726 | } |
| 727 | 727 | } |
| 728 | - catch( \Exception $e ) { ; } // If no delivery service is available |
|
| 728 | + catch( \Exception $e ) |
|
| 729 | + { |
|
| 730 | +; } // If no delivery service is available |
|
| 729 | 731 | } |
| 730 | 732 | |
| 731 | 733 | |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $feconfig['directdebit.accountowner']['default'] = $fn . ' ' . $ln; |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - catch( \Aimeos\MShop\Order\Exception $e ) { ; } // If address isn't available |
|
| 84 | + catch( \Aimeos\MShop\Order\Exception $e ) {; } // If address isn't available |
|
| 85 | 85 | |
| 86 | 86 | return $this->getConfigItems( $feconfig ); |
| 87 | 87 | } |
@@ -81,7 +81,9 @@ |
||
| 81 | 81 | $feconfig['directdebit.accountowner']['default'] = $fn . ' ' . $ln; |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - catch( \Aimeos\MShop\Order\Exception $e ) { ; } // If address isn't available |
|
| 84 | + catch( \Aimeos\MShop\Order\Exception $e ) |
|
| 85 | + { |
|
| 86 | +; } // If address isn't available |
|
| 85 | 87 | |
| 86 | 88 | return $this->getConfigItems( $feconfig ); |
| 87 | 89 | } |
@@ -117,8 +117,7 @@ |
||
| 117 | 117 | return false; |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | - } |
|
| 121 | - elseif( ( $addresses = $basket->getAddress( Address\Base::TYPE_PAYMENT ) ) !== [] ) |
|
| 120 | + } elseif( ( $addresses = $basket->getAddress( Address\Base::TYPE_PAYMENT ) ) !== [] ) |
|
| 122 | 121 | { |
| 123 | 122 | // use billing address if no delivery address is available |
| 124 | 123 | foreach( $addresses as $address ) |
@@ -98,8 +98,7 @@ |
||
| 98 | 98 | foreach( $products as $prodItem ) { // calculate bundled products |
| 99 | 99 | $sum += $qty * $prodItem->getQuantity(); |
| 100 | 100 | } |
| 101 | - } |
|
| 102 | - else |
|
| 101 | + } else |
|
| 103 | 102 | { |
| 104 | 103 | $sum += $qty; |
| 105 | 104 | } |