@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param string $path Path to the directory |
70 | 70 | * @return void |
71 | 71 | * @throws \Aimeos\MW\Filesystem\Exception If an error occurs |
72 | - */ |
|
72 | + */ |
|
73 | 73 | public function mkdir( $path ) |
74 | 74 | { |
75 | 75 | if( @mkdir( $this->basepath . $path ) === false ) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param string $path Path to the directory |
86 | 86 | * @return void |
87 | 87 | * @throws \Aimeos\MW\Filesystem\Exception If an error occurs |
88 | - */ |
|
88 | + */ |
|
89 | 89 | public function rmdir( $path ) |
90 | 90 | { |
91 | 91 | if( @rmdir( $this->basepath . $path ) === false ) { |
@@ -152,7 +152,7 @@ |
||
152 | 152 | * @return self |
153 | 153 | * @throws \InvalidArgumentException for invalid header names or values. |
154 | 154 | */ |
155 | - public function withHeader($name, $value ) |
|
155 | + public function withHeader( $name, $value ) |
|
156 | 156 | { |
157 | 157 | $this->response = $this->response->withHeader( $name, $value ); |
158 | 158 | return $this; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * Return an instance with the provided value replacing the specified header. |
171 | 171 | * |
172 | 172 | * @param string $name Case-insensitive header field name. |
173 | - * @param string|string[] $value Header value(s). |
|
173 | + * @param string $value Header value(s). |
|
174 | 174 | * @return self |
175 | 175 | * @throws \InvalidArgumentException for invalid header names or values. |
176 | 176 | */ |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * Return an instance with the specified header appended with the given value. |
186 | 186 | * |
187 | 187 | * @param string $name Case-insensitive header field name to add. |
188 | - * @param string|string[] $value Header value(s). |
|
188 | + * @param string $value Header value(s). |
|
189 | 189 | * @return self |
190 | 190 | */ |
191 | 191 | public function withAddedHeader( $name, $value ) |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - if ($this->checkWeightScale( $this->getWeight( $prodMap ) ) === false) { |
|
108 | + if( $this->checkWeightScale( $this->getWeight( $prodMap ) ) === false ) { |
|
109 | 109 | return false; |
110 | 110 | } |
111 | 111 | |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | $min = $this->getConfigValue( array( 'weight.min' ) ); |
125 | 125 | $max = $this->getConfigValue( array( 'weight.max' ) ); |
126 | 126 | |
127 | - if( $min !== null && ( (float) $min) > $basketWeight ) { |
|
127 | + if( $min !== null && ( (float) $min ) > $basketWeight ) { |
|
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | |
131 | - if( $max !== null && ( (float) $max) < $basketWeight ) { |
|
131 | + if( $max !== null && ( (float) $max ) < $basketWeight ) { |
|
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $search->setSlice( 0, 0x7fffffff ); // if more than 100 products are in the basket |
175 | 175 | |
176 | 176 | foreach( $propertyManager->searchItems( $search ) as $property ) { |
177 | - $weight += ((float) $property->getValue()) * $prodMap[$prodIds[$property->getParentId()]]; |
|
177 | + $weight += ( (float) $property->getValue() ) * $prodMap[$prodIds[$property->getParentId()]]; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 |
@@ -97,9 +97,11 @@ |
||
97 | 97 | $code = $basketItem->getProductCode(); |
98 | 98 | $prodMap[$code] = ( isset( $prodMap[$code] ) ? $prodMap[$code] + $qty : $qty ); |
99 | 99 | |
100 | - foreach( $basketItem->getProducts() as $prodItem ) // calculate bundled products |
|
100 | + foreach( $basketItem->getProducts() as $prodItem ) { |
|
101 | + // calculate bundled products |
|
101 | 102 | { |
102 | 103 | $qty = $prodItem->getQuantity(); |
104 | + } |
|
103 | 105 | $code = $prodItem->getProductCode(); |
104 | 106 | $prodMap[$code] = ( isset( $prodMap[$code] ) ? $prodMap[$code] + $qty : $qty ); |
105 | 107 | } |
@@ -67,8 +67,7 @@ |
||
67 | 67 | $this->setCode( $key ); |
68 | 68 | $this->values['id'] = $this->values['code']; |
69 | 69 | $this->modified = false; |
70 | - } |
|
71 | - else |
|
70 | + } else |
|
72 | 71 | { |
73 | 72 | $this->values['id'] = null; |
74 | 73 | $this->modified = true; |
@@ -32,9 +32,12 @@ discard block |
||
32 | 32 | { |
33 | 33 | parent::__construct( $config ); |
34 | 34 | |
35 | - try { |
|
35 | + try |
|
36 | + { |
|
36 | 37 | $this->conn = $this->createConnection(); |
37 | - } catch( \Aimeos\MW\DB\Exception $e ) { |
|
38 | + } |
|
39 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
40 | + { |
|
38 | 41 | throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
39 | 42 | } |
40 | 43 | } |
@@ -85,8 +88,7 @@ discard block |
||
85 | 88 | { |
86 | 89 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
87 | 90 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
88 | - } |
|
89 | - else |
|
91 | + } else |
|
90 | 92 | { |
91 | 93 | $dsn .= ';unix_socket=' . $sock; |
92 | 94 | } |
@@ -80,15 +80,15 @@ |
||
80 | 80 | $sock = $this->getConfig( 'db/socket' ); |
81 | 81 | $dbase = $this->getConfig( 'db/database', 'aimeos' ); |
82 | 82 | |
83 | - $dsn = $adapter . ':dbname=' . $dbase; |
|
83 | + $dsn = $adapter.':dbname='.$dbase; |
|
84 | 84 | if( $sock == null ) |
85 | 85 | { |
86 | - $dsn .= isset( $host ) ? ';host=' . $host : ''; |
|
87 | - $dsn .= isset( $port ) ? ';port=' . $port : ''; |
|
86 | + $dsn .= isset( $host ) ? ';host='.$host : ''; |
|
87 | + $dsn .= isset( $port ) ? ';port='.$port : ''; |
|
88 | 88 | } |
89 | 89 | else |
90 | 90 | { |
91 | - $dsn .= ';unix_socket=' . $sock; |
|
91 | + $dsn .= ';unix_socket='.$sock; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $attr = array( |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param string $path Path to the directory |
70 | 70 | * @return void |
71 | 71 | * @throws \Aimeos\MW\Filesystem\Exception If an error occurs |
72 | - */ |
|
72 | + */ |
|
73 | 73 | public function mkdir( $path ) |
74 | 74 | { |
75 | 75 | if( @mkdir( $this->basepath . $path ) === false ) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param string $path Path to the directory |
86 | 86 | * @return void |
87 | 87 | * @throws \Aimeos\MW\Filesystem\Exception If an error occurs |
88 | - */ |
|
88 | + */ |
|
89 | 89 | public function rmdir( $path ) |
90 | 90 | { |
91 | 91 | if( @rmdir( $this->basepath . $path ) === false ) { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param string $path Path to the directory |
70 | 70 | * @return void |
71 | 71 | * @throws \Aimeos\MW\Filesystem\Exception If an error occurs |
72 | - */ |
|
72 | + */ |
|
73 | 73 | public function mkdir( $path ) |
74 | 74 | { |
75 | 75 | if( @mkdir( $this->basepath . $path ) === false ) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param string $path Path to the directory |
86 | 86 | * @return void |
87 | 87 | * @throws \Aimeos\MW\Filesystem\Exception If an error occurs |
88 | - */ |
|
88 | + */ |
|
89 | 89 | public function rmdir( $path ) |
90 | 90 | { |
91 | 91 | if( @rmdir( $this->basepath . $path ) === false ) { |
@@ -618,7 +618,9 @@ discard block |
||
618 | 618 | $values['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE'] = $orderAddressDelivery->getCountryId(); |
619 | 619 | $values['PAYMENTREQUEST_0_SHIPTOZIP'] = $orderAddressDelivery->getPostal(); |
620 | 620 | } |
621 | - catch( \Exception $e ) {; } // If no address is available |
|
621 | + catch( \Exception $e ) |
|
622 | + { |
|
623 | +; } // If no address is available |
|
622 | 624 | |
623 | 625 | |
624 | 626 | $lastPos = 0; |
@@ -656,7 +658,9 @@ discard block |
||
656 | 658 | $values['L_SHIPPINGOPTIONNAME0'] = $orderServiceDeliveryItem->getCode(); |
657 | 659 | $values['L_SHIPPINGOPTIONISDEFAULT0'] = 'true'; |
658 | 660 | } |
659 | - catch( \Exception $e ) { ; } // If no delivery service is available |
|
661 | + catch( \Exception $e ) |
|
662 | + { |
|
663 | +; } // If no delivery service is available |
|
660 | 664 | |
661 | 665 | |
662 | 666 | $price = $orderBase->getPrice(); |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | |
475 | 475 | if( $rvals['ACK'] !== 'Success' ) |
476 | 476 | { |
477 | - $msg = 'PayPal Express: method = ' . $method . ', order ID = ' . $orderid . ', response = ' . print_r( $rvals, true ); |
|
477 | + $msg = 'PayPal Express: method = '.$method.', order ID = '.$orderid.', response = '.print_r( $rvals, true ); |
|
478 | 478 | $this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::WARN ); |
479 | 479 | |
480 | 480 | if( $rvals['ACK'] !== 'SuccessWithWarning' ) |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | break; |
554 | 554 | } |
555 | 555 | |
556 | - $str = 'PayPal Express: order ID = ' . $invoice->getId() . ', PENDINGREASON = ' . $response['PENDINGREASON']; |
|
556 | + $str = 'PayPal Express: order ID = '.$invoice->getId().', PENDINGREASON = '.$response['PENDINGREASON']; |
|
557 | 557 | $this->getContext()->getLogger()->log( $str, \Aimeos\MW\Logger\Base::INFO ); |
558 | 558 | } |
559 | 559 | |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | break; |
588 | 588 | |
589 | 589 | default: |
590 | - $str = 'PayPal Express: order ID = ' . $invoice->getId() . ', response = ' . print_r( $response, true ); |
|
590 | + $str = 'PayPal Express: order ID = '.$invoice->getId().', response = '.print_r( $response, true ); |
|
591 | 591 | $this->getContext()->getLogger()->log( $str, \Aimeos\MW\Logger\Base::INFO ); |
592 | 592 | } |
593 | 593 | } |
@@ -611,8 +611,8 @@ discard block |
||
611 | 611 | |
612 | 612 | /* setting up the shipping address details (ReviewOrder) */ |
613 | 613 | $values['ADDROVERRIDE'] = 1; |
614 | - $values['PAYMENTREQUEST_0_SHIPTONAME'] = $orderAddressDelivery->getFirstName() . ' ' . $orderAddressDelivery->getLastName(); |
|
615 | - $values['PAYMENTREQUEST_0_SHIPTOSTREET'] = $orderAddressDelivery->getAddress1() . ' ' . $orderAddressDelivery->getAddress2() . ' ' . $orderAddressDelivery->getAddress3(); |
|
614 | + $values['PAYMENTREQUEST_0_SHIPTONAME'] = $orderAddressDelivery->getFirstName().' '.$orderAddressDelivery->getLastName(); |
|
615 | + $values['PAYMENTREQUEST_0_SHIPTOSTREET'] = $orderAddressDelivery->getAddress1().' '.$orderAddressDelivery->getAddress2().' '.$orderAddressDelivery->getAddress3(); |
|
616 | 616 | $values['PAYMENTREQUEST_0_SHIPTOCITY'] = $orderAddressDelivery->getCity(); |
617 | 617 | $values['PAYMENTREQUEST_0_SHIPTOSTATE'] = $orderAddressDelivery->getState(); |
618 | 618 | $values['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE'] = $orderAddressDelivery->getCountryId(); |
@@ -628,10 +628,10 @@ discard block |
||
628 | 628 | $lastPos = $product->getPosition() - 1; |
629 | 629 | $deliveryPrice->setCosts( $deliveryPrice->getCosts() + $price->getCosts() * $product->getQuantity() ); |
630 | 630 | |
631 | - $values['L_PAYMENTREQUEST_0_NUMBER' . $lastPos] = $product->getId(); |
|
632 | - $values['L_PAYMENTREQUEST_0_NAME' . $lastPos] = $product->getName(); |
|
633 | - $values['L_PAYMENTREQUEST_0_QTY' . $lastPos] = $product->getQuantity(); |
|
634 | - $values['L_PAYMENTREQUEST_0_AMT' . $lastPos] = $this->getAmount( $price, false ); |
|
631 | + $values['L_PAYMENTREQUEST_0_NUMBER'.$lastPos] = $product->getId(); |
|
632 | + $values['L_PAYMENTREQUEST_0_NAME'.$lastPos] = $product->getName(); |
|
633 | + $values['L_PAYMENTREQUEST_0_QTY'.$lastPos] = $product->getQuantity(); |
|
634 | + $values['L_PAYMENTREQUEST_0_AMT'.$lastPos] = $this->getAmount( $price, false ); |
|
635 | 635 | } |
636 | 636 | |
637 | 637 | |
@@ -639,9 +639,9 @@ discard block |
||
639 | 639 | if( ( $paymentCosts = $this->getAmount( $price ) ) > '0.00' ) |
640 | 640 | { |
641 | 641 | $lastPos++; |
642 | - $values['L_PAYMENTREQUEST_0_NAME' . $lastPos] = $this->getContext()->getI18n()->dt( 'mshop', 'Payment costs' ); |
|
643 | - $values['L_PAYMENTREQUEST_0_QTY' . $lastPos] = '1'; |
|
644 | - $values['L_PAYMENTREQUEST_0_AMT' . $lastPos] = $paymentCosts; |
|
642 | + $values['L_PAYMENTREQUEST_0_NAME'.$lastPos] = $this->getContext()->getI18n()->dt( 'mshop', 'Payment costs' ); |
|
643 | + $values['L_PAYMENTREQUEST_0_QTY'.$lastPos] = '1'; |
|
644 | + $values['L_PAYMENTREQUEST_0_AMT'.$lastPos] = $paymentCosts; |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | $values['L_SHIPPINGOPTIONNAME0'] = $orderServiceDeliveryItem->getCode(); |
659 | 659 | $values['L_SHIPPINGOPTIONISDEFAULT0'] = 'true'; |
660 | 660 | } |
661 | - catch( \Exception $e ) { ; } // If no delivery service is available |
|
661 | + catch( \Exception $e ) {; } // If no delivery service is available |
|
662 | 662 | |
663 | 663 | |
664 | 664 | $price = $orderBase->getPrice(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $this->additional->setEditor( 'core:unittest' ); |
61 | 61 | |
62 | 62 | $ds = DIRECTORY_SEPARATOR; |
63 | - $path = __DIR__ . $ds . 'data' . $ds . 'text-list.php'; |
|
63 | + $path = __DIR__.$ds.'data'.$ds.'text-list.php'; |
|
64 | 64 | |
65 | 65 | if( ( $testdata = include( $path ) ) == false ) { |
66 | 66 | throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for text list domain', $path ) ); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $refIds = array(); |
109 | 109 | foreach( $result as $item ) { |
110 | - $refIds['media/' . $item->getUrl()] = $item->getId(); |
|
110 | + $refIds['media/'.$item->getUrl()] = $item->getId(); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return $refIds; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $parentIds = array(); |
144 | 144 | foreach( $textManager->searchItems( $search ) as $item ) { |
145 | - $parentIds['text/' . $item->getLabel()] = $item->getId(); |
|
145 | + $parentIds['text/'.$item->getLabel()] = $item->getId(); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | $tListTypeIds = array(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $this->additional->setEditor( 'core:unittest' ); |
61 | 61 | |
62 | 62 | $ds = DIRECTORY_SEPARATOR; |
63 | - $path = __DIR__ . $ds . 'data' . $ds . 'catalog-list.php'; |
|
63 | + $path = __DIR__.$ds.'data'.$ds.'catalog-list.php'; |
|
64 | 64 | |
65 | 65 | if( ( $testdata = include( $path ) ) == false ) { |
66 | 66 | throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for catalog list domain', $path ) ); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $refIds = array(); |
109 | 109 | foreach( $textManager->searchItems( $search ) as $item ) { |
110 | - $refIds['text/' . $item->getLabel()] = $item->getId(); |
|
110 | + $refIds['text/'.$item->getLabel()] = $item->getId(); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return $refIds; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $refIds = array(); |
141 | 141 | foreach( $mediaManager->searchItems( $search ) as $item ) { |
142 | - $refIds['media/' . $item->getUrl()] = $item->getId(); |
|
142 | + $refIds['media/'.$item->getUrl()] = $item->getId(); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return $refIds; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | $refIds = array(); |
173 | 173 | foreach( $productManager->searchItems( $search ) as $item ) { |
174 | - $refIds['product/' . $item->getCode()] = $item->getId(); |
|
174 | + $refIds['product/'.$item->getCode()] = $item->getId(); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return $refIds; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | $parentIds = array(); |
208 | 208 | foreach( $catalogManager->searchItems( $search ) as $item ) { |
209 | - $parentIds['catalog/' . $item->getCode()] = $item->getId(); |
|
209 | + $parentIds['catalog/'.$item->getCode()] = $item->getId(); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | $listItemTypeIds = array(); |