Completed
Push — master ( 6b3f15...fe5cb0 )
by Aimeos
09:22
created
lib/mwlib/tests/MW/Logger/FileTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@
 block discarded – undo
58 58
 		$this->assertEquals( 'error', $msg[4] );
59 59
 
60 60
 
61
-		$this->setExpectedException('\\Aimeos\\MW\\Logger\\Exception');
62
-		$this->object->log( 'wrong log level', -1);
61
+		$this->setExpectedException( '\\Aimeos\\MW\\Logger\\Exception' );
62
+		$this->object->log( 'wrong log level', -1 );
63 63
 	}
64 64
 
65 65
 	public function testScalarLog()
66 66
 	{
67
-		$this->object->log( array ( 'scalar', 'errortest' ) );
67
+		$this->object->log( array( 'scalar', 'errortest' ) );
68 68
 
69 69
 		if( !file_exists( $this->filename ) ) {
70 70
 			throw new \RuntimeException( 'No test file found' );
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/DB/PDOTest.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -266,10 +266,13 @@
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		$conn = $this->object->acquire();
208 208
 
209 209
 		$value = "(\\')";
210
-		$sqlinsert = str_replace( ':value', '\'' . $conn->escape( $value ) . '\'', $sqlinsert );
210
+		$sqlinsert = str_replace( ':value', '\''.$conn->escape( $value ).'\'', $sqlinsert );
211 211
 		$stmt = $conn->create( $sqlinsert );
212 212
 		$stmt->execute()->finish();
213 213
 
@@ -235,12 +235,12 @@  discard block
 block discarded – undo
235 235
 
236 236
 	public function testStmtSimpleBindTwo()
237 237
 	{
238
-		$sqlinsert2 =  'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)';
238
+		$sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)';
239 239
 
240 240
 		$conn = $this->object->acquire();
241 241
 
242 242
 		$stmt2 = $conn->create( $sqlinsert2 );
243
-		$stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
243
+		$stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
244 244
 		$stmt2->bind( 2, 0.12 );
245 245
 		$stmt2->execute()->finish();
246 246
 
@@ -252,12 +252,12 @@  discard block
 block discarded – undo
252 252
 
253 253
 	public function testStmtSimpleBindThree()
254 254
 	{
255
-		$sqlinsert3 =  'INSERT INTO "mw_unit_test" ("name", "id") VALUES (\'?te?st?\', ?)';
255
+		$sqlinsert3 = 'INSERT INTO "mw_unit_test" ("name", "id") VALUES (\'?te?st?\', ?)';
256 256
 
257 257
 		$conn = $this->object->acquire();
258 258
 
259 259
 		$stmt2 = $conn->create( $sqlinsert3 );
260
-		$stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
260
+		$stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
261 261
 		$stmt2->execute()->finish();
262 262
 
263 263
 		$this->object->release( $conn );
@@ -268,15 +268,15 @@  discard block
 block discarded – undo
268 268
 
269 269
 	public function testStmtSimpleInvalidBindParamType()
270 270
 	{
271
-		$sqlinsert2 =  'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)';
271
+		$sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)';
272 272
 
273 273
 		$conn = $this->object->acquire();
274 274
 
275 275
 		try
276 276
 		{
277 277
 			$stmt2 = $conn->create( $sqlinsert2 );
278
-			$stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
279
-			$stmt2->bind( 2, 0.15, 123);
278
+			$stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
279
+			$stmt2->bind( 2, 0.15, 123 );
280 280
 			$stmt2->execute();
281 281
 		}
282 282
 		catch( \Aimeos\MW\DB\Exception $de )
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 		}
287 287
 
288 288
 		$this->object->release( $conn );
289
-		$this->fail('An expected exception has not been raised');
289
+		$this->fail( 'An expected exception has not been raised' );
290 290
 	}
291 291
 
292 292
 
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 		try {
300 300
 			$stmt = $conn->create( $sqlinsert );
301 301
 			$stmt->execute();
302
-		} catch ( \Aimeos\MW\DB\Exception $de ) {
302
+		} catch( \Aimeos\MW\DB\Exception $de ) {
303 303
 			$this->object->release( $conn );
304 304
 			return;
305 305
 		}
306 306
 
307 307
 		$this->object->release( $conn );
308
-		$this->fail('An expected exception has not been raised');
308
+		$this->fail( 'An expected exception has not been raised' );
309 309
 	}
310 310
 
311 311
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 
409 409
 	public function testWrongFieldType()
410 410
 	{
411
-		$this->setExpectedException('\\Aimeos\\MW\\DB\\Exception');
411
+		$this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' );
412 412
 		$sqlinsert = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)';
413 413
 
414 414
 		$conn = $this->object->acquire();
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 			$stmt->bind( 2, 'test', 123 );
421 421
 			$stmt->execute();
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;
@@ -444,13 +444,13 @@  discard block
 block discarded – undo
