Completed
Push — master ( 52c730...9eba1c )
by Aimeos
08:52
created
lib/mshoplib/src/MShop/Stock/Manager/Factory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,12 +71,12 @@
 block discarded – undo
71 71
 
72 72
 		if( ctype_alnum( $name ) === false )
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\MShop\\Stock\\Manager\\' . $name : '<not a string>';
74
+			$classname = is_string( $name ) ? '\\Aimeos\\MShop\\Stock\\Manager\\'.$name : '<not a string>';
75 75
 			throw new \Aimeos\MShop\Stock\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\MShop\\Stock\\Manager\\Iface';
79
-		$classname = '\\Aimeos\\MShop\\Stock\\Manager\\' . $name;
79
+		$classname = '\\Aimeos\\MShop\\Stock\\Manager\\'.$name;
80 80
 
81 81
 		$manager = self::createManagerBase( $context, $classname, $iface );
82 82
 
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Stock/Item/Standard.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function setTypeId( $id )
93 93
 	{
94
-		if ( $id == $this->getTypeId() ) { return $this; }
94
+		if( $id == $this->getTypeId() ) { return $this; }
95 95
 
96 96
 		$this->values['stock.typeid'] = (int) $id;
97 97
 		$this->setModified();
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	{
190 190
 		if( $backdate == $this->getDateBack() ) { return $this; }
191 191
 
192
-		$this->values['stock.backdate'] = $this->checkDateFormat( $backdate );;
192
+		$this->values['stock.backdate'] = $this->checkDateFormat( $backdate ); ;
193 193
 		$this->setModified();
194 194
 
195 195
 		return $this;
Please login to merge, or discard this patch.
lib/mshoplib/setup/StockMigrateProductcode.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@  discard block
 block discarded – undo
72 72
 				{
73 73
 					$this->execute( $stmt );
74 74
 					$this->status( 'done' );
75
-				}
76
-				else
75
+				} else
77 76
 				{
78 77
 					$this->status( 'OK' );
79 78
 				}
@@ -86,8 +85,7 @@  discard block
 block discarded – undo
86 85
 			{
87 86
 				$this->executeList( $this->updates );
88 87
 				$this->status( 'done' );
89
-			}
90
-			else
88
+			} else
91 89
 			{
92 90
 				$this->status( 'OK' );
93 91
 			}
@@ -101,8 +99,7 @@  discard block
 block discarded – undo
101 99
 				{
102 100
 					$this->execute( $stmt );
103 101
 					$this->status( 'done' );
104
-				}
105
-				else
102
+				} else
106 103
 				{
107 104
 					$this->status( 'OK' );
108 105
 				}
@@ -114,8 +111,7 @@  discard block
 block discarded – undo
114 111
 			{
115 112
 				$this->execute( $this->column );
116 113
 				$this->status( 'done' );
117
-			}
118
-			else
114
+			} else
119 115
 			{
120 116
 				$this->status( 'OK' );
121 117
 			}
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Service/Provider/Decorator/CategoryTest.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -197,6 +197,9 @@
 block discarded – undo
197 197
 	}
198 198
 
199 199
 
200
+	/**
201
+	 * @param string $code
202
+	 */
200 203
 	protected function getOrderProduct( $code )
