Completed
Push — master ( 815faa...197710 )
by Aimeos
07:55
created
lib/mshoplib/src/MAdmin/Cache/Manager/Standard.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -201,9 +201,12 @@  discard block
 block discarded – undo
201 201
 			);
202 202
 			$dbm = $context->getDatabaseManager();
203 203
 
204
-			try {
204
+			try
205
+			{
205 206
 				$this->object = \Aimeos\MW\Cache\Factory::createManager( $name, $config, $dbm );
206
-			} catch( \Exception $e ) {
207
+			}
208
+			catch( \Exception $e )
209
+			{
207 210
 				$this->object = \Aimeos\MW\Cache\Factory::createManager( 'DB', $config, $dbm );
208 211
 			}
209 212
 		}
@@ -265,9 +268,12 @@  discard block
 block discarded – undo
265 268
 	 */
266 269
 	public function createItem()
267 270
 	{
268
-		try {
271
+		try
272
+		{
269 273
 			$values = array( 'siteid' => $this->getContext()->getLocale()->getSiteId() );
270
-		} catch( \Exception $e ) {
274
+		}
275
+		catch( \Exception $e )
276
+		{
271 277
 			$values = array( 'siteid' => null );
272 278
 		}
273 279
 
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Catalog/Manager/Standard.php 2 patches
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -567,9 +567,12 @@  discard block
 block discarded – undo
567 567
 
568 568
 		foreach( $sitePath as $siteId )
569 569
 		{
570
-			try {
570
+			try
571
+			{
571 572
 				$path = $this->createTreeManager( $siteId )->getPath( $id );
572
-			} catch( \Exception $e ) {
573
+			}
574
+			catch( \Exception $e )
575
+			{
573 576
 				continue;
574 577
 			}
575 578
 
@@ -604,9 +607,12 @@  discard block
 block discarded – undo
604 607
 
605 608
 		foreach( $sitePath as $siteId )
606 609
 		{
607
-			try {
610
+			try
611
+			{
608 612
 				$node = $this->createTreeManager( $siteId )->getNode( $id, $level, $criteria );
609
-			} catch( \Exception $e ) {
613
+			}
614
+			catch( \Exception $e )
615
+			{
610 616
 				continue;
611 617
 			}
612 618
 
@@ -1243,8 +1249,7 @@  discard block
 block discarded – undo
1243 1249
 				 * @see mshop/catalog/manager/standard/insert-usage
1244 1250
 				 */
1245 1251
 				$path = 'mshop/catalog/manager/standard/update-usage';
1246
-			}
1247
-			else
1252
+			} else
1248 1253
 			{
1249 1254
 				/** mshop/catalog/manager/standard/insert-usage
1250 1255
 				 * Updates the config, editor, ctime and mtime value of an inserted record
@@ -1293,8 +1298,7 @@  discard block
 block discarded – undo
1293 1298
 			{
1294 1299
 				$stmt->bind( 4, $siteid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
1295 1300
 				$stmt->bind( 5, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
1296
-			}
1297
-			else
1301
+			} else
1298 1302
 			{
1299 1303
 				$stmt->bind( 4, $date ); // ctime
1300 1304
 				$stmt->bind( 5, $siteid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	/**
235 235
 	 * Removes multiple items specified by ids in the array.
236 236
 	 *
237
-	 * @param array $ids List of IDs
237
+	 * @param integer[] $ids List of IDs
238 238
 	 */
239 239
 	public function deleteItems( array $ids )
240 240
 	{
@@ -411,6 +411,7 @@  discard block
 block discarded – undo
411 411
 	 * @param \Aimeos\MW\Criteria\Iface $search Search criteria object
412 412
 	 * @param string[] $ref List of domains to fetch list items and referenced items for
413 413
 	 * @param integer|null &$total Number of items that are available in total
414
+	 * @param integer $total
414 415
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface
415 416
 	 */
416 417
 	public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = array(), &$total = null )
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Common/Manager/Base.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -668,8 +668,7 @@
 block discarded – undo
668 668
 
669 669
 		if( isset( $attributes[$name] ) && $attributes[$name] instanceof $iface ) {
670 670
 			return $attributes[$name]->getInternalDeps();
671
-		}
672
-		else if( isset( $attributes['id'] ) && $attributes['id'] instanceof $iface ) {
671
+		} else if( isset( $attributes['id'] ) && $attributes['id'] instanceof $iface ) {
673 672
 			return $attributes['id']->getInternalDeps();
674 673
 		}
675 674
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		$conn = $dbm->acquire( $dbname );
222 222
 
223 223
 		$object = new \Aimeos\MW\Criteria\SQL( $conn );
224
-		$object->setConditions( $object->compare( '==', $domain . '.status', 1 ) );
224
+		$object->setConditions( $object->compare( '==', $domain.'.status', 1 ) );
225 225
 
226 226
 		$dbm->release( $conn, $dbname );
227 227
 
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 	protected function getSqlConfig( $path )
310 310
 	{
311 311
 		$config = $this->getContext()->getConfig();
312
-		$adapter = $config->get( 'resource/' . $this->getResourceName() . '/adapter' );
312
+		$adapter = $config->get( 'resource/'.$this->getResourceName().'/adapter' );
313 313
 
314
-		return $config->get( $path . '/' . $adapter, $config->get( $path . '/ansi', $path ) );
314
+		return $config->get( $path.'/'.$adapter, $config->get( $path.'/ansi', $path ) );
315 315
 	}
316 316
 
317 317
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 	{
328 328
 		$domain = strtolower( $domain );
329 329
 		$manager = strtolower( $manager );
330
-		$key = $domain . $manager . $name;
330
+		$key = $domain.$manager.$name;
331 331
 
332 332
 		if( !isset( $this->subManagers[$key] ) )
333 333
 		{
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 			}
341 341
 
342 342
 			if( $name === null ) {
343
-				$path = 'mshop/' . $domain . '/manager/' . $manager . '/name';
343
+				$path = 'mshop/'.$domain.'/manager/'.$manager.'/name';
344 344
 				$name = $this->context->getConfig()->get( $path, 'Standard' );
345 345
 			}
346 346
 
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
 			$domainname = ucfirst( $domain );
352 352
 			$subnames = $this->createSubNames( $manager );
353 353
 
354
-			$classname = '\\Aimeos\\MShop\\' . $domainname . '\\Manager\\' . $subnames . '\\' . $name;
355
-			$interface = '\\Aimeos\\MShop\\' . $domainname . '\\Manager\\' . $subnames . '\\Iface';
354
+			$classname = '\\Aimeos\\MShop\\'.$domainname.'\\Manager\\'.$subnames.'\\'.$name;
355
+			$interface = '\\Aimeos\\MShop\\'.$domainname.'\\Manager\\'.$subnames.'\\Iface';
356 356
 
357 357
 			if( class_exists( $classname ) === false ) {
358 358
 				throw new \Aimeos\MShop\Exception( sprintf( 'Class "%1$s" not available', $classname ) );
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 				throw new \Aimeos\MShop\Exception( sprintf( 'Invalid characters in class name "%1$s"', $name ) );
392 392
 			}
393 393
 
394
-			$classname = $classprefix . $name;
394
+			$classname = $classprefix.$name;
395 395
 
396 396
 			if( class_exists( $classname ) === false ) {
397 397
 				throw new \Aimeos\MShop\Exception( sprintf( 'Class "%1$s" not available', $classname ) );
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 		$config = $this->context->getConfig();
421 421
 
422 422
 		$decorators = $config->get( 'mshop/common/manager/decorators/default', array() );
423
-		$excludes = $config->get( 'mshop/' . $domain . '/manager/' . $managerpath . '/decorators/excludes', array() );
423
+		$excludes = $config->get( 'mshop/'.$domain.'/manager/'.$managerpath.'/decorators/excludes', array() );
424 424
 
425 425
 		foreach( $decorators as $key => $name )
426 426
 		{
@@ -433,12 +433,12 @@  discard block
 block discarded – undo
433 433
 		$manager = $this->addDecorators( $this->context, $manager, $decorators, $classprefix );
434 434
 
435 435
 		$classprefix = '\\Aimeos\\MShop\\Common\\Manager\\Decorator\\';
436
-		$decorators = $config->get( 'mshop/' . $domain . '/manager/' . $managerpath . '/decorators/global', array() );
436
+		$decorators = $config->get( 'mshop/'.$domain.'/manager/'.$managerpath.'/decorators/global', array() );
437 437
 		$manager = $this->addDecorators( $this->context, $manager, $decorators, $classprefix );
438 438
 
439 439
 		$subpath = $this->createSubNames( $managerpath );
440
-		$classprefix = 'MShop_' . ucfirst( $domain ) . '_Manager_' . $subpath . '_Decorator_';
441
-		$decorators = $config->get( 'mshop/' . $domain . '/manager/' . $managerpath . '/decorators/local', array() );
440
+		$classprefix = 'MShop_'.ucfirst( $domain ).'_Manager_'.$subpath.'_Decorator_';
441
+		$decorators = $config->get( 'mshop/'.$domain.'/manager/'.$managerpath.'/decorators/local', array() );
442 442
 
443 443
 		return $this->addDecorators( $this->context, $manager, $decorators, $classprefix );
444 444
 	}
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	{
534 534
 		$iface = '\\Aimeos\\MW\\Criteria\\Attribute\\Iface';
535 535
 		$sep = $this->getKeySeparator();
536
-		$name = $prefix . $sep . 'id';
536
+		$name = $prefix.$sep.'id';
537 537
 
538 538
 		if( isset( $attributes[$name] ) && $attributes[$name] instanceof $iface ) {
539 539
 			return $attributes[$name]->getInternalDeps();
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 	{
592 592
 		$config = $this->context->getConfig();
593 593
 
594
-		if( $config->get( 'resource/' . $name ) === null ) {
594
+		if( $config->get( 'resource/'.$name ) === null ) {
595 595
 			$this->resourceName = $config->get( 'resource/default', 'db' );
596 596
 		} else {
597 597
 			$this->resourceName = $name;
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 
640 640
 		foreach( $keys as $key )
641 641
 		{
642
-			$name = $key . $sep . 'siteid';
642
+			$name = $key.$sep.'siteid';
643 643
 
644 644
 			if( isset( $attributes[$name] ) ) {
645 645
 				$cond[] = $search->compare( '==', $name, $siteIds );
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 			$results = $stmt->execute();
727 727
 			$row = $results->fetch();
728 728
 			$results->finish();
729
-			$this->context->getLogger()->log( __METHOD__ . '(' . ( ( microtime( true ) - $time ) * 1000 ) . 'ms): SQL statement: ' . $stmt, \Aimeos\MW\Logger\Base::DEBUG );
729
+			$this->context->getLogger()->log( __METHOD__.'('.( ( microtime( true ) - $time ) * 1000 ).'ms): SQL statement: '.$stmt, \Aimeos\MW\Logger\Base::DEBUG );
730 730
 
731 731
 			if( $row === false ) {
732 732
 				throw new \Aimeos\MShop\Exception( sprintf( 'Total results value not found' ) );
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 		$time = microtime( true );
743 743
 		$stmt = $conn->create( $sql->str() );
744 744
 		$results = $stmt->execute();
745
-		$this->context->getLogger()->log( __METHOD__ . '(' . ( ( microtime( true ) - $time ) * 1000 ) . 'ms): SQL statement: ' . $stmt, \Aimeos\MW\Logger\Base::DEBUG );
745
+		$this->context->getLogger()->log( __METHOD__.'('.( ( microtime( true ) - $time ) * 1000 ).'ms): SQL statement: '.$stmt, \Aimeos\MW\Logger\Base::DEBUG );
746 746
 
747 747
 		return $results;
748 748
 	}
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 		$search->setConditions( $search->compare( '==', $name, $ids ) );
768 768
 
769 769
 		$types = array( $name => \Aimeos\MW\DB\Statement\Base::PARAM_STR );
770
-		$translations = array( $name => '"' . $name . '"' );
770
+		$translations = array( $name => '"'.$name.'"' );
771 771
 
772 772
 		$cond = $search->getConditionString( $types, $translations );
773 773
 		$sql = str_replace( ':cond', $cond, $this->getSqlConfig( $cfgpath ) );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Coupon/Provider/Base.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
 			$taxrates[$taxrate]->addItem( $price );
292 292
 		}
293
-		catch( \Exception $e ) { ; } // if delivery service isn't available
293
+		catch( \Exception $e ) {; } // if delivery service isn't available
294 294
 
295 295
 		try
296 296
 		{
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
 			$taxrates[$taxrate]->addItem( $price );
305 305
 		}
306
-		catch( \Exception $e ) { ; } // if payment service isn't available
306
+		catch( \Exception $e ) {; } // if payment service isn't available
307 307
 
308 308
 		return $taxrates;
309 309
 	}
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -233,8 +233,7 @@  discard block
 block discarded – undo
233 233
 			{
234 234
 				$value = $price->getValue() + $price->getCosts();
235 235
 				$rebate -= $value;
236
-			}
237
-			else
236
+			} else
238 237
 			{
239 238
 				$value = $rebate;
240 239
 				$rebate = '0.00';
@@ -290,7 +289,9 @@  discard block
 block discarded – undo
290 289
 
291 290
 			$taxrates[$taxrate]->addItem( $price );
292 291
 		}
293
-		catch( \Exception $e ) { ; } // if delivery service isn't available
292
+		catch( \Exception $e )
293
+		{
294
+; } // if delivery service isn't available
294 295
 
295 296
 		try
296 297
 		{
@@ -303,7 +304,9 @@  discard block
 block discarded – undo
303 304
 
304 305
 			$taxrates[$taxrate]->addItem( $price );
305 306
 		}
306
-		catch( \Exception $e ) { ; } // if payment service isn't available
307
+		catch( \Exception $e )
308
+		{
309
+; } // if payment service isn't available
307 310
 
308 311
 		return $taxrates;
309 312
 	}
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Locale/Item/Language/Standard.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@
 block discarded – undo
67 67
 			$this->setCode( $key );
68 68
 			$this->values['id'] = $this->values['code'];
69 69
 			$this->modified = false;
70
-		}
71
-		else
70
+		} else
72 71
 		{
73 72
 			$this->values['id'] = null;
74 73
 			$this->modified = true;
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Locale/Manager/Language/Standard.php 3 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -104,9 +104,12 @@  discard block
 block discarded – undo
104 104
 	 */
105 105
 	public function createItem()
106 106
 	{
107
-		try {
107
+		try
108
+		{
108 109
 			$values = array( 'siteid' => $this->getContext()->getLocale()->getSiteId() );
109
-		} catch( \Exception $ex ) {
110
+		}
111
+		catch( \Exception $ex )
112
+		{
110 113
 			$values = array( 'siteid' => null );
111 114
 		}
112 115
 
@@ -167,8 +170,7 @@  discard block
 block discarded – undo
167 170
 				 * @see mshop/locale/manager/language/standard/count
168 171
 				 */
169 172
 				$path = 'mshop/locale/manager/language/standard/insert';
170
-			}
171
-			else
173
+			} else
172 174
 			{
173 175
 				/** mshop/locale/manager/language/standard/update
174 176
 				 * Updates an existing language record in the database
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		 * @see mshop/locale/manager/language/decorators/global
455 455
 		 */
456 456
 
457
-		return $this->getSubManagerBase( 'locale', 'language/' . $manager, $name );
457
+		return $this->getSubManagerBase( 'locale', 'language/'.$manager, $name );
458 458
 	}
459 459
 
460 460
 
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 			$replace = array(
487 487
 				$search->getConditionString( $types, $translations ),
488 488
 				$search->getSortationString( $types, $translations ),
489
-				( $columns ? ', ' . $columns : '' ),
489
+				( $columns ? ', '.$columns : '' ),
490 490
 				$search->getSliceStart(),
491 491
 				$search->getSliceSize(),
492 492
 			);
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 	protected function getSearchResults( \Aimeos\MW\DB\Connection\Iface $conn, $sql )
607 607
 	{
608 608
 		$statement = $conn->create( $sql );
609
-		$this->getContext()->getLogger()->log( __METHOD__ . ': SQL statement: ' . $statement, \Aimeos\MW\Logger\Base::DEBUG );
609
+		$this->getContext()->getLogger()->log( __METHOD__.': SQL statement: '.$statement, \Aimeos\MW\Logger\Base::DEBUG );
610 610
 
611 611
 		$results = $statement->execute();
612 612
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 	 * Returns the search results for the given SQL statement.
866 866
 	 *
867 867
 	 * @param \Aimeos\MW\DB\Connection\Iface $conn Database connection
868
-	 * @param $sql SQL statement
868
+	 * @param string $sql SQL statement
869 869
 	 * @return \Aimeos\MW\DB\Result\Iface Search result object
870 870
 	 */
871 871
 	protected function getSearchResults( \Aimeos\MW\DB\Connection\Iface $conn, $sql )
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 	 * Returns the total number of items found for the conditions
907 907
 	 *
908 908
 	 * @param \Aimeos\MW\DB\Connection\Iface $conn Database connection
909
-	 * @param array $find List of markers that should be replaced in the SQL statement
909
+	 * @param string[] $find List of markers that should be replaced in the SQL statement
910 910
 	 * @param array $replace List of replacements for the markers in the SQL statement
911 911
 	 * @throws \Aimeos\MShop\Locale\Exception If no total value was found
912 912
 	 * @return integer Total number of found items
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Locale/Manager/Standard.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,9 +139,12 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public function createItem()
141 141
 	{
142
-		try {
142
+		try
143
+		{
143 144
 			return $this->createItemBase( array( 'siteid' => $this->getContext()->getLocale()->getSiteId() ) );
144
-		} catch( \Exception $e ) {
145
+		}
146
+		catch( \Exception $e )
147
+		{
145 148
 			return $this->createItemBase();
146 149
 		}
147 150
 	}
@@ -301,8 +304,7 @@  discard block
 block discarded – undo
301 304
 				 * @see mshop/locale/manager/standard/count
302 305
 				 */
303 306
 				$path = 'mshop/locale/manager/standard/insert';
304
-			}
305
-			else
307
+			} else
306 308
 			{
307 309
 				/** mshop/locale/manager/standard/update
308 310
 				 * Updates an existing locale record in the database
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 	{
685 685
 		$stmt = $conn->create( $sql );
686 686
 
687
-		$this->getContext()->getLogger()->log( __METHOD__ . ': SQL statement: ' . $stmt, \Aimeos\MW\Logger\Base::DEBUG );
687
+		$this->getContext()->getLogger()->log( __METHOD__.': SQL statement: '.$stmt, \Aimeos\MW\Logger\Base::DEBUG );
688 688
 
689 689
 		return $stmt->execute();
690 690
 	}
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 			$replace = array(
720 720
 					$search->getConditionString( $types, $translations ),
721 721
 					$search->getSortationString( $types, $translations ),
722
-					( $columns ? ', ' . $columns : '' ),
722
+					( $columns ? ', '.$columns : '' ),
723 723
 					$search->getSliceStart(),
724 724
 					$search->getSliceSize(),
725 725
 			);
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Plugin/Provider/Order/Coupon.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,8 +78,7 @@
 block discarded – undo
78 78
 				{
79 79
 					$couponProvider = $couponManager->getProvider( $couponItem, $code );
80 80
 					$couponProvider->updateCoupon( $order );
81
-				}
82
-				else
81
+				} else
83 82
 				{
84 83
 					$notAvailable[$code] = 'coupon.gone';
85 84
 				}
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Service/Provider/Decorator/Country.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,10 +118,11 @@
 block discarded – undo
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
Please login to merge, or discard this patch.