444 444
 
445 445
 		$conn = $this->object->acquire();
446 446
 
447
-		$this->setExpectedException('\\Aimeos\\MW\\DB\\Exception');
447
+		$this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' );
448 448
 
449 449
 		try
450 450
 		{
451 451
 			$conn->create( $sql )->execute()->finish();
452 452
 		}
453
-		catch ( \Aimeos\MW\DB\Exception $e )
453
+		catch( \Aimeos\MW\DB\Exception $e )
454 454
 		{
455 455
 			$this->object->release( $conn );
456 456
 			throw $e;
@@ -462,13 +462,13 @@  discard block
 block discarded – undo
462 462
 	{
463 463
 		$conn = $this->object->acquire();
464 464
 
465
-		$this->setExpectedException('\\Aimeos\\MW\\DB\\Exception');
465
+		$this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' );
466 466
 
467 467
 		try
468 468
 		{
469 469
 			$conn->create( 'SELECT *' )->execute()->finish();
470 470
 		}
471
-		catch ( \Aimeos\MW\DB\Exception $e )
471
+		catch( \Aimeos\MW\DB\Exception $e )
472 472
 		{
473 473
 			$this->object->release( $conn );
474 474
 			throw $e;
@@ -482,13 +482,13 @@  discard block
 block discarded – undo
482 482
 
483 483
 		$conn = $this->object->acquire();
484 484
 
485
-		$this->setExpectedException('\\Aimeos\\MW\\DB\\Exception');
485
+		$this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' );
486 486
 
487 487
 		try
488 488
 		{
489 489
 			$conn->create( $sql, 123 );
490 490
 		}
491
-		catch (\Aimeos\MW\DB\Exception $e)
491
+		catch( \Aimeos\MW\DB\Exception $e )
492 492
 		{
493 493
 			$this->object->release( $conn );
494 494
 			throw $e;
@@ -500,20 +500,20 @@  discard block
 block discarded – undo
500 500
 	{
501 501
 		$mock = $this->getMockBuilder( '\Aimeos\MW\DB\Connection\Iface' )->getMock();
502 502
 
503
-		$this->setExpectedException('\\Aimeos\\MW\\DB\\Exception');
503
+		$this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' );
504 504
 		$this->object->release( $mock );
505 505
 	}
506 506
 
507 507
 
508 508
 	public function testDBFactory()
509 509
 	{
510
-		$this->assertInstanceOf('\\Aimeos\\MW\\DB\\Manager\\Iface', $this->object);
510
+		$this->assertInstanceOf( '\\Aimeos\\MW\\DB\\Manager\\Iface', $this->object );
511 511
 	}
512 512
 
513 513
 
514 514
 	public function testFactoryFail()
515 515
 	{
516
-		$this->setExpectedException('\\Aimeos\\MW\\DB\\Exception');
516
+		$this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' );
517 517
 		\Aimeos\MW\DB\Factory::createManager( \TestHelperMw::getConfig(), 'notDefined' );
518 518
 	}
519 519
 }
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Setup/Task/Base.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * Undo all schema changes and migrate data back
64 64
 	 *
65 65
 	 * @return void
66
-	*/
66
+	 */
67 67
 	public function rollback()
68 68
 	{
69 69
 	}
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 * Cleans up old data required for roll back
74 74
 	 *
75 75
 	 * @return void
76
-	*/
76
+	 */
77 77
 	public function clean()
78 78
 	{
79 79
 	}
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 	protected function msg( $msg, $level = 0 )
222 222
 	{
223 223
 		$pre = '';
224
-		for( $i = 0; $i < 2*$level; $i++ ) {
224
+		for( $i = 0; $i < 2 * $level; $i++ ) {
225 225
 			$pre .= ' ';
226 226
 		}
227 227
 
228
-		echo str_pad( $pre . $msg, 70 );
228
+		echo str_pad( $pre.$msg, 70 );
229 229
 	}
230 230
 
231 231
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	 */
237 237
 	protected function status( $status )
238 238
 	{
239
-		echo $status . PHP_EOL;
239
+		echo $status.PHP_EOL;
240 240
 	}
241 241
 
242 242
 
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
 		$matches = [];
253 253
 
254 254
 		$regex = '/CREATE TABLE \"?([a-zA-Z0-9_]+)\"? .*(\n\n|$)/sU';
255
-		if ( preg_match_all($regex, $content, $matches, PREG_SET_ORDER) === false ) {
256
-			throw new \Aimeos\MW\Setup\Exception('Unable to get table definitions');
255
+		if( preg_match_all( $regex, $content, $matches, PREG_SET_ORDER ) === false ) {
256
+			throw new \Aimeos\MW\Setup\Exception( 'Unable to get table definitions' );
257 257
 		}
258 258
 
259
-		foreach ( $matches as $match ) {
259
+		foreach( $matches as $match ) {
260 260
 			$defs[$match[1]] = $match[0];
261 261
 		}
262 262
 
@@ -275,12 +275,12 @@  discard block
 block discarded – undo
275 275
 		$defs = [];
276 276
 		$matches = [];
277 277
 
278
-		if ( preg_match_all('/CREATE [a-zA-Z]* ?INDEX \"?([a-zA-Z0-9_]+)\"? ON \"?([a-zA-Z0-9_]+)\"? .+(\n\n|$)/sU', $content, $matches, PREG_SET_ORDER) === false ) {
279
-			throw new \Aimeos\MW\Setup\Exception('Unable to get index definitions');
278
+		if( preg_match_all( '/CREATE [a-zA-Z]* ?INDEX \"?([a-zA-Z0-9_]+)\"? ON \"?([a-zA-Z0-9_]+)\"? .+(\n\n|$)/sU', $content, $matches, PREG_SET_ORDER ) === false ) {
279
+			throw new \Aimeos\MW\Setup\Exception( 'Unable to get index definitions' );
280 280
 		}
281 281
 
282
-		foreach ( $matches as $match ) {
283
-			$name = $match[2] . '.' . $match[1];
282
+		foreach( $matches as $match ) {
283
+			$name = $match[2].'.'.$match[1];
284 284
 			$defs[$name] = $match[0];
285 285
 		}
286 286
 
@@ -300,11 +300,11 @@  discard block
 block discarded – undo
300 300
 		$matches = [];
301 301
 
302 302
 		$regex = '/CREATE TRIGGER \"?([a-zA-Z0-9_]+)\"? .*(\n\n|$)/sU';
303
-		if ( preg_match_all($regex, $content, $matches, PREG_SET_ORDER) === false ) {
304
-			throw new \Aimeos\MW\Setup\Exception('Unable to get trigger definitions');
303
+		if( preg_match_all( $regex, $content, $matches, PREG_SET_ORDER ) === false ) {
304
+			throw new \Aimeos\MW\Setup\Exception( 'Unable to get trigger definitions' );
305 305
 		}
306 306
 
307
-		foreach ( $matches as $match ) {
307
+		foreach( $matches as $match ) {
308 308
 			$defs[$match[1]] = $match[0];
309 309
 		}
310 310
 
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Media/Image/Imagick.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,9 +112,12 @@
 block discarded – undo
112 112
 			}
113 113
 		}
114 114
 
115
-		try {
115
+		try
116
+		{
116 117
 			$this->image->resizeImage( $width, $height, \Imagick::FILTER_CUBIC, 0.8 );
117
-		} catch( \Exception $e ) {
118
+		}
119
+		catch( \Exception $e )
120
+		{
118 121
 			throw new \Aimeos\MW\Media\Exception( $e->getMessage() );
119 122
 		}
120 123
 
Please login to merge, or discard this patch.
lib/mwlib/src/MW/View/Standard.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 		{
66 66
 			if( ctype_alnum( $name ) === false )
67 67
 			{
68
-				$classname = is_string( $name ) ? '\\Aimeos\\MW\\View\\Helper\\' . $name : '<not a string>';
68
+				$classname = is_string( $name ) ? '\\Aimeos\\MW\\View\\Helper\\'.$name : '<not a string>';
69 69
 				throw new \Aimeos\MW\View\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
70 70
 			}
71 71
 
72 72
 			$iface = '\\Aimeos\\MW\\View\\Helper\\Iface';
73
-			$classname = '\\Aimeos\\MW\\View\\Helper\\' . ucfirst( $name ) . '\\Standard';
73
+			$classname = '\\Aimeos\\MW\\View\\Helper\\'.ucfirst( $name ).'\\Standard';
74 74
 
75 75
 			if( class_exists( $classname ) === false ) {
76 76
 				throw new \Aimeos\MW\View\Exception( sprintf( 'Class "%1$s" not available', $classname ) );
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
 		foreach( $this->engines as $fileext => $engine )
223 223
 		{
224
-			if( substr_compare( $filepath, $fileext, -strlen( $fileext ) ) ===0 ) {
224
+			if( substr_compare( $filepath, $fileext, -strlen( $fileext ) ) === 0 ) {
225 225
 				return $engine->render( $this, $filepath, $this->values );
226 226
 			}
227 227
 		}
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 			{
274 274
 				foreach( $relPaths as $relPath )
275 275
 				{
276
-					$absPath = $path . $ds . $relPath . $ds . $file;
276
+					$absPath = $path.$ds.$relPath.$ds.$file;
277 277
 					if( $ds !== '/' ) {
278 278
 						$absPath = str_replace( '/', $ds, $absPath );
279 279
 					}
Please login to merge, or discard this patch.
lib/mwlib/src/MW/View/Helper/Content/Standard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 	public function transform( $url )
55 55
 	{
56 56
 		if( strncmp( $url, 'http', 4 ) !== 0 && strncmp( $url, 'data:', 5 ) !== 0 ) {
57
-			$url = $this->baseurl . ( $url && $url[0] === '/' ? $url : '/' . $url );
57
+			$url = $this->baseurl.( $url && $url[0] === '/' ? $url : '/'.$url );
58 58
 		}
59 59
 
60 60
 		return $this->enc->attr( $url );
Please login to merge, or discard this patch.
lib/mwlib/src/MW/DB/Result/DBAL.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	{
48 48
 		try {
49 49
 			return $this->statement->rowCount();
50
-		} catch ( \Doctrine\DBAL\DBALException $e ) {
50
+		} catch( \Doctrine\DBAL\DBALException $e ) {
51 51
 			throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), join( ', ', $this->statement->errorInfo() ) );
52 52
 		}
53 53
 	}
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	{
65 65
 		try {
66 66
 			return $this->statement->fetch( $this->style[$style] );
67
-		} catch ( \Doctrine\DBAL\DBALException $e ) {
67
+		} catch( \Doctrine\DBAL\DBALException $e ) {
68 68
 			throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), join( ', ', $this->statement->errorInfo() ) );
69 69
 		}
70 70
 	}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	{
80 80
 		try {
81 81
 			$this->statement->closeCursor();
82
-		} catch ( \Doctrine\DBAL\DBALException $e ) {
82
+		} catch( \Doctrine\DBAL\DBALException $e ) {
83 83
 			throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), join( ', ', $this->statement->errorInfo() ) );
84 84
 		}
85 85
 	}
Please login to merge, or discard this patch.
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,9 +45,12 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public function affectedRows()
47 47
 	{
48
-		try {
48
+		try
49
+		{
49 50
 			return $this->statement->rowCount();
50
-		} catch ( \Doctrine\DBAL\DBALException $e ) {
51
+		}
52
+		catch ( \Doctrine\DBAL\DBALException $e )
53
+		{
51 54
 			throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), join( ', ', $this->statement->errorInfo() ) );
52 55
 		}
53 56
 	}
@@ -62,9 +65,12 @@  discard block
 block discarded – undo
62 65
 	 */
63 66
 	public function fetch( $style = \Aimeos\MW\DB\Result\Base::FETCH_ASSOC )
64 67
 	{
65
-		try {
68
+		try
69
+		{
66 70
 			return $this->statement->fetch( $this->style[$style] );
67
-		} catch ( \Doctrine\DBAL\DBALException $e ) {
71
+		}
72
+		catch ( \Doctrine\DBAL\DBALException $e )
73
+		{
68 74
 			throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), join( ', ', $this->statement->errorInfo() ) );
69 75
 		}
70 76
 	}
@@ -77,9 +83,12 @@  discard block
 block discarded – undo
77 83
 	 */
78 84
 	public function finish()
79 85
 	{
80
-		try {
86
+		try
87
+		{
81 88
 			$this->statement->closeCursor();
82
-		} catch ( \Doctrine\DBAL\DBALException $e ) {
89
+		}
90
+		catch ( \Doctrine\DBAL\DBALException $e )
91
+		{
83 92
 			throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), join( ', ', $this->statement->errorInfo() ) );
84 93
 		}
85 94
 	}
Please login to merge, or discard this patch.
lib/mwlib/src/MW/DB/Connection/Base.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 	 * @param string $data Value to escape
38 38
 	 * @return string Escaped string
39 39
 	 */
40
-	public function escape($data)
40
+	public function escape( $data )
41 41
 	{
42 42
 		$quoted = $this->getRawObject()->quote( $data );
43 43
 
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Criteria/Expression/Combine/PHP.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		}
93 93
 
94 94
 		if( $this->operator == '!' ) {
95
-			return ' ' . self::$operators[$this->operator] . ' ' . $item->toString( $types, $translations, $plugins );
95
+			return ' '.self::$operators[$this->operator].' '.$item->toString( $types, $translations, $plugins );
96 96
 		}
97 97
 
98 98
 		$string = $item->toString( $types, $translations, $plugins );
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 		while( ( $item = next( $this->expressions ) ) !== false )
101 101
 		{
102 102
 			if( ( $itemstr = $item->toString( $types, $translations, $plugins ) ) !== '' ) {
103
-				$string .= ' ' . self::$operators[$this->operator] . ' ' . $itemstr;
103
+				$string .= ' '.self::$operators[$this->operator].' '.$itemstr;
104 104
 			}
105 105
 		}
106 106
 
107
-		return '( ' . $string . ' )';
107
+		return '( '.$string.' )';
108 108
 	}
109 109
 
110 110
 
Please login to merge, or discard this patch.