201 204
 	{
202 205
 		$productManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Factory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 			if( self::$cache === false || !isset( self::$managers[$id][$domain] ) )
93 93
 			{
94
-				$factory = '\\Aimeos\\MShop\\' . ucwords( $domain ) . '\\Manager\\Factory';
94
+				$factory = '\\Aimeos\\MShop\\'.ucwords( $domain ).'\\Manager\\Factory';
95 95
 
96 96
 				if( class_exists( $factory ) === false ) {
97 97
 					throw new \Aimeos\MShop\Exception( sprintf( 'Class "%1$s" not available', $factory ) );
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 
112 112
 			foreach( $parts as $part )
113 113
 			{
114
-				$subpath .= $part . '/';
115
-				$classname = $context->getConfig()->get( 'mshop/' . $domain . '/manager/' . $subpath . 'name' );
114
+				$subpath .= $part.'/';
115
+				$classname = $context->getConfig()->get( 'mshop/'.$domain.'/manager/'.$subpath.'name' );
116 116
 
117
-				if( self::$cache === false || !isset( self::$managers[$id][$tmppath . '/' . $part] ) ) {
118
-					self::$managers[$id][$tmppath . '/' . $part] = self::$managers[$id][$tmppath]->getSubManager( $part, $classname );
117
+				if( self::$cache === false || !isset( self::$managers[$id][$tmppath.'/'.$part] ) ) {
118
+					self::$managers[$id][$tmppath.'/'.$part] = self::$managers[$id][$tmppath]->getSubManager( $part, $classname );
119 119
 				}
120 120
 
121
-				$tmppath .= '/' . $part;
121
+				$tmppath .= '/'.$part;
122 122
 			}
123 123
 		}
124 124
 
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Media/FactoryTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	public function testGetImage()
16 16
 	{
17 17
 		$ds = DIRECTORY_SEPARATOR;
18
-		$object = \Aimeos\MW\Media\Factory::get( __DIR__ . $ds .'_testfiles' . $ds . 'image.png' );
18
+		$object = \Aimeos\MW\Media\Factory::get( __DIR__.$ds.'_testfiles'.$ds.'image.png' );
19 19
 
20 20
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Iface', $object );
21 21
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Image\\Iface', $object );
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	public function testGetImageAsResource()
26 26
 	{
27 27
 		$ds = DIRECTORY_SEPARATOR;
28
-		$resource = fopen( __DIR__ . $ds .'_testfiles' . $ds . 'image.png', 'rw' );
28
+		$resource = fopen( __DIR__.$ds.'_testfiles'.$ds.'image.png', 'rw' );
29 29
 		$object = \Aimeos\MW\Media\Factory::get( $resource );
30 30
 
31 31
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Iface', $object );
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	public function testGetImageAsString()
37 37
 	{
38 38
 		$ds = DIRECTORY_SEPARATOR;
39
-		$content = file_get_contents( __DIR__ . $ds .'_testfiles' . $ds . 'image.png' );
39
+		$content = file_get_contents( __DIR__.$ds.'_testfiles'.$ds.'image.png' );
40 40
 		$object = \Aimeos\MW\Media\Factory::get( $content );
41 41
 
42 42
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Iface', $object );
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	public function testGetBinary()
49 49
 	{
50 50
 		$ds = DIRECTORY_SEPARATOR;
51
-		$object = \Aimeos\MW\Media\Factory::get( __DIR__ . $ds . '_testfiles' . $ds . 'application.txt' );
51
+		$object = \Aimeos\MW\Media\Factory::get( __DIR__.$ds.'_testfiles'.$ds.'application.txt' );
52 52
 
53 53
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Iface', $object );
54 54
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Application\\Iface', $object );
Please login to merge, or discard this patch.
controller/common/src/Controller/Common/Media/Standard.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 				$fs->rm( $path );
104 104
 			}
105 105
 		}
106
-		catch( \Exception $e ) { ; } // Can be a mime icon with relative path
106
+		catch( \Exception $e ) {; } // Can be a mime icon with relative path
107 107
 
108 108
 		$item->setPreview( '' );
109 109
 	}
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 			default: $ext = '';
234 234
 		}
235 235
 
236
-		$filename = md5( $filename . getmypid() . microtime( true ) );
236
+		$filename = md5( $filename.getmypid().microtime( true ) );
237 237
 
238 238
 		return "${type}/${filename[0]}/${filename[1]}/${filename}${ext}";
239 239
 	}
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 		 */
321 321
 		$ext = $config->get( 'controller/common/media/standard/mimeicon/extension', '.png' );
322 322
 
323
-		return $mimedir . DIRECTORY_SEPARATOR . $mimetype . $ext;
323
+		return $mimedir.DIRECTORY_SEPARATOR.$mimetype.$ext;
324 324
 	}
325 325
 
326 326
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 		 * @category User
365 365
 		 */
366 366
 		$default = array( 'image/jpeg', 'image/png', 'image/gif' );
367
-		$allowed = $config->get( 'controller/common/media/standard/' . $type . '/allowedtypes', $default );
367
+		$allowed = $config->get( 'controller/common/media/standard/'.$type.'/allowedtypes', $default );
368 368
 
369 369
 		if( in_array( $mimetype, $allowed ) === false )
370 370
 		{
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 		 * @category Developer
426 426
 		 * @category User
427 427
 		 */
428
-		$maxwidth = $config->get( 'controller/common/media/standard/' . $type . '/maxwidth', null );
428
+		$maxwidth = $config->get( 'controller/common/media/standard/'.$type.'/maxwidth', null );
429 429
 
430 430
 		/** controller/common/media/standard/files/maxheight
431 431
 		 * Maximum height of the uploaded images
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 		 * @category Developer
463 463
 		 * @category User
464 464
 		 */
465
-		$maxheight = $config->get( 'controller/common/media/standard/' . $type . '/maxheight', null );
465
+		$maxheight = $config->get( 'controller/common/media/standard/'.$type.'/maxheight', null );
466 466
 
467 467
 		return $media->scale( $maxwidth, $maxheight );
468 468
 	}
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@  discard block
 block discarded – undo
61 61
 			$filepath = $this->getFilePath( $file->getClientFilename(), 'preview', $mimeprev );
62 62
 			$this->storeFile( $media->save( null, $mimetype ), $fsname, $filepath, $item->getPreview() );
63 63
 			$item->setPreview( $filepath );
64
-		}
65
-		else
64
+		} else
66 65
 		{
67 66
 			$mimetype = $media->getMimeType();
68 67
 			$item->setPreview( $this->getMimeIcon( $mimetype ) );
@@ -103,7 +102,9 @@  discard block
 block discarded – undo
103 102
 				$fs->rm( $path );
104 103
 			}
