@@ -552,8 +552,8 @@ discard block |
||
552 | 552 | |
553 | 553 | while( ( $row = $results->fetch() ) !== false ) |
554 | 554 | { |
555 | - $map[ $row['stock.id'] ] = $row; |
|
556 | - $typeIds[ $row['stock.typeid'] ] = null; |
|
555 | + $map[$row['stock.id']] = $row; |
|
556 | + $typeIds[$row['stock.typeid']] = null; |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | $dbm->release( $conn, $dbname ); |
@@ -576,9 +576,9 @@ discard block |
||
576 | 576 | |
577 | 577 | foreach( $map as $id => $row ) |
578 | 578 | { |
579 | - if( isset( $typeItems[ $row['stock.typeid'] ] ) ) |
|
579 | + if( isset( $typeItems[$row['stock.typeid']] ) ) |
|
580 | 580 | { |
581 | - $row['stock.type'] = $typeItems[ $row['stock.typeid'] ]->getCode(); |
|
581 | + $row['stock.type'] = $typeItems[$row['stock.typeid']]->getCode(); |
|
582 | 582 | $row['stock.typename'] = $typeItems[$row['stock.typeid']]->getName(); |
583 | 583 | } |
584 | 584 |
@@ -200,8 +200,7 @@ |
||
200 | 200 | * @see mshop/stock/manager/standard/stocklevel |
201 | 201 | */ |
202 | 202 | $path = 'mshop/stock/manager/standard/insert'; |
203 | - } |
|
204 | - else |
|
203 | + } else |
|
205 | 204 | { |
206 | 205 | /** mshop/stock/manager/standard/update/mysql |
207 | 206 | * Updates an existing product stock record in the database |
@@ -435,6 +435,7 @@ |
||
435 | 435 | * @param \Aimeos\MW\Criteria\Iface $search Search criteria object |
436 | 436 | * @param string[] $ref List of domains to fetch list items and referenced items for |
437 | 437 | * @param integer|null &$total Number of items that are available in total |
438 | + * @param integer $total |
|
438 | 439 | * @return array List of stock items implementing \Aimeos\MShop\Stock\Item\Iface |
439 | 440 | */ |
440 | 441 | public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |
@@ -283,7 +283,7 @@ |
||
283 | 283 | * @see mshop/stock/manager/type/decorators/global |
284 | 284 | */ |
285 | 285 | |
286 | - return $this->getSubManagerBase( 'stock', 'type/' . $manager, $name ); |
|
286 | + return $this->getSubManagerBase( 'stock', 'type/'.$manager, $name ); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 |
@@ -71,12 +71,12 @@ |
||
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 |
@@ -72,8 +72,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -197,6 +197,9 @@ |
||
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' ); |
@@ -91,7 +91,7 @@ discard block |
||
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 |
||
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 |
@@ -15,7 +15,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 ); |
@@ -49,17 +49,17 @@ |
||
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 ) ); |
@@ -41,7 +41,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 ) { |
@@ -166,8 +166,7 @@ |
||
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 | } |