@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'mshop_stock_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'mshop_stock_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | 12 | |
13 | 13 | $table = $schema->createTable( 'mshop_stock_type' ); |
14 | 14 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | return $schema; |
32 | 32 | }, |
33 | 33 | |
34 | - 'mshop_stock' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
34 | + 'mshop_stock' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
35 | 35 | |
36 | 36 | $table = $schema->createTable( 'mshop_stock' ); |
37 | 37 |
@@ -8,7 +8,8 @@ discard block |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'mshop_stock_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'mshop_stock_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) |
|
12 | + { |
|
12 | 13 | |
13 | 14 | $table = $schema->createTable( 'mshop_stock_type' ); |
14 | 15 | |
@@ -31,7 +32,8 @@ discard block |
||
31 | 32 | return $schema; |
32 | 33 | }, |
33 | 34 | |
34 | - 'mshop_stock' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
35 | + 'mshop_stock' => function ( \Doctrine\DBAL\Schema\Schema $schema ) |
|
36 | + { |
|
35 | 37 | |
36 | 38 | $table = $schema->createTable( 'mshop_stock' ); |
37 | 39 |
@@ -8,7 +8,8 @@ discard block |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'mshop_product_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'mshop_product_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) |
|
12 | + { |
|
12 | 13 | |
13 | 14 | $table = $schema->createTable( 'mshop_product_type' ); |
14 | 15 | |
@@ -31,7 +32,8 @@ discard block |
||
31 | 32 | return $schema; |
32 | 33 | }, |
33 | 34 | |
34 | - 'mshop_product' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
35 | + 'mshop_product' => function ( \Doctrine\DBAL\Schema\Schema $schema ) |
|
36 | + { |
|
35 | 37 | |
36 | 38 | $table = $schema->createTable( 'mshop_product' ); |
37 | 39 | |
@@ -63,7 +65,8 @@ discard block |
||
63 | 65 | return $schema; |
64 | 66 | }, |
65 | 67 | |
66 | - 'mshop_product_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
68 | + 'mshop_product_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) |
|
69 | + { |
|
67 | 70 | |
68 | 71 | $table = $schema->createTable( 'mshop_product_list_type' ); |
69 | 72 | |
@@ -86,7 +89,8 @@ discard block |
||
86 | 89 | return $schema; |
87 | 90 | }, |
88 | 91 | |
89 | - 'mshop_product_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
92 | + 'mshop_product_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) |
|
93 | + { |
|
90 | 94 | |
91 | 95 | $table = $schema->createTable( 'mshop_product_list' ); |
92 | 96 | |
@@ -124,7 +128,8 @@ discard block |
||
124 | 128 | return $schema; |
125 | 129 | }, |
126 | 130 | |
127 | - 'mshop_product_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
131 | + 'mshop_product_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) |
|
132 | + { |
|
128 | 133 | |
129 | 134 | $table = $schema->createTable( 'mshop_product_property_type' ); |
130 | 135 | |
@@ -147,7 +152,8 @@ discard block |
||
147 | 152 | return $schema; |
148 | 153 | }, |
149 | 154 | |
150 | - 'mshop_product_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
155 | + 'mshop_product_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) |
|
156 | + { |
|
151 | 157 | |
152 | 158 | $table = $schema->createTable( 'mshop_product_property' ); |
153 | 159 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'mshop_product_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'mshop_product_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | 12 | |
13 | 13 | $table = $schema->createTable( 'mshop_product_type' ); |
14 | 14 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | return $schema; |
32 | 32 | }, |
33 | 33 | |
34 | - 'mshop_product' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
34 | + 'mshop_product' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
35 | 35 | |
36 | 36 | $table = $schema->createTable( 'mshop_product' ); |
37 | 37 | |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $table->addColumn( 'status', 'smallint', [] ); |
47 | 47 | $table->addColumn( 'mtime', 'datetime', [] ); |
48 | 48 | $table->addColumn( 'ctime', 'datetime', [] ); |
49 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
50 | - $table->addColumn( 'target', 'string', array('length' => 255 ) ); |
|
49 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
50 | + $table->addColumn( 'target', 'string', array( 'length' => 255 ) ); |
|
51 | 51 | |
52 | 52 | $table->setPrimaryKey( array( 'id' ), 'pk_mspro_id' ); |
53 | 53 | $table->addUniqueIndex( array( 'siteid', 'code' ), 'unq_mspro_siteid_code' ); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return $schema; |
65 | 65 | }, |
66 | 66 | |
67 | - 'mshop_product_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
67 | + 'mshop_product_list_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
68 | 68 | |
69 | 69 | $table = $schema->createTable( 'mshop_product_list_type' ); |
70 | 70 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | return $schema; |
88 | 88 | }, |
89 | 89 | |
90 | - 'mshop_product_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
90 | + 'mshop_product_list' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
91 | 91 | |
92 | 92 | $table = $schema->createTable( 'mshop_product_list' ); |
93 | 93 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return $schema; |
126 | 126 | }, |
127 | 127 | |
128 | - 'mshop_product_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
128 | + 'mshop_product_property_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
129 | 129 | |
130 | 130 | $table = $schema->createTable( 'mshop_product_property_type' ); |
131 | 131 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | return $schema; |
149 | 149 | }, |
150 | 150 | |
151 | - 'mshop_product_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
151 | + 'mshop_product_property' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
152 | 152 | |
153 | 153 | $table = $schema->createTable( 'mshop_product_property' ); |
154 | 154 |
@@ -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 ); |