105 104
 		}
106
-		catch( \Exception $e ) { ; } // Can be a mime icon with relative path
105
+		catch( \Exception $e )
106
+		{
107
+; } // Can be a mime icon with relative path
107 108
 
108 109
 		$item->setPreview( '' );
109 110
 	}
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Media/Factory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@
 block discarded – undo
49 49
 		$mime = explode( '/', $mimetype );
50 50
 
51 51
 		$type = ( $mime[0] === 'image' ? 'Image' : 'Application' );
52
-		$name = ( isset( $options[ $mime[0] ]['name'] ) ? ucfirst( $options[ $mime[0] ]['name'] ) : 'Standard' );
52
+		$name = ( isset( $options[$mime[0]]['name'] ) ? ucfirst( $options[$mime[0]]['name'] ) : 'Standard' );
53 53
 
54 54
 
55 55
 		if( ctype_alnum( $name ) === false )
56 56
 		{
57
-			$classname = is_string( $name ) ? '\\Aimeos\\MW\\Media\\' . $name : '<not a string>';
57
+			$classname = is_string( $name ) ? '\\Aimeos\\MW\\Media\\'.$name : '<not a string>';
58 58
 			throw new \Aimeos\MW\Container\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
59 59
 		}
60 60
 
61 61
 		$iface = '\\Aimeos\\MW\\Media\\Iface';
62
-		$classname = '\\Aimeos\\MW\\Media\\' . $type . '\\' . $name;
62
+		$classname = '\\Aimeos\\MW\\Media\\'.$type.'\\'.$name;
63 63
 
64 64
 		if( class_exists( $classname ) === false ) {
65 65
 			throw new \Aimeos\MW\Media\Exception( sprintf( 'Class "%1$s" not available', $classname ) );
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Media/Image/Standard.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		parent::__construct( $mimetype );
42 42
 
43 43
 		if( ( $this->image = @imagecreatefromstring( $content ) ) === false ) {
44
-			throw new \Aimeos\MW\Media\Exception( sprintf( 'The image type isn\'t supported by GDlib.') );
44
+			throw new \Aimeos\MW\Media\Exception( sprintf( 'The image type isn\'t supported by GDlib.' ) );
45 45
 		}
46 46
 
47 47
 		if( ( $this->info = getimagesizefromstring( $content ) ) === false ) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		}
50 50
 
51 51
 		if( imagealphablending( $this->image, false ) === false ) {
52
-			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagealphablending)') );
52
+			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagealphablending)' ) );
53 53
 		}
54 54
 
55 55
 		$this->options = $options;
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 				case 'image/png':
116 116
 
117 117
 					if( imagesavealpha( $this->image, true ) === false ) {
118
-						throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagesavealpha)') );
118
+						throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagesavealpha)' ) );
119 119
 					}
120 120
 
121 121
 					if( @imagepng( $this->image, $filename, (int) 10 - $quality / 10 ) === false ) {
@@ -198,15 +198,15 @@  discard block
 block discarded – undo
198 198
 		try
199 199
 		{
200 200
 			if( imagealphablending( $newImage, false ) === false ) {
201
-				throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagealphablending)') );
201
+				throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagealphablending)' ) );
202 202
 			}
203 203
 
204 204
 			if( ( $transparent = imagecolorallocatealpha( $newImage, 255, 255, 255, 127 ) ) === false ) {
205
-				throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagecolorallocatealpha)') );
205
+				throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagecolorallocatealpha)' ) );
206 206
 			}
207 207
 
208 208
 			if( imagefilledrectangle( $newImage, 0, 0, $destWidth, $destHeight, $transparent ) === false ) {
209
-				throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagefilledrectangle)') );
209
+				throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagefilledrectangle)' ) );
210 210
 			}
211 211
 
212 212
 			if( imagecopyresampled( $newImage, $image, 0, 0, 0, 0, $destWidth, $destHeight, $srcWidth, $srcHeight ) === false ) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -166,8 +166,7 @@
 block discarded – undo
166 166
 			}
167 167
 
168 168
 			$this->image = $result;
169
-		}
170
-		else
169
+		} else
171 170
 		{
172 171
 			$this->image = $this->resample( $this->image, $this->info[0], $this->info[1], $width, $height );
173 172
 		}
Please login to merge, or discard this patch.