Passed
Push — master ( df7738...c3ac7d )
by Aimeos
08:17 queued 03:29
created
lib/mshoplib/src/MShop/Locale/Manager/Currency/Standard.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,9 +112,12 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function create( array $values = [] ) : \Aimeos\MShop\Common\Item\Iface
114 114
 	{
115
-		try {
115
+		try
116
+		{
116 117
 			$values['locale.currency.siteid'] = $this->context()->locale()->getSiteId();
117
-		} catch( \Exception $e ) {
118
+		}
119
+		catch( \Exception $e )
120
+		{
118 121
 			$values['locale.currency.siteid'] = null;
119 122
 		}
120 123
 
@@ -181,8 +184,7 @@  discard block
 block discarded – undo
181 184
 				 */
182 185
 				$path = 'mshop/locale/manager/currency/insert';
183 186
 				$sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) );
184
-			}
185
-			else
187
+			} else
186 188
 			{
187 189
 				/** mshop/locale/manager/currency/update/mysql
188 190
 				 * Updates an existing currency record in the database
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Filesystem/Standard.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,9 +108,12 @@
 block discarded – undo
108 108
 	 */
109 109
 	public function scan( string $path = null ) : iterable
110 110
 	{
111
-		try {
111
+		try
112
+		{
112 113
 			return new \DirectoryIterator( $this->resolve( (string) $path ) );
113
-		} catch( \Exception $e ) {
114
+		}
115
+		catch( \Exception $e )
116
+		{
114 117
 			throw new Exception( $e->getMessage(), 0, $e );
115 118
 		}
116 119
 	}
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Media/Image/Imagick.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
 			{
51 51
 				$this->image->setImageAlphaChannel( \Imagick::ALPHACHANNEL_ACTIVATE );
52 52
 				$this->image->setImageBackgroundColor( $options['image']['background'] ?? 'transparent' );
53
-			}
54
-			else
53
+			} else
55 54
 			{
56 55
 				$this->image->setImageBackgroundColor( $options['image']['background'] ?? '#ffffff' );
57 56
 			}
@@ -174,15 +173,13 @@  discard block
 block discarded – undo
174 173
 				$newMedia->image->cropThumbnailImage( (int) $width, (int) $height );
175 174
 				// see https://www.php.net/manual/en/imagick.cropthumbnailimage.php#106710
176 175
 				$newMedia->image->setImagePage( 0, 0, 0, 0 );
177
-			}
178
-			elseif( $fit === 1 && $width && $height )
176
+			} elseif( $fit === 1 && $width && $height )
179 177
 			{
180 178
 				$w = ( $width - $newMedia->image->getImageWidth() ) / 2;
181 179
 				$h = ( $height - $newMedia->image->getImageHeight() ) / 2;
182 180
 
183 181
 				$newMedia->image->extentImage( $width, $height, (int) -$w, (int) -$h );
184
-			}
185
-			else
182
+			} else
186 183
 			{
187 184
 				$w = $this->image->getImageWidth();
188 185
 				$h = $this->image->getImageHeight();
@@ -267,8 +264,7 @@  discard block
 block discarded – undo
267 264
 			$wmimage = clone self::$wmimg;
268 265
 			$wmimage->resizeImage( $ww, $wh, \Imagick::FILTER_CUBIC, 0.8 );
269 266
 			self::$wmimages[$ww . 'x' . $wh] = $wmimage;
270
-		}
271
-		else
267
+		} else
272 268
 		{
273 269
 			$wmimage = self::$wmimages[$ww . 'x' . $wh];
274 270
 		}
Please login to merge, or discard this patch.
lib/mshoplib/setup/MShopAddLocaleData.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
 
170 170
 			try {
171 171
 				$localeManager->save( $item );
172
-			} catch( \Aimeos\MW\DB\Exception $e ) { ; } // if locale combination was already available
172
+			} catch( \Aimeos\MW\DB\Exception $e ) {; } // if locale combination was already available
173 173
 		}
174 174
 	}
175 175
 }
Please login to merge, or discard this patch.
Braces   +19 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,9 +52,12 @@  discard block
 block discarded – undo
52 52
 		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create( $this->context(), 'Standard' );
53 53
 		$siteManager = $localeManager->getSubManager( 'site' );
54 54
 
55
-		try {
55
+		try
56
+		{
56 57
 			$siteItem = $siteManager->insert( $siteManager->create()->setLabel( $code )->setCode( $code ) );
57
-		} catch( \Aimeos\MW\DB\Exception $e ) {
58
+		}
59
+		catch( \Aimeos\MW\DB\Exception $e )
60
+		{
58 61
 			$siteItem = $siteManager->find( $code );
59 62
 		}
60 63
 
@@ -69,7 +72,9 @@  discard block
 block discarded – undo
69 72
 
70 73
 			$localeManager->save( $localeItem, false );
71 74
 		}
72
-		catch( \Aimeos\MW\DB\Exception $e ) {} // already in the database
75
+		catch( \Aimeos\MW\DB\Exception $e )
76
+		{
77
+} // already in the database
73 78
 	}
74 79
 
75 80
 
@@ -91,9 +96,12 @@  discard block
 block discarded – undo
91 96
 
92 97
 		foreach( $data as $key => $dataset )
93 98
 		{
94
-			try {
99
+			try
100
+			{
95 101
 				$item = $manager->insert( $manager->create()->fromArray( $dataset ), $parentId );
96
-			} catch( \Aimeos\MW\DB\Exception $e ) {
102
+			}
103
+			catch( \Aimeos\MW\DB\Exception $e )
104
+			{
97 105
 				$item = $manager->find( $dataset['locale.site.code'] );
98 106
 			}
99 107
 
@@ -167,9 +175,13 @@  discard block
 block discarded – undo
167 175
 				->set( 'site_id', $siteIds[$dataset['site']]['id'] )
168 176
 				->setSiteId( $siteIds[$dataset['site']]['site'] );
169 177
 
170
-			try {
178
+			try
179
+			{
171 180
 				$localeManager->save( $item );
172
-			} catch( \Aimeos\MW\DB\Exception $e ) { ; } // if locale combination was already available
181
+			}
182
+			catch( \Aimeos\MW\DB\Exception $e )
183
+			{
184
+; } // if locale combination was already available
173 185
 		}
174 186
 	}
175 187
 }
Please login to merge, or discard this patch.