@@ -96,9 +96,11 @@ |
||
96 | 96 | $code = $orderProduct->getProductCode(); |
97 | 97 | $prodMap[$code] = ( isset( $prodMap[$code] ) ? $prodMap[$code] + $qty : $qty ); |
98 | 98 | |
99 | - foreach( $orderProduct->getProducts() as $prodItem ) // calculate bundled products |
|
99 | + foreach( $orderProduct->getProducts() as $prodItem ) { |
|
100 | + // calculate bundled products |
|
100 | 101 | { |
101 | 102 | $qty = $prodItem->getQuantity(); |
103 | + } |
|
102 | 104 | $code = $prodItem->getProductCode(); |
103 | 105 | $prodMap[$code] = ( isset( $prodMap[$code] ) ? $prodMap[$code] + $qty : $qty ); |
104 | 106 | } |
@@ -119,12 +119,13 @@ |
||
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | } |
122 | - } |
|
123 | - elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) // use billing address if no delivery address is available |
|
122 | + } elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) { |
|
123 | + // use billing address if no delivery address is available |
|
124 | 124 | { |
125 | 125 | foreach( $addresses as $address ) |
126 | 126 | { |
127 | 127 | $code = $address->getPostal(); |
128 | + } |
|
128 | 129 | |
129 | 130 | if( $this->checkPostalCode( $code, 'postal.delivery-include' ) === false |
130 | 131 | || $this->checkPostalCode( $code, 'postal.delivery-exclude' ) === true |
@@ -119,12 +119,13 @@ |
||
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | } |
122 | - } |
|
123 | - elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) // use billing address if no delivery address is available |
|
122 | + } elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) { |
|
123 | + // use billing address if no delivery address is available |
|
124 | 124 | { |
125 | 125 | foreach( $addresses as $address ) |
126 | 126 | { |
127 | 127 | $code = strtoupper( $address->getCountryId() ); |
128 | + } |
|
128 | 129 | |
129 | 130 | if( $this->checkCountryCode( $code, 'country.delivery-include' ) === false |
130 | 131 | || $this->checkCountryCode( $code, 'country.delivery-exclude' ) === true |
@@ -77,8 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function testRegisterItemFilter() |
79 | 79 | { |
80 | - $callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) |
|
81 | - { |
|
80 | + $callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) { |
|
82 | 81 | return true; |
83 | 82 | }; |
84 | 83 | |
@@ -290,8 +289,7 @@ discard block |
||
290 | 289 | { |
291 | 290 | $this->assertEquals( 2, count( $this->object->getTree()->getChildren() ) ); |
292 | 291 | |
293 | - $callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) |
|
294 | - { |
|
292 | + $callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) { |
|
295 | 293 | return (bool) $index % 2; |
296 | 294 | }; |
297 | 295 |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | foreach( $value as $key => $product ) { |
54 | 54 | $value[$key] = $this->updatePrice( $product ); |
55 | 55 | } |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | $value = $this->updatePrice( $value ); |
60 | 59 | } |
@@ -130,8 +129,7 @@ discard block |
||
130 | 129 | { |
131 | 130 | $priceManager = \Aimeos\MShop::create( $this->getContext(), 'price' ); |
132 | 131 | |
133 | - $sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) |
|
134 | - { |
|
132 | + $sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) { |
|
135 | 133 | if( ( $pricesA = $a->getRefItems( 'price', 'default', 'default' ) ) === [] ) { |
136 | 134 | return 1; |
137 | 135 | } |
@@ -194,8 +192,7 @@ discard block |
||
194 | 192 | { |
195 | 193 | $list = $this->sortByPrice( $list, $attrQtys ); |
196 | 194 | $priceItem = $this->addPrices( $priceItem, $list, $attrQtys, (int) $prodConf[$type] ); |
197 | - } |
|
198 | - else |
|
195 | + } else |
|
199 | 196 | { |
200 | 197 | $priceItem = $this->addPrices( $priceItem, $list, $attrQtys, 0 ); |
201 | 198 | } |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | ) { |
54 | 54 | $this->execute( 'ALTER TABLE "mshop_locale" DROP FOREIGN KEY "fk_msloc_langid"', 'db-locale' ); |
55 | 55 | $this->status( 'done' ); |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | $this->status( 'OK' ); |
60 | 59 | } |
@@ -66,8 +65,7 @@ discard block |
||
66 | 65 | ) { |
67 | 66 | $this->execute( 'ALTER TABLE "mshop_locale" DROP FOREIGN KEY "fk_msloc_currid"', 'db-locale' ); |
68 | 67 | $this->status( 'done' ); |
69 | - } |
|
70 | - else |
|
68 | + } else |
|
71 | 69 | { |
72 | 70 | $this->status( 'OK' ); |
73 | 71 | } |
@@ -142,9 +142,13 @@ |
||
142 | 142 | { |
143 | 143 | foreach( $data['customer/group'] as $entry ) |
144 | 144 | { |
145 | - try { |
|
145 | + try |
|
146 | + { |
|
146 | 147 | $groupManager->saveItem( $groupManager->createItem()->fromArray( $entry ), false ); |
147 | - } catch( \Exception $e ) { echo $e->getMessage(); } // ignore duplicates |
|
148 | + } |
|
149 | + catch( \Exception $e ) |
|
150 | + { |
|
151 | +echo $e->getMessage(); } // ignore duplicates |
|
148 | 152 | } |
149 | 153 | } |
150 | 154 | } |
@@ -26,7 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | public function test() |
28 | 28 | { |
29 | - try { |
|
29 | + try |
|
30 | + { |
|
30 | 31 | throw new \Aimeos\MShop\Plugin\Provider\Exception( 'msg', 13, null, $this->codes ); |
31 | 32 | } |
32 | 33 | catch( \Aimeos\MShop\Plugin\Provider\Exception $mppe ) |
@@ -36,7 +37,8 @@ discard block |
||
36 | 37 | $this->assertEquals( $this->codes, $mppe->getErrorCodes() ); |
37 | 38 | } |
38 | 39 | |
39 | - try { |
|
40 | + try |
|
41 | + { |
|
40 | 42 | throw new \Aimeos\MShop\Plugin\Provider\Exception( 'msg2', 11 ); |
41 | 43 | } |
42 | 44 | catch( \Aimeos\MShop\Plugin\Provider\Exception $e ) |
@@ -206,7 +206,9 @@ |
||
206 | 206 | |
207 | 207 | $listTypeManager->saveItem( $listItemType ); |
208 | 208 | } |
209 | - catch( \Exception $e ) {} // Duplicate entry |
|
209 | + catch( \Exception $e ) |
|
210 | + { |
|
211 | +} // Duplicate entry |
|
210 | 212 | } |
211 | 213 | } |
212 | 214 | } |