Completed
Push — master ( 52c730...9eba1c )
by Aimeos
08:52
created
lib/mwlib/tests/MW/View/_testfiles/template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1 1
 <?php $quantity = ( isset( $this->quantity ) ? $this->quantity : 0 ); ?>
2
-Number of files: <?php echo $quantity . ' ' . $this->translate( 'test', 'File', 'Files', $quantity );
2
+Number of files: <?php echo $quantity.' '.$this->translate( 'test', 'File', 'Files', $quantity );
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Setup/DBSchema/PgsqlTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
 		$this->assertEquals( null, $columnItem->getDefaultValue() );
93 93
 		$this->assertTrue( $columnItem->isNullable() );
94 94
 
95
-		$this->setExpectedException('\\Aimeos\\MW\\Setup\\Exception');
95
+		$this->setExpectedException( '\\Aimeos\\MW\\Setup\\Exception' );
96 96
 		$this->object->getColumnDetails( 'mw_setup_dbschema_test', 'notexisting' );
97 97
 	}
98 98
 
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Observer/Publisher/StandardTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 	{
32 32
 		$l = new TestListener();
33 33
 
34
-		$this->object->addListener($l, 'test');
34
+		$this->object->addListener( $l, 'test' );
35 35
 	}
36 36
 
37 37
 	public function testRemoveListener()
38 38
 	{
39 39
 		$l = new TestListener();
40 40
 
41
-		$this->object->addListener($l, 'test');
42
-		$this->object->removeListener($l, 'test');
41
+		$this->object->addListener( $l, 'test' );
42
+		$this->object->removeListener( $l, 'test' );
43 43
 	}
44 44
 
45 45
 	public function testclearListeners()
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 	public function testnotifyListeners()
51 51
 	{
52 52
 		$l = new TestListener();
53
-		$this->object->addListener($l, 'test');
54
-		$this->object->addListener($l, 'testagain');
53
+		$this->object->addListener( $l, 'test' );
54
+		$this->object->addListener( $l, 'testagain' );
55 55
 
56
-		$this->object->notifyListenersPublic('test', 'warn');
57
-		$this->object->notifyListenersPublic('testagain', 'warn');
56
+		$this->object->notifyListenersPublic( 'test', 'warn' );
57
+		$this->object->notifyListenersPublic( 'testagain', 'warn' );
58 58
 	}
59 59
 }
60 60
 
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
 	 * @param string $action
66 66
 	 * @param string|null $value
67 67
 	 */
68
-	public function notifyListenersPublic($action, $value = null)
68
+	public function notifyListenersPublic( $action, $value = null )
69 69
 	{
70
-		$this->notifyListeners($action, $value);
70
+		$this->notifyListeners( $action, $value );
71 71
 	}
72 72
 
73 73
 	public function clearListenersPublic()
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 	public function update( \Aimeos\MW\Observer\Publisher\Iface $p, $action, $value = null )
87 87
 	{
88
-		if ($action == 'test') {
88
+		if( $action == 'test' ) {
89 89
 			return false;
90 90
 		}
91 91
 	}
Please login to merge, or discard this patch.
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.