@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return array( |
4 | - 'subsubitem' => array ( |
|
4 | + 'subsubitem' => array( |
|
5 | 5 | 'aa' => array( |
6 | 6 | 'aaa' => '111', |
7 | 7 | ), |
8 | 8 | ), |
9 | 9 | 'subsubblablub' => array( |
10 | - 'bb' => array ( |
|
10 | + 'bb' => array( |
|
11 | 11 | 'bbb' => '222', |
12 | 12 | ), |
13 | 13 | ), |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return array( |
4 | - 'subitem' => array ( |
|
4 | + 'subitem' => array( |
|
5 | 5 | 'a' => array( |
6 | 6 | 'aa' => '11', |
7 | 7 | ), |
8 | 8 | ), |
9 | 9 | 'subbla' => array( |
10 | - 'b' => array ( |
|
10 | + 'b' => array( |
|
11 | 11 | 'bb' => '22', |
12 | 12 | ), |
13 | 13 | ), |
@@ -109,7 +109,7 @@ |
||
109 | 109 | |
110 | 110 | $lcList = array( |
111 | 111 | 0 => array( |
112 | - 'am', 'ar','bh', 'fil', 'fr', 'gun', 'hi', 'ln', 'lv','mg', 'nso', 'xbr', 'ti', 'wa', 'pt_BR' |
|
112 | + 'am', 'ar', 'bh', 'fil', 'fr', 'gun', 'hi', 'ln', 'lv', 'mg', 'nso', 'xbr', 'ti', 'wa', 'pt_BR' |
|
113 | 113 | ), |
114 | 114 | 1 => array( |
115 | 115 | 'af', 'az', 'bn', 'bg', 'ca', 'da', 'de', 'el', 'en', 'eo', 'es', |
@@ -266,10 +266,13 @@ |
||
266 | 266 | |
267 | 267 | $conn = $this->object->acquire(); |
268 | 268 | |
269 | - try { |
|
269 | + try |
|
270 | + { |
|
270 | 271 | $stmt = $conn->create( $sqlinsert ); |
271 | 272 | $stmt->execute(); |
272 | - } catch ( \Aimeos\MW\DB\Exception $de ) { |
|
273 | + } |
|
274 | + catch ( \Aimeos\MW\DB\Exception $de ) |
|
275 | + { |
|
273 | 276 | $this->object->release( $conn ); |
274 | 277 | return; |
275 | 278 | } |
@@ -256,15 +256,15 @@ discard block |
||
256 | 256 | |
257 | 257 | public function testStmtSimpleInvalidBindParamType() |
258 | 258 | { |
259 | - $sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
|
259 | + $sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
|
260 | 260 | |
261 | 261 | $conn = $this->object->acquire(); |
262 | 262 | |
263 | 263 | try |
264 | 264 | { |
265 | 265 | $stmt2 = $conn->create( $sqlinsert2 ); |
266 | - $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
267 | - $stmt2->bind( 2, 0.15, 123); |
|
266 | + $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
267 | + $stmt2->bind( 2, 0.15, 123 ); |
|
268 | 268 | $stmt2->execute(); |
269 | 269 | } |
270 | 270 | catch( \Aimeos\MW\DB\Exception $de ) |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | $this->object->release( $conn ); |
277 | - $this->fail('An expected exception has not been raised'); |
|
277 | + $this->fail( 'An expected exception has not been raised' ); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | |
@@ -287,13 +287,13 @@ discard block |
||
287 | 287 | try { |
288 | 288 | $stmt = $conn->create( $sqlinsert ); |
289 | 289 | $stmt->execute(); |
290 | - } catch ( \Aimeos\MW\DB\Exception $de ) { |
|
290 | + } catch( \Aimeos\MW\DB\Exception $de ) { |
|
291 | 291 | $this->object->release( $conn ); |
292 | 292 | return; |
293 | 293 | } |
294 | 294 | |
295 | 295 | $this->object->release( $conn ); |
296 | - $this->fail('An expected exception has not been raised'); |
|
296 | + $this->fail( 'An expected exception has not been raised' ); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $stmt->bind( 2, 'test', 123 ); |
353 | 353 | $stmt->execute(); |
354 | 354 | } |
355 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
355 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
356 | 356 | { |
357 | 357 | $this->object->release( $conn ); |
358 | 358 | throw $e; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | { |
383 | 383 | $conn->create( $sql )->execute()->finish(); |
384 | 384 | } |
385 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
385 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
386 | 386 | { |
387 | 387 | $this->object->release( $conn ); |
388 | 388 | throw $e; |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | { |
401 | 401 | $conn->create( 'SELECT *' )->execute()->finish(); |
402 | 402 | } |
403 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
403 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
404 | 404 | { |
405 | 405 | $this->object->release( $conn ); |
406 | 406 | throw $e; |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | { |
421 | 421 | $conn->create( $sql, 123 ); |
422 | 422 | } |
423 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
423 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
424 | 424 | { |
425 | 425 | $this->object->release( $conn ); |
426 | 426 | throw $e; |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | |
440 | 440 | public function testDBFactory() |
441 | 441 | { |
442 | - $this->assertInstanceOf(\Aimeos\MW\DB\Manager\Iface::class, $this->object); |
|
442 | + $this->assertInstanceOf( \Aimeos\MW\DB\Manager\Iface::class, $this->object ); |
|
443 | 443 | } |
444 | 444 | |
445 | 445 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | public function getPostDependencies() |
15 | 15 | { |
16 | - return array( 'TwoTask'); |
|
16 | + return array( 'TwoTask' ); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 |
@@ -72,7 +72,7 @@ |
||
72 | 72 | |
73 | 73 | ini_set( "error_log", "error.log" ); |
74 | 74 | |
75 | - $this->object = new \Aimeos\MW\Logger\Errorlog( \Aimeos\MW\Logger\Base::DEBUG, array('test') ); |
|
75 | + $this->object = new \Aimeos\MW\Logger\Errorlog( \Aimeos\MW\Logger\Base::DEBUG, array( 'test' ) ); |
|
76 | 76 | $this->object->log( 'info test', \Aimeos\MW\Logger\Base::INFO, 'info' ); |
77 | 77 | |
78 | 78 | ini_restore( "error_log" ); |
@@ -24,11 +24,11 @@ |
||
24 | 24 | |
25 | 25 | |
26 | 26 | /** |
27 | - * Includes config files using a simple caching. |
|
28 | - * |
|
29 | - * @param string $file Path and file name of a config file |
|
30 | - * @return array Value of the requested config file |
|
31 | - **/ |
|
27 | + * Includes config files using a simple caching. |
|
28 | + * |
|
29 | + * @param string $file Path and file name of a config file |
|
30 | + * @return array Value of the requested config file |
|
31 | + **/ |
|
32 | 32 | protected function includeFile( $file ) |
33 | 33 | { |
34 | 34 | if( !isset( $this->includeCache[$file] ) ) { |
@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | { |
67 | 67 | foreach( $this->getTranslations( $domain ) as $content ) |
68 | 68 | { |
69 | - if ( isset( $content[$string][0] ) && is_array( $content[$string] ) ) { |
|
69 | + if( isset( $content[$string][0] ) && is_array( $content[$string] ) ) { |
|
70 | 70 | return $content[$string][0]; |
71 | 71 | } |
72 | 72 | |
73 | - if ( isset( $content[$string] ) && is_string( $content[$string] ) ) { |
|
73 | + if( isset( $content[$string] ) && is_string( $content[$string] ) ) { |
|
74 | 74 | return $content[$string]; |
75 | 75 | } |
76 | 76 | } |
77 | 77 | } |
78 | - catch( \Exception $e ) { ; } // no translation found |
|
78 | + catch( \Exception $e ) {; } // no translation found |
|
79 | 79 | |
80 | 80 | return (string) $string; |
81 | 81 | } |
@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | { |
100 | 100 | foreach( $this->getTranslations( $domain ) as $content ) |
101 | 101 | { |
102 | - if ( isset( $content[$singular][$index] ) && is_array( $content[$singular] ) ) { |
|
102 | + if( isset( $content[$singular][$index] ) && is_array( $content[$singular] ) ) { |
|
103 | 103 | return $content[$singular][$index]; |
104 | 104 | } |
105 | 105 | } |
106 | 106 | } |
107 | - catch( \Exception $e ) { ; } // no translation found |
|
107 | + catch( \Exception $e ) {; } // no translation found |
|
108 | 108 | |
109 | 109 | if( $index > 0 ) { |
110 | 110 | return (string) $plural; |
@@ -75,7 +75,9 @@ discard block |
||
75 | 75 | } |
76 | 76 | } |
77 | 77 | } |
78 | - catch( \Exception $e ) { ; } // no translation found |
|
78 | + catch( \Exception $e ) |
|
79 | + { |
|
80 | +; } // no translation found |
|
79 | 81 | |
80 | 82 | return (string) $string; |
81 | 83 | } |
@@ -104,7 +106,9 @@ discard block |
||
104 | 106 | } |
105 | 107 | } |
106 | 108 | } |
107 | - catch( \Exception $e ) { ; } // no translation found |
|
109 | + catch( \Exception $e ) |
|
110 | + { |
|
111 | +; } // no translation found |
|
108 | 112 | |
109 | 113 | if( $index > 0 ) { |
110 | 114 | return (string) $plural; |
@@ -201,8 +201,7 @@ discard block |
||
201 | 201 | if( $level === \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ) { |
202 | 202 | return $node; |
203 | 203 | } |
204 | - } |
|
205 | - else |
|
204 | + } else |
|
206 | 205 | { |
207 | 206 | $node = $this->getNodeById( $id ); |
208 | 207 | |
@@ -276,15 +275,13 @@ discard block |
||
276 | 275 | $node->left = $refNode->left; |
277 | 276 | $node->right = $refNode->left + 1; |
278 | 277 | $node->level = $refNode->level; |
279 | - } |
|
280 | - else if( $parentId !== null ) |
|
278 | + } else if( $parentId !== null ) |
|
281 | 279 | { |
282 | 280 | $parentNode = $this->getNode( $parentId, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ); |
283 | 281 | $node->left = $parentNode->right; |
284 | 282 | $node->right = $parentNode->right + 1; |
285 | 283 | $node->level = $parentNode->level + 1; |
286 | - } |
|
287 | - else |
|
284 | + } else |
|
288 | 285 | { |
289 | 286 | $node->left = 1; |
290 | 287 | $node->right = 2; |
@@ -375,8 +372,7 @@ discard block |
||
375 | 372 | $moveNodeRightBegin = $node->left + $diff + 1; |
376 | 373 | $moveNodeRightEnd = $node->right + $diff; |
377 | 374 | $movesize = $refNode->left - $node->left - $diff; |
378 | - } |
|
379 | - else |
|
375 | + } else |
|
380 | 376 | { |
381 | 377 | $moveNodeLeftBegin = $node->left; |
382 | 378 | $moveNodeLeftEnd = $node->right - 1; |
@@ -387,8 +383,7 @@ discard block |
||
387 | 383 | |
388 | 384 | $closeNodeLeftBegin = $node->left + $diff; |
389 | 385 | $closeNodeRightBegin = $node->left + $diff; |
390 | - } |
|
391 | - else |
|
386 | + } else |
|
392 | 387 | { |
393 | 388 | $refNode = $this->getNode( $newParentId, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ); |
394 | 389 | |
@@ -414,8 +409,7 @@ discard block |
||
414 | 409 | $moveNodeRightBegin = $node->left + $diff + 1; |
415 | 410 | $moveNodeRightEnd = $node->right + $diff; |
416 | 411 | $movesize = $refNode->right - $node->left - $diff; |
417 | - } |
|
418 | - else |
|
412 | + } else |
|
419 | 413 | { |
420 | 414 | $moveNodeLeftBegin = $node->left; |
421 | 415 | $moveNodeLeftEnd = $node->right - 1; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $diff = $node->right - $node->left + 1; |
161 | 161 | |
162 | 162 | $stmt = $conn->create( $this->config['move-left'] ); |
163 | - $stmt->bind( 1, -$diff, $this->searchConfig['left']['internaltype']); |
|
163 | + $stmt->bind( 1, -$diff, $this->searchConfig['left']['internaltype'] ); |
|
164 | 164 | $stmt->bind( 2, 0, $this->searchConfig['level']['internaltype'] ); |
165 | 165 | $stmt->bind( 3, $node->right + 1, $this->searchConfig['left']['internaltype'] ); |
166 | 166 | $stmt->bind( 4, 0x7FFFFFFF, $this->searchConfig['left']['internaltype'] ); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $search->getConditions(), |
224 | 224 | $condition->getConditions() |
225 | 225 | ); |
226 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
226 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | $types = $this->getSearchTypes( $this->searchConfig ); |
@@ -538,14 +538,14 @@ discard block |
||
538 | 538 | */ |
539 | 539 | public function searchNodes( \Aimeos\MW\Criteria\Iface $search, $id = null ) |
540 | 540 | { |
541 | - $left = 1; |
|
541 | + $left = 1; |
|
542 | 542 | $right = 0x7FFFFFFF; |
543 | 543 | |
544 | 544 | if( $id !== null ) |
545 | 545 | { |
546 | 546 | $node = $this->getNodeById( $id ); |
547 | 547 | |
548 | - $left = $node->left; |
|
548 | + $left = $node->left; |
|
549 | 549 | $right = $node->right; |
550 | 550 | } |
551 | 551 | |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | |
622 | 622 | $results = $this->searchNodes( $search ); |
623 | 623 | |
624 | - foreach ( $results as $item ) { |
|
624 | + foreach( $results as $item ) { |
|
625 | 625 | $result[$item->getId()] = $item; |
626 | 626 | } |
627 | 627 | |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | */ |
734 | 734 | protected function isChild( \Aimeos\MW\Tree\Node\Iface $node, \Aimeos\MW\Tree\Node\Iface $parent ) |
735 | 735 | { |
736 | - return $node->__get('left') > $parent->__get('left') && $node->__get('right') < $parent->__get('right'); |
|
736 | + return $node->__get( 'left' ) > $parent->__get( 'left' ) && $node->__get( 'right' ) < $parent->__get( 'right' ); |
|
737 | 737 | } |
738 | 738 | |
739 | 739 |