@@ -50,8 +50,7 @@ |
||
50 | 50 | if( isset( $config['fixedrebate.rebate'][$currency] ) ) { |
51 | 51 | $rebate = $config['fixedrebate.rebate'][$currency]; |
52 | 52 | } |
53 | - } |
|
54 | - else |
|
53 | + } else |
|
55 | 54 | { |
56 | 55 | $rebate = $config['fixedrebate.rebate']; |
57 | 56 | } |
@@ -209,7 +209,7 @@ |
||
209 | 209 | { |
210 | 210 | $path = 'mshop/plugin/manager/submanagers'; |
211 | 211 | |
212 | - return $this->getResourceTypeBase( 'plugin', $path, array( 'type'), $withsub ); |
|
212 | + return $this->getResourceTypeBase( 'plugin', $path, array( 'type' ), $withsub ); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 |
@@ -444,8 +444,7 @@ |
||
444 | 444 | * @see mshop/plugin/manager/standard/count/ansi |
445 | 445 | */ |
446 | 446 | $path = 'mshop/plugin/manager/standard/insert'; |
447 | - } |
|
448 | - else |
|
447 | + } else |
|
449 | 448 | { |
450 | 449 | /** mshop/plugin/manager/standard/update/mysql |
451 | 450 | * Updates an existing plugin record in the database |
@@ -118,10 +118,11 @@ |
||
118 | 118 | ) { |
119 | 119 | return false; |
120 | 120 | } |
121 | - } |
|
122 | - else if( isset( $addresses[$paymentType] ) ) // use billing address if no delivery address is available |
|
121 | + } else if( isset( $addresses[$paymentType] ) ) { |
|
122 | + // use billing address if no delivery address is available |
|
123 | 123 | { |
124 | 124 | $code = strtoupper( $addresses[$paymentType]->getCountryId() ); |
125 | + } |
|
125 | 126 | |
126 | 127 | if( $this->checkCountryCode( $code, 'country.delivery-include' ) === false |
127 | 128 | || $this->checkCountryCode( $code, 'country.delivery-exclude' ) === true |
@@ -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 |
@@ -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 | |
@@ -166,13 +166,13 @@ discard block |
||
166 | 166 | $value = (double) $value; break; |
167 | 167 | case \Aimeos\MW\DB\Statement\Base::PARAM_STR: |
168 | 168 | if( $operator === '~=' ) { |
169 | - $value = '\'%' . str_replace( ['#', '%', '_', '['], ['##', '#%', '#_', '#['], $this->conn->escape( $value ) ) . '%\''; break; |
|
169 | + $value = '\'%'.str_replace( ['#', '%', '_', '['], ['##', '#%', '#_', '#['], $this->conn->escape( $value ) ).'%\''; break; |
|
170 | 170 | } |
171 | 171 | if( $operator === '=~' ) { |
172 | - $value = '\'' . str_replace( ['#', '%', '_', '['], ['##', '#%', '#_', '#['], $this->conn->escape( $value ) ) . '%\''; break; |
|
172 | + $value = '\''.str_replace( ['#', '%', '_', '['], ['##', '#%', '#_', '#['], $this->conn->escape( $value ) ).'%\''; break; |
|
173 | 173 | } |
174 | 174 | default: |
175 | - $value = '\'' . $this->conn->escape( $value ) . '\''; |
|
175 | + $value = '\''.$this->conn->escape( $value ).'\''; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | 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 |