@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $currency = $locale->getCurrencyId(); |
98 | 98 | $language = $locale->getLanguageId(); |
99 | 99 | $sitecode = $locale->getSite()->getCode(); |
100 | - $key = 'aimeos/basket/content-' . $sitecode . '-' . $language . '-' . $currency . '-' . strval( $type ); |
|
100 | + $key = 'aimeos/basket/content-'.$sitecode.'-'.$language.'-'.$currency.'-'.strval( $type ); |
|
101 | 101 | |
102 | 102 | if( ( $serorder = $session->get( $key ) ) === null ) { |
103 | 103 | return $this->getObject()->createItem(); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $currency = $locale->getCurrencyId(); |
134 | 134 | $language = $locale->getLanguageId(); |
135 | 135 | $sitecode = $locale->getSite()->getCode(); |
136 | - $key = 'aimeos/basket/lock-' . $sitecode . '-' . $language . '-' . $currency . '-' . strval( $type ); |
|
136 | + $key = 'aimeos/basket/lock-'.$sitecode.'-'.$language.'-'.$currency.'-'.strval( $type ); |
|
137 | 137 | |
138 | 138 | if( ( $value = $session->get( $key ) ) !== null ) { |
139 | 139 | return (int) $value; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $currency = $locale->getCurrencyId(); |
158 | 158 | $language = $locale->getLanguageId(); |
159 | 159 | $sitecode = $locale->getSite()->getCode(); |
160 | - $key = 'aimeos/basket/content-' . $sitecode . '-' . $language . '-' . $currency . '-' . strval( $type ); |
|
160 | + $key = 'aimeos/basket/content-'.$sitecode.'-'.$language.'-'.$currency.'-'.strval( $type ); |
|
161 | 161 | |
162 | 162 | $session->set( $key, serialize( clone $order ) ); |
163 | 163 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $currency = $locale->getCurrencyId(); |
182 | 182 | $language = $locale->getLanguageId(); |
183 | 183 | $sitecode = $locale->getSite()->getCode(); |
184 | - $key = 'aimeos/basket/lock-' . $sitecode . '-' . $language . '-' . $currency . '-' . strval( $type ); |
|
184 | + $key = 'aimeos/basket/lock-'.$sitecode.'-'.$language.'-'.$currency.'-'.strval( $type ); |
|
185 | 185 | |
186 | 186 | $session->set( $key, strval( $lock ) ); |
187 | 187 | } |
@@ -385,8 +385,7 @@ discard block |
||
385 | 385 | $attributes[$attribute->getParentId()][] = $attribute; |
386 | 386 | $attribute->setParentId( null ); |
387 | 387 | $attribute->setId( null ); |
388 | - } |
|
389 | - else |
|
388 | + } else |
|
390 | 389 | { |
391 | 390 | $attributes[$attribute->getParentId()][$id] = $attribute; |
392 | 391 | } |
@@ -405,8 +404,7 @@ discard block |
||
405 | 404 | $map[$item->getBaseId()][$item->getPosition()] = $item; |
406 | 405 | |
407 | 406 | $subProducts = []; |
408 | - } |
|
409 | - else |
|
407 | + } else |
|
410 | 408 | { // in case it's a sub-product |
411 | 409 | $subProducts[$item->getPosition()] = $item; |
412 | 410 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $mode = $this->getOption( 'gzip-mode', 'rb' ); |
53 | 53 | $level = $this->getOption( 'gzip-level', 5 ); |
54 | 54 | |
55 | - if( ( $this->fh = gzopen( $resource, $mode . $level ) ) === false ) { |
|
55 | + if( ( $this->fh = gzopen( $resource, $mode.$level ) ) === false ) { |
|
56 | 56 | throw new \Aimeos\MW\Container\Exception( sprintf( 'Unable to open file "%1$s"', $resource ) ); |
57 | 57 | } |
58 | 58 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | public function testNewFile() |
21 | 21 | { |
22 | - $filename = 'tmp' . DIRECTORY_SEPARATOR . 'tempfile.gz'; |
|
22 | + $filename = 'tmp'.DIRECTORY_SEPARATOR.'tempfile.gz'; |
|
23 | 23 | $file = new \Aimeos\MW\Container\Content\Gzip( $filename, 'temp', ['gzip-mode' => 'wb'] ); |
24 | 24 | $resource = $file->getResource(); |
25 | 25 | $file->close(); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function testExistingFile() |
33 | 33 | { |
34 | - $filename = __DIR__ . DIRECTORY_SEPARATOR . 'testfile.gz'; |
|
34 | + $filename = __DIR__.DIRECTORY_SEPARATOR.'testfile.gz'; |
|
35 | 35 | $file = new \Aimeos\MW\Container\Content\Gzip( $filename, 'test' ); |
36 | 36 | |
37 | 37 | $this->assertEquals( true, file_exists( $file->getResource() ) ); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | 'gzip-level' => 9, |
48 | 48 | ); |
49 | 49 | |
50 | - $filename = 'tmp' . DIRECTORY_SEPARATOR . 'tempfile'; |
|
50 | + $filename = 'tmp'.DIRECTORY_SEPARATOR.'tempfile'; |
|
51 | 51 | $file = new \Aimeos\MW\Container\Content\Gzip( $filename, 'temp', $options ); |
52 | 52 | $file->add( 'test text' ); |
53 | 53 | $file->close(); |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | unlink( $file->getResource() ); |
57 | 57 | |
58 | 58 | $this->assertStringStartsWith( '1f8b080000000000', bin2hex( $actual ) ); |
59 | - $this->assertEquals( $filename . '.gz', $file->getResource() ); |
|
59 | + $this->assertEquals( $filename.'.gz', $file->getResource() ); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | public function testOverwrite() |
64 | 64 | { |
65 | - $filename = 'tmp' . DIRECTORY_SEPARATOR . 'tempfile.gz'; |
|
65 | + $filename = 'tmp'.DIRECTORY_SEPARATOR.'tempfile.gz'; |
|
66 | 66 | $file = new \Aimeos\MW\Container\Content\Gzip( $filename, 'temp', ['gzip-mode' => 'wb'] ); |
67 | 67 | $file->add( 'test text' ); |
68 | 68 | $file->close(); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | public function testIterator() |
85 | 85 | { |
86 | - $filename = __DIR__ . DIRECTORY_SEPARATOR . 'testfile.gz'; |
|
86 | + $filename = __DIR__.DIRECTORY_SEPARATOR.'testfile.gz'; |
|
87 | 87 | $file = new \Aimeos\MW\Container\Content\Gzip( $filename, 'test' ); |
88 | 88 | |
89 | 89 | $expected = array( "test data" ); |
@@ -116,7 +116,7 @@ |
||
116 | 116 | $service = $basket->getService( \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_DELIVERY ); |
117 | 117 | |
118 | 118 | if( ( $value = $service->getAttribute( 'time.hourminute', 'delivery' ) ) == '' ) { |
119 | - $feconfig['time.hourminute']['default'] = date( 'H:i', time() + ($minute + 15 - ($minute % 15)) * 60 ); |
|
119 | + $feconfig['time.hourminute']['default'] = date( 'H:i', time() + ( $minute + 15 - ( $minute % 15 ) ) * 60 ); |
|
120 | 120 | } else { |
121 | 121 | $feconfig['time.hourminute']['default'] = $value; |
122 | 122 | } |
@@ -114,7 +114,9 @@ |
||
114 | 114 | $feconfig['time.hourminute']['default'] = $value; |
115 | 115 | } |
116 | 116 | } |
117 | - catch( \Aimeos\MShop\Order\Exception $e ) { echo $e->getMessage(); } // If service isn't available |
|
117 | + catch( \Aimeos\MShop\Order\Exception $e ) |
|
118 | + { |
|
119 | +echo $e->getMessage(); } // If service isn't available |
|
118 | 120 | |
119 | 121 | return array_merge( $this->getProvider()->getConfigFE( $basket ), $this->getConfigItems( $feconfig ) ); |
120 | 122 | } |
@@ -70,8 +70,7 @@ discard block |
||
70 | 70 | ) { |
71 | 71 | $this->execute( $this->stmts['constraint'], 'db-product' ); |
72 | 72 | $this->status( 'done' ); |
73 | - } |
|
74 | - else |
|
73 | + } else |
|
75 | 74 | { |
76 | 75 | $this->status( 'OK' ); |
77 | 76 | } |
@@ -84,8 +83,7 @@ discard block |
||
84 | 83 | ) { |
85 | 84 | $this->execute( $this->stmts['constraint2'], 'db-product' ); |
86 | 85 | $this->status( 'done' ); |
87 | - } |
|
88 | - else |
|
86 | + } else |
|
89 | 87 | { |
90 | 88 | $this->status( 'OK' ); |
91 | 89 | } |
@@ -98,8 +96,7 @@ discard block |
||
98 | 96 | ) { |
99 | 97 | $this->execute( $this->stmts['typeid'], 'db-product' ); |
100 | 98 | $this->status( 'done' ); |
101 | - } |
|
102 | - else |
|
99 | + } else |
|
103 | 100 | { |
104 | 101 | $this->status( 'OK' ); |
105 | 102 | } |
@@ -111,8 +108,7 @@ discard block |
||
111 | 108 | { |
112 | 109 | $this->execute( $this->stmts['table'], 'db-product' ); |
113 | 110 | $this->status( 'done' ); |
114 | - } |
|
115 | - else |
|
111 | + } else |
|
116 | 112 | { |
117 | 113 | $this->status( 'OK' ); |
118 | 114 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | return (string) $this->bdata['id']; |
52 | 52 | } |
53 | 53 | |
54 | - $key = $this->prefix . 'id'; |
|
54 | + $key = $this->prefix.'id'; |
|
55 | 55 | return ( isset( $this->bdata[$key] ) && $this->bdata[$key] != '' ? (string) $this->bdata[$key] : null ); |
56 | 56 | } |
57 | 57 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function setId( $id ) |
66 | 66 | { |
67 | - $key = $this->prefix . 'id'; |
|
67 | + $key = $this->prefix.'id'; |
|
68 | 68 | |
69 | 69 | if( ( $this->bdata[$key] = \Aimeos\MShop\Common\Item\Base::checkId( $this->getId(), $id ) ) === null ) { |
70 | 70 | $this->modified = true; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return (int) $this->bdata['siteid']; |
89 | 89 | } |
90 | 90 | |
91 | - $key = $this->prefix . 'siteid'; |
|
91 | + $key = $this->prefix.'siteid'; |
|
92 | 92 | return ( isset( $this->bdata[$key] ) ? (int) $this->bdata[$key] : null ); |
93 | 93 | } |
94 | 94 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | return (string) $this->bdata['mtime']; |
105 | 105 | } |
106 | 106 | |
107 | - $key = $this->prefix . 'mtime'; |
|
107 | + $key = $this->prefix.'mtime'; |
|
108 | 108 | return ( isset( $this->bdata[$key] ) ? (string) $this->bdata[$key] : null ); |
109 | 109 | } |
110 | 110 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | return (string) $this->bdata['ctime']; |
121 | 121 | } |
122 | 122 | |
123 | - $key = $this->prefix . 'ctime'; |
|
123 | + $key = $this->prefix.'ctime'; |
|
124 | 124 | return ( isset( $this->bdata[$key] ) ? (string) $this->bdata[$key] : null ); |
125 | 125 | } |
126 | 126 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return (string) $this->bdata['editor']; |
137 | 137 | } |
138 | 138 | |
139 | - $key = $this->prefix . 'editor'; |
|
139 | + $key = $this->prefix.'editor'; |
|
140 | 140 | return ( isset( $this->bdata[$key] ) ? (string) $this->bdata[$key] : '' ); |
141 | 141 | } |
142 | 142 | |
@@ -172,16 +172,16 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function fromArray( array $list ) |
174 | 174 | { |
175 | - if( array_key_exists( $this->prefix . 'id', $list ) ) |
|
175 | + if( array_key_exists( $this->prefix.'id', $list ) ) |
|
176 | 176 | { |
177 | - $this->setId( $list[$this->prefix . 'id'] ); |
|
178 | - unset( $list[$this->prefix . 'id'] ); |
|
177 | + $this->setId( $list[$this->prefix.'id'] ); |
|
178 | + unset( $list[$this->prefix.'id'] ); |
|
179 | 179 | } |
180 | 180 | |
181 | - unset( $list[$this->prefix . 'siteid'] ); |
|
182 | - unset( $list[$this->prefix . 'ctime'] ); |
|
183 | - unset( $list[$this->prefix . 'mtime'] ); |
|
184 | - unset( $list[$this->prefix . 'editor'] ); |
|
181 | + unset( $list[$this->prefix.'siteid'] ); |
|
182 | + unset( $list[$this->prefix.'ctime'] ); |
|
183 | + unset( $list[$this->prefix.'mtime'] ); |
|
184 | + unset( $list[$this->prefix.'editor'] ); |
|
185 | 185 | |
186 | 186 | return $list; |
187 | 187 | } |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function toArray( $private = false ) |
197 | 197 | { |
198 | - $list = [$this->prefix . 'id' => $this->getId()]; |
|
198 | + $list = [$this->prefix.'id' => $this->getId()]; |
|
199 | 199 | |
200 | 200 | if( $private === true ) |
201 | 201 | { |
202 | - $list[$this->prefix . 'siteid'] = $this->getSiteId(); |
|
203 | - $list[$this->prefix . 'ctime'] = $this->getTimeCreated(); |
|
204 | - $list[$this->prefix . 'mtime'] = $this->getTimeModified(); |
|
205 | - $list[$this->prefix . 'editor'] = $this->getEditor(); |
|
202 | + $list[$this->prefix.'siteid'] = $this->getSiteId(); |
|
203 | + $list[$this->prefix.'ctime'] = $this->getTimeCreated(); |
|
204 | + $list[$this->prefix.'mtime'] = $this->getTimeModified(); |
|
205 | + $list[$this->prefix.'editor'] = $this->getEditor(); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | return $list; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $level = \Aimeos\MW\Logger\Base::DEBUG; |
32 | 32 | $class = get_class( $this->getProvider() ); |
33 | 33 | |
34 | - $this->getContext()->getLogger()->log( 'Plugin::register: ' . $class, $level, 'core/plugin' ); |
|
34 | + $this->getContext()->getLogger()->log( 'Plugin::register: '.$class, $level, 'core/plugin' ); |
|
35 | 35 | |
36 | 36 | $this->getProvider()->register( $p ); |
37 | 37 | } |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | $class = get_class( $this->getProvider() ); |
51 | 51 | $payload = ( is_object( $value ) ? get_class( $value ) : ( is_scalar( $value ) ? $value : '' ) ); |
52 | 52 | |
53 | - $msg = 'Plugin::update:before: ' . $class . ', action: ' . $action . ', value: ' . $payload; |
|
53 | + $msg = 'Plugin::update:before: '.$class.', action: '.$action.', value: '.$payload; |
|
54 | 54 | $this->getContext()->getLogger()->log( $msg, $level, 'core/plugin' ); |
55 | 55 | |
56 | 56 | $result = $this->getProvider()->update( $order, $action, $value ); |
57 | 57 | |
58 | - $msg = 'Plugin::update:after: ' . $class . ', action: ' . $action . ', value: ' . $payload; |
|
58 | + $msg = 'Plugin::update:after: '.$class.', action: '.$action.', value: '.$payload; |
|
59 | 59 | $this->getContext()->getLogger()->log( $msg, $level, 'core/plugin' ); |
60 | 60 | |
61 | 61 | return $result; |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | $logger = $this->getContext()->getLogger(); |
84 | 84 | $xml = $this->buildXML( $order ); |
85 | 85 | |
86 | - $logger->log( __METHOD__ . ": XML request =\n" . $xml, $level, 'core/service/delivery' ); |
|
86 | + $logger->log( __METHOD__.": XML request =\n".$xml, $level, 'core/service/delivery' ); |
|
87 | 87 | |
88 | 88 | $response = $this->sendRequest( $xml ); |
89 | 89 | |
90 | - $logger->log( __METHOD__ . ": XML response =\n" . trim( $response ), $level, 'core/service/delivery' ); |
|
90 | + $logger->log( __METHOD__.": XML response =\n".trim( $response ), $level, 'core/service/delivery' ); |
|
91 | 91 | |
92 | 92 | $this->checkResponse( $response, $order->getId() ); |
93 | 93 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $context->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::NOTICE, 'core/service/delivery' ); |
168 | 168 | |
169 | 169 | curl_setopt( $curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY ); |
170 | - curl_setopt( $curl, CURLOPT_USERPWD, $config['default.username'] . ':' . $config['default.password'] ); |
|
170 | + curl_setopt( $curl, CURLOPT_USERPWD, $config['default.username'].':'.$config['default.password'] ); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $urlinfo = parse_url( $config['default.url'] ); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | protected function checkResponse( $response, $invoiceid ) |
232 | 232 | { |
233 | - $responseXSD = __DIR__ . DIRECTORY_SEPARATOR . 'xsd' . DIRECTORY_SEPARATOR . 'order-response_v1.xsd'; |
|
233 | + $responseXSD = __DIR__.DIRECTORY_SEPARATOR.'xsd'.DIRECTORY_SEPARATOR.'order-response_v1.xsd'; |
|
234 | 234 | |
235 | 235 | $dom = new \DOMDocument( '1.0', 'UTF-8' ); |
236 | 236 | $dom->preserveWhiteSpace = false; |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | throw new \Aimeos\MShop\Service\Exception( sprintf( $msg, $e->getMessage() ), 0, $e ); |
314 | 314 | } |
315 | 315 | |
316 | - $requestXSD = __DIR__ . DIRECTORY_SEPARATOR . 'xsd' . DIRECTORY_SEPARATOR . 'order-request_v1.xsd'; |
|
316 | + $requestXSD = __DIR__.DIRECTORY_SEPARATOR.'xsd'.DIRECTORY_SEPARATOR.'order-request_v1.xsd'; |
|
317 | 317 | |
318 | 318 | if( $dom->schemaValidate( $requestXSD ) !== true ) |
319 | 319 | { |
@@ -180,8 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false ); |
182 | 182 | curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, true ); |
183 | - } |
|
184 | - else |
|
183 | + } else |
|
185 | 184 | { |
186 | 185 | $msg = 'Using strict SSL options'; |
187 | 186 | $context->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::NOTICE, 'core/service/delivery' ); |
@@ -189,8 +188,7 @@ discard block |
||
189 | 188 | curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, true ); |
190 | 189 | curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 2 ); // check CN and match host name |
191 | 190 | } |
192 | - } |
|
193 | - else |
|
191 | + } else |
|
194 | 192 | { |
195 | 193 | $msg = 'Using no SSL encryption'; |
196 | 194 | $context->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::NOTICE, 'core/service/delivery' ); |
@@ -99,7 +99,7 @@ |
||
99 | 99 | * Returns the configuration attribute definitions of the provider to generate a list of available fields and |
100 | 100 | * rules for the value of each field in the administration interface. |
101 | 101 | * |
102 | - * @return array List of attribute definitions implementing \Aimeos\MW\Common\Critera\Attribute\Iface |
|
102 | + * @return \Aimeos\MW\Criteria\Attribute\Iface[] List of attribute definitions implementing \Aimeos\MW\Common\Critera\Attribute\Iface |
|
103 | 103 | */ |
104 | 104 | public function getConfigBE() |
105 | 105 | { |
@@ -171,8 +171,7 @@ discard block |
||
171 | 171 | $quantity = $item->getQuantity(); |
172 | 172 | $item = $this->products[$pos]; |
173 | 173 | $item->setQuantity( $item->getQuantity() + $quantity ); |
174 | - } |
|
175 | - else if( $position !== null ) |
|
174 | + } else if( $position !== null ) |
|
176 | 175 | { |
177 | 176 | if( isset( $this->products[$position] ) ) |
178 | 177 | { |
@@ -189,13 +188,11 @@ discard block |
||
189 | 188 | |
190 | 189 | $products[$position] = $item; |
191 | 190 | $this->products = $products; |
192 | - } |
|
193 | - else |
|
191 | + } else |
|
194 | 192 | { |
195 | 193 | $this->products[$position] = $item; |
196 | 194 | } |
197 | - } |
|
198 | - else |
|
195 | + } else |
|
199 | 196 | { |
200 | 197 | $this->products[] = $item; |
201 | 198 | } |
@@ -225,8 +222,7 @@ discard block |
||
225 | 222 | { |
226 | 223 | $this->products[$pos] = $item; |
227 | 224 | $this->setModified(); |
228 | - } |
|
229 | - else |
|
225 | + } else |
|
230 | 226 | { |
231 | 227 | $this->products[$pos] = $item; |
232 | 228 | } |