@@ -175,15 +175,13 @@ |
||
175 | 175 | $context->getLogger()->log( 'Using weak SSL options', \Aimeos\MW\Logger\Base::NOTICE ); |
176 | 176 | curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false ); |
177 | 177 | curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, true ); |
178 | - } |
|
179 | - else |
|
178 | + } else |
|
180 | 179 | { |
181 | 180 | $context->getLogger()->log( 'Using strict SSL options', \Aimeos\MW\Logger\Base::NOTICE ); |
182 | 181 | curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, true ); |
183 | 182 | curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 2 ); // check CN and match host name |
184 | 183 | } |
185 | - } |
|
186 | - else |
|
184 | + } else |
|
187 | 185 | { |
188 | 186 | $context->getLogger()->log( 'Using no SSL encryption', \Aimeos\MW\Logger\Base::NOTICE ); |
189 | 187 | } |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | $logger = $this->getContext()->getLogger(); |
83 | 83 | $xml = $this->buildXML( $order ); |
84 | 84 | |
85 | - $logger->log( __METHOD__ . ": XML request =\n" . $xml, \Aimeos\MW\Logger\Base::INFO ); |
|
85 | + $logger->log( __METHOD__.": XML request =\n".$xml, \Aimeos\MW\Logger\Base::INFO ); |
|
86 | 86 | |
87 | 87 | $response = $this->sendRequest( $xml ); |
88 | 88 | |
89 | - $logger->log( __METHOD__ . ": XML response =\n" . trim( $response ), \Aimeos\MW\Logger\Base::INFO ); |
|
89 | + $logger->log( __METHOD__.": XML response =\n".trim( $response ), \Aimeos\MW\Logger\Base::INFO ); |
|
90 | 90 | |
91 | 91 | $this->checkResponse( $response, $order->getId() ); |
92 | 92 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | { |
165 | 165 | $context->getLogger()->log( 'Using user name and password for authentication', \Aimeos\MW\Logger\Base::NOTICE ); |
166 | 166 | curl_setopt( $curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY ); |
167 | - curl_setopt( $curl, CURLOPT_USERPWD, $config['default.username'] . ':' . $config['default.password'] ); |
|
167 | + curl_setopt( $curl, CURLOPT_USERPWD, $config['default.username'].':'.$config['default.password'] ); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $urlinfo = parse_url( $config['default.url'] ); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | */ |
221 | 221 | protected function checkResponse( $response, $invoiceid ) |
222 | 222 | { |
223 | - $responseXSD = __DIR__ . DIRECTORY_SEPARATOR . 'xsd' . DIRECTORY_SEPARATOR . 'order-response_v1.xsd'; |
|
223 | + $responseXSD = __DIR__.DIRECTORY_SEPARATOR.'xsd'.DIRECTORY_SEPARATOR.'order-response_v1.xsd'; |
|
224 | 224 | |
225 | 225 | $dom = new \DOMDocument( '1.0', 'UTF-8' ); |
226 | 226 | $dom->preserveWhiteSpace = false; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | throw new \Aimeos\MShop\Service\Exception( sprintf( $msg, $e->getMessage() ), 0, $e ); |
299 | 299 | } |
300 | 300 | |
301 | - $requestXSD = __DIR__ . DIRECTORY_SEPARATOR . 'xsd' . DIRECTORY_SEPARATOR . 'order-request_v1.xsd'; |
|
301 | + $requestXSD = __DIR__.DIRECTORY_SEPARATOR.'xsd'.DIRECTORY_SEPARATOR.'order-request_v1.xsd'; |
|
302 | 302 | |
303 | 303 | if( $dom->schemaValidate( $requestXSD ) !== true ) |
304 | 304 | { |
@@ -82,7 +82,9 @@ |
||
82 | 82 | $feconfig['directdebit.accountowner']['default'] = $fn . ' ' . $ln; |
83 | 83 | } |
84 | 84 | } |
85 | - catch( \Aimeos\MShop\Order\Exception $e ) { ; } // If address isn't available |
|
85 | + catch( \Aimeos\MShop\Order\Exception $e ) |
|
86 | + { |
|
87 | +; } // If address isn't available |
|
86 | 88 | |
87 | 89 | foreach( $feconfig as $key => $config ) { |
88 | 90 | $list[$key] = new \Aimeos\MW\Criteria\Attribute\Standard( $config ); |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | $address = $basket->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT ); |
80 | 80 | |
81 | 81 | if( ( $fn = $address->getFirstname() ) !== '' && ( $ln = $address->getLastname() ) !== '' ) { |
82 | - $feconfig['directdebit.accountowner']['default'] = $fn . ' ' . $ln; |
|
82 | + $feconfig['directdebit.accountowner']['default'] = $fn.' '.$ln; |
|
83 | 83 | } |
84 | 84 | } |
85 | - catch( \Aimeos\MShop\Order\Exception $e ) { ; } // If address isn't available |
|
85 | + catch( \Aimeos\MShop\Order\Exception $e ) {; } // If address isn't available |
|
86 | 86 | |
87 | 87 | foreach( $feconfig as $key => $config ) { |
88 | 88 | $list[$key] = new \Aimeos\MW\Criteria\Attribute\Standard( $config ); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $len = strlen( $value ); |
124 | 124 | $xstr = ( $len > 3 ? str_repeat( 'X', $len - 3 ) : '' ); |
125 | 125 | |
126 | - $attrItem->setValue( $xstr . substr( $value, -3 ) ); |
|
126 | + $attrItem->setValue( $xstr.substr( $value, -3 ) ); |
|
127 | 127 | $orderServiceItem->setAttributeItem( $attrItem ); |
128 | 128 | } |
129 | 129 | } |
@@ -90,8 +90,8 @@ |
||
90 | 90 | |
91 | 91 | foreach( $required as $entry ) |
92 | 92 | { |
93 | - if ( !isset($params[$entry]) ) { |
|
94 | - throw new \Aimeos\MW\Common\Exception( sprintf('Required parameter "%1$s" is missing', $entry) ); |
|
93 | + if( !isset( $params[$entry] ) ) { |
|
94 | + throw new \Aimeos\MW\Common\Exception( sprintf( 'Required parameter "%1$s" is missing', $entry ) ); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 |
@@ -71,8 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | if( in_array( $op, $operators['combine'] ) ) { |
73 | 73 | return $this->createCombineExpression( $op, (array) $value ); |
74 | - } |
|
75 | - else if( in_array( $op, $operators['compare'] ) ) { |
|
74 | + } else if( in_array( $op, $operators['compare'] ) ) { |
|
76 | 75 | return $this->createCompareExpression( $op, (array) $value ); |
77 | 76 | } |
78 | 77 | |
@@ -126,11 +125,9 @@ discard block |
||
126 | 125 | |
127 | 126 | if( in_array( $op, $operators['combine'] ) ) { |
128 | 127 | $results[] = $this->createCombineExpression( $op, (array) $entry[$op] ); |
129 | - } |
|
130 | - else if( in_array( $op, $operators['compare'] ) ) { |
|
128 | + } else if( in_array( $op, $operators['compare'] ) ) { |
|
131 | 129 | $results[] = $this->createCompareExpression( $op, (array) $entry[$op] ); |
132 | - } |
|
133 | - else { |
|
130 | + } else { |
|
134 | 131 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Invalid operator "%1$s"', $op ) ); |
135 | 132 | } |
136 | 133 | } |
@@ -226,8 +226,7 @@ |
||
226 | 226 | |
227 | 227 | $params[] = implode( ',', $list ); |
228 | 228 | } |
229 | - } |
|
230 | - else |
|
229 | + } else |
|
231 | 230 | { |
232 | 231 | $params[] = $this->escape( '==', $this->getParamType( $string ), $string ); |
233 | 232 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public static function createFunction( $name, array $params ) |
34 | 34 | { |
35 | - return $name . '(' . self::createSignature( $params ) . ')'; |
|
35 | + return $name.'('.self::createSignature( $params ).')'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | case 'double': |
56 | 56 | $list[] = $param; break; |
57 | 57 | case 'array': |
58 | - $list[] = '[' . self::createSignature( $param ) . ']'; break; |
|
58 | + $list[] = '['.self::createSignature( $param ).']'; break; |
|
59 | 59 | default: |
60 | - $list[] = '"' . $param . '"'; |
|
60 | + $list[] = '"'.$param.'"'; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | protected function isFunction( &$name, array &$params ) |
78 | 78 | { |
79 | 79 | $len = strlen( $name ); |
80 | - if( $len === 0 || $name[$len-1] !== ')' ) { return false; } |
|
80 | + if( $len === 0 || $name[$len - 1] !== ')' ) { return false; } |
|
81 | 81 | |
82 | 82 | if( ( $pos = strpos( $name, '(' ) ) === false ) { |
83 | 83 | throw new \Aimeos\MW\Common\Exception( 'Missing opening bracket for function syntax' ); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $params = $this->extractParams( $matches[1] ); |
103 | 103 | } |
104 | 104 | |
105 | - $name = $namestr . '()'; |
|
105 | + $name = $namestr.'()'; |
|
106 | 106 | return true; |
107 | 107 | } |
108 | 108 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $count = count( $params ); |
131 | 131 | |
132 | 132 | for( $i = 0; $i < $count; $i++ ) { |
133 | - $find[$i] = '$' . ( $i + 1 ); |
|
133 | + $find[$i] = '$'.( $i + 1 ); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | return str_replace( $find, $params, $transname ); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | protected function setPlugins( array $plugins ) |
170 | 170 | { |
171 | - \Aimeos\MW\Common\Base::checkClassList('\\Aimeos\\MW\\Criteria\\Plugin\\Iface', $plugins); |
|
171 | + \Aimeos\MW\Common\Base::checkClassList( '\\Aimeos\\MW\\Criteria\\Plugin\\Iface', $plugins ); |
|
172 | 172 | |
173 | 173 | $this->plugins = $plugins; |
174 | 174 | } |
@@ -185,12 +185,10 @@ |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | return 'string'; |
188 | - } |
|
189 | - else if( strpos( $item, '.' ) !== false ) |
|
188 | + } else if( strpos( $item, '.' ) !== false ) |
|
190 | 189 | { |
191 | 190 | return 'float'; |
192 | - } |
|
193 | - else if( ctype_digit( $item ) !== false ) |
|
191 | + } else if( ctype_digit( $item ) !== false ) |
|
194 | 192 | { |
195 | 193 | return 'int'; |
196 | 194 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | protected function createTerm( $name, $type, $value ) |
63 | 63 | { |
64 | 64 | $escaped = $this->escape( $this->getOperator(), $type, $value ); |
65 | - return $name . ' ' . self::$operators[$this->getOperator()] . ' ' . $escaped; |
|
65 | + return $name.' '.self::$operators[$this->getOperator()].' '.$escaped; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | switch( $this->getOperator() ) |
78 | 78 | { |
79 | 79 | case '==': |
80 | - return $name . ' === null'; |
|
80 | + return $name.' === null'; |
|
81 | 81 | case '!=': |
82 | - return $name . ' !== null'; |
|
82 | + return $name.' !== null'; |
|
83 | 83 | default: |
84 | 84 | throw new \Aimeos\MW\Common\Exception( sprintf( 'null value not allowed for operator "%1$s"', $this->getOperator() ) ); |
85 | 85 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | foreach( (array) $this->getValue() as $value ) { |
104 | 104 | $list[] = $this->createTerm( $name, $type, $value ); |
105 | 105 | } |
106 | - return '( ' . implode( ' || ', $list ) . ' )'; |
|
106 | + return '( '.implode( ' || ', $list ).' )'; |
|
107 | 107 | |
108 | 108 | case '!=': |
109 | 109 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach( (array) $this->getValue() as $value ) { |
112 | 112 | $list[] = $this->createTerm( $name, $type, $value ); |
113 | 113 | } |
114 | - return '( ' . implode( ' && ', $list ) . ' )'; |
|
114 | + return '( '.implode( ' && ', $list ).' )'; |
|
115 | 115 | |
116 | 116 | default: |
117 | 117 | throw new \Aimeos\MW\Common\Exception( sprintf( 'List Term not allowed for operator "%1$s"', $this->getOperator() ) ); |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | $string = $this->escape( $this->getOperator(), $type, $val ); |
136 | 136 | |
137 | 137 | while( ( $val = next( $values ) ) !== false ) { |
138 | - $string .= ',' . $this->escape( $this->getOperator(), $type, $val ); |
|
138 | + $string .= ','.$this->escape( $this->getOperator(), $type, $val ); |
|
139 | 139 | } |
140 | 140 | |
141 | - return 'array(' . $string . ')'; |
|
141 | + return 'array('.$string.')'; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | case 'float': |
164 | 164 | $value = (double) $value; break; |
165 | 165 | default: |
166 | - $value = '\'' . addcslashes( $value, '\'' ) . '\''; |
|
166 | + $value = '\''.addcslashes( $value, '\'' ).'\''; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | return $value; |
@@ -189,12 +189,10 @@ |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | return \Aimeos\MW\DB\Statement\Base::PARAM_STR; |
192 | - } |
|
193 | - else if( strpos( $item, '.' ) !== false ) |
|
192 | + } else if( strpos( $item, '.' ) !== false ) |
|
194 | 193 | { |
195 | 194 | return \Aimeos\MW\DB\Statement\Base::PARAM_FLOAT; |
196 | - } |
|
197 | - else if( ctype_digit( $item ) !== false ) |
|
195 | + } else if( ctype_digit( $item ) !== false ) |
|
198 | 196 | { |
199 | 197 | return \Aimeos\MW\DB\Statement\Base::PARAM_INT; |
200 | 198 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | protected function createTerm( $name, $type, $value ) |
66 | 66 | { |
67 | - $term = $name . ' ' . self::$operators[$this->getOperator()] . ' ' . $this->escape( $this->getOperator(), $type, $value ); |
|
67 | + $term = $name.' '.self::$operators[$this->getOperator()].' '.$this->escape( $this->getOperator(), $type, $value ); |
|
68 | 68 | |
69 | 69 | if( in_array( $this->getOperator(), array( '=~', '~=' ), true ) ) { |
70 | 70 | $term .= ' ESCAPE \'#\''; |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | switch( $this->getOperator() ) |
86 | 86 | { |
87 | 87 | case '==': |
88 | - return $name . ' IS NULL'; |
|
88 | + return $name.' IS NULL'; |
|
89 | 89 | case '!=': |
90 | - return $name . ' IS NOT NULL'; |
|
90 | + return $name.' IS NOT NULL'; |
|
91 | 91 | default: |
92 | 92 | throw new \Aimeos\MW\Common\Exception( sprintf( 'NULL value not allowed for operator "%1$s"', $this->getOperator() ) ); |
93 | 93 | } |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | switch( $this->getOperator() ) |
107 | 107 | { |
108 | 108 | case '==': |
109 | - return $name . ' IN ' . $this->createValueList( $type, (array) $this->getValue() ); |
|
109 | + return $name.' IN '.$this->createValueList( $type, (array) $this->getValue() ); |
|
110 | 110 | case '!=': |
111 | - return $name . ' NOT IN ' . $this->createValueList( $type, (array) $this->getValue() ); |
|
111 | + return $name.' NOT IN '.$this->createValueList( $type, (array) $this->getValue() ); |
|
112 | 112 | default: |
113 | 113 | $terms = []; |
114 | 114 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $terms[] = $this->createTerm( $name, $type, $val ); |
117 | 117 | } |
118 | 118 | |
119 | - return '(' . implode( ' OR ', $terms ) . ')'; |
|
119 | + return '('.implode( ' OR ', $terms ).')'; |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $values[$key] = $this->escape( $operator, $type, $value ); |
141 | 141 | } |
142 | 142 | |
143 | - return '(' . implode(',', $values) . ')'; |
|
143 | + return '('.implode( ',', $values ).')'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | if( in_array( $operator, array( '~=', '=~' ), true ) ) |
169 | 169 | { |
170 | 170 | $value = str_replace( array( '%', '_', '[' ), array( '#%', '#_', '#[' ), $this->conn->escape( $value ) ); |
171 | - $value = '\'%' . $value . '%\''; break; |
|
171 | + $value = '\'%'.$value.'%\''; break; |
|
172 | 172 | } |
173 | 173 | default: |
174 | - $value = '\'' . $this->conn->escape( $value ) . '\''; |
|
174 | + $value = '\''.$this->conn->escape( $value ).'\''; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return $value; |
@@ -143,12 +143,10 @@ |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | return '(string)'; |
146 | - } |
|
147 | - else if( strpos( $item, '.' ) !== false ) |
|
146 | + } else if( strpos( $item, '.' ) !== false ) |
|
148 | 147 | { |
149 | 148 | return '(float)'; |
150 | - } |
|
151 | - else if( ctype_digit( $item ) !== false ) |
|
149 | + } else if( ctype_digit( $item ) !== false ) |
|
152 | 150 | { |
153 | 151 | return '(int)'; |
154 | 152 | } |
@@ -99,7 +99,7 @@ |
||
99 | 99 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Invalid name "%1$s"', $name ) ); |
100 | 100 | } |
101 | 101 | |
102 | - return self::$operators[$this->operator] . '(' . $transname . ');'; |
|
102 | + return self::$operators[$this->operator].'('.$transname.');'; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | public function testException1() |
83 | 83 | { |
84 | - $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
84 | + $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
85 | 85 | new \Aimeos\MW\Criteria\Expression\Sort\PHP( '/', 'test(1,2)' ); |
86 | 86 | } |
87 | 87 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $object = new \Aimeos\MW\Criteria\Expression\Sort\PHP( '+', 'wrongType' ); |
100 | 100 | |
101 | - $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
101 | + $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
102 | 102 | $object->toString( $types, $translations ); |
103 | 103 | } |
104 | 104 |