@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | $ds = DIRECTORY_SEPARATOR; |
50 | 50 | $path = __DIR__ . $ds . 'data' . $ds . 'supplier-list.php'; |
51 | 51 | |
52 | - if( ( $testdata = include( $path ) ) == false ){ |
|
52 | + if( ( $testdata = include( $path ) ) == false ) { |
|
53 | 53 | throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for supplier list domain', $path ) ); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $refKeys = []; |
57 | 57 | foreach( $testdata['supplier/lists'] as $dataset ) { |
58 | - $refKeys[ $dataset['domain'] ][] = $dataset['refid']; |
|
58 | + $refKeys[$dataset['domain']][] = $dataset['refid']; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $refIds = []; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $codes = []; |
119 | 119 | foreach( $keys as $dataset ) |
120 | 120 | { |
121 | - if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos+1 ) ) === false ) { |
|
121 | + if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos + 1 ) ) === false ) { |
|
122 | 122 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for ref products are set wrong "%1$s"', $dataset ) ); |
123 | 123 | } |
124 | 124 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | $refIds = []; |
132 | 132 | foreach( $manager->searchItems( $search ) as $item ) { |
133 | - $refIds[ 'product/' . $item->getCode() ] = $item->getId(); |
|
133 | + $refIds['product/' . $item->getCode()] = $item->getId(); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | return $refIds; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $labels = []; |
151 | 151 | foreach( $keys as $dataset ) |
152 | 152 | { |
153 | - if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos+1 ) ) === false ) { |
|
153 | + if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos + 1 ) ) === false ) { |
|
154 | 154 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for ref text are set wrong "%1$s"', $dataset ) ); |
155 | 155 | } |
156 | 156 | |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $search->setConditions( $search->compare( '==', 'text.label', $labels ) ); |
162 | 162 | |
163 | 163 | $refIds = []; |
164 | - foreach( $textManager->searchItems( $search ) as $item ) { |
|
165 | - $refIds[ 'text/'.$item->getLabel() ] = $item->getId(); |
|
164 | + foreach( $textManager->searchItems( $search ) as $item ) { |
|
165 | + $refIds['text/' . $item->getLabel()] = $item->getId(); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return $refIds; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $itemCode = []; |
187 | 187 | foreach( $testdata['supplier/lists'] as $dataset ) |
188 | 188 | { |
189 | - if( ( $pos = strpos( $dataset['parentid'], '/' ) ) === false || ( $str = substr( $dataset['parentid'], $pos+1 ) ) === false ) { |
|
189 | + if( ( $pos = strpos( $dataset['parentid'], '/' ) ) === false || ( $str = substr( $dataset['parentid'], $pos + 1 ) ) === false ) { |
|
190 | 190 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for parentid are set wrong "%1$s"', $dataset['parentid'] ) ); |
191 | 191 | } |
192 | 192 | |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | $search = $supplierManager->createSearch(); |
197 | - $search->setConditions( $search->compare( '==', 'supplier.code', $itemCode) ); |
|
197 | + $search->setConditions( $search->compare( '==', 'supplier.code', $itemCode ) ); |
|
198 | 198 | |
199 | 199 | $parentIds = []; |
200 | - foreach( $supplierManager->searchItems( $search ) as $item ) { |
|
201 | - $parentIds[ 'supplier/'.$item->getCode() ] = $item->getId(); |
|
200 | + foreach( $supplierManager->searchItems( $search ) as $item ) { |
|
201 | + $parentIds['supplier/' . $item->getCode()] = $item->getId(); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | $listItemType = $supplierListTypeManager->createItem(); |
@@ -219,17 +219,17 @@ discard block |
||
219 | 219 | $listItem = $supplierListManager->createItem(); |
220 | 220 | foreach( $testdata['supplier/lists'] as $dataset ) |
221 | 221 | { |
222 | - if( !isset( $parentIds[ $dataset['parentid'] ] ) ) { |
|
222 | + if( !isset( $parentIds[$dataset['parentid']] ) ) { |
|
223 | 223 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'No supplier ID found for "%1$s"', $dataset['parentid'] ) ); |
224 | 224 | } |
225 | 225 | |
226 | - if( !isset( $refIds[ $dataset['domain'] ][ $dataset['refid'] ] ) ) { |
|
226 | + if( !isset( $refIds[$dataset['domain']][$dataset['refid']] ) ) { |
|
227 | 227 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'No "%2$s" ref ID found for "%1$s"', $dataset['refid'], $dataset['domain'] ) ); |
228 | 228 | } |
229 | 229 | |
230 | 230 | $listItem->setId( null ); |
231 | - $listItem->setParentId( $parentIds[ $dataset['parentid'] ] ); |
|
232 | - $listItem->setRefId( $refIds[ $dataset['domain'] ] [ $dataset['refid'] ] ); |
|
231 | + $listItem->setParentId( $parentIds[$dataset['parentid']] ); |
|
232 | + $listItem->setRefId( $refIds[$dataset['domain']] [$dataset['refid']] ); |
|
233 | 233 | $listItem->setType( $dataset['type'] ); |
234 | 234 | $listItem->setDomain( $dataset['domain'] ); |
235 | 235 | $listItem->setDateStart( $dataset['start'] ); |
@@ -5,15 +5,15 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2015-2018 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
9 | - 'supplier/lists/type' => array ( |
|
8 | +return array( |
|
9 | + 'supplier/lists/type' => array( |
|
10 | 10 | 'attribute/default' => array( 'domain' => 'attribute', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
11 | 11 | 'media/default' => array( 'domain' => 'media', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
12 | 12 | 'product/default' => array( 'domain' => 'product', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
13 | 13 | 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
14 | 14 | ), |
15 | 15 | |
16 | - 'supplier/lists' => array ( |
|
16 | + 'supplier/lists' => array( |
|
17 | 17 | array( 'parentid' => 'supplier/unitCode001', 'type' => 'default', 'domain' => 'product', 'refid' => 'product/CNC', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1 ), |
18 | 18 | array( 'parentid' => 'supplier/unitCode001', 'type' => 'default', 'domain' => 'product', 'refid' => 'product/CNE', 'start' => '2010-01-01 00:00:00', 'end' => null, 'config' => [], 'pos' => 2, 'status' => 1 ), |
19 | 19 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'mshop_tag_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'mshop_tag_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | 12 | |
13 | 13 | $table = $schema->createTable( 'mshop_tag_type' ); |
14 | 14 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | return $schema; |
33 | 33 | }, |
34 | 34 | |
35 | - 'mshop_tag' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
35 | + 'mshop_tag' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
36 | 36 | |
37 | 37 | $table = $schema->createTable( 'mshop_tag' ); |
38 | 38 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
45 | 45 | $table->addColumn( 'mtime', 'datetime', [] ); |
46 | 46 | $table->addColumn( 'ctime', 'datetime', [] ); |
47 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
47 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
48 | 48 | |
49 | 49 | $table->setPrimaryKey( array( 'id' ), 'pk_mstag_id' ); |
50 | 50 | $table->addUniqueIndex( array( 'siteid', 'domain', 'type', 'langid', 'label' ), 'unq_mstag_sid_dom_ty_lid_lab' ); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'mshop_plugin_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'mshop_plugin_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | 12 | |
13 | 13 | $table = $schema->createTable( 'mshop_plugin_type' ); |
14 | 14 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | return $schema; |
33 | 33 | }, |
34 | 34 | |
35 | - 'mshop_plugin' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
35 | + 'mshop_plugin' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
36 | 36 | |
37 | 37 | $table = $schema->createTable( 'mshop_plugin' ); |
38 | 38 | |
@@ -46,7 +46,7 @@ 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 ) ); |
|
49 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
50 | 50 | |
51 | 51 | $table->setPrimaryKey( array( 'id' ), 'pk_msplu_id' ); |
52 | 52 | $table->addUniqueIndex( array( 'siteid', 'type', 'provider' ), 'unq_msplu_sid_ty_prov' ); |
@@ -167,8 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | $this->executeList( $schemaDiff->toSaveSql( $platform ), $rname ); |
169 | 169 | $this->status( 'done' ); |
170 | - } |
|
171 | - else |
|
170 | + } else |
|
172 | 171 | { |
173 | 172 | $this->status( 'OK' ); |
174 | 173 | } |
@@ -207,8 +206,7 @@ discard block |
||
207 | 206 | |
208 | 207 | $this->executeList( $schemaDiff->toSaveSql( $platform ), $rname ); |
209 | 208 | $this->status( 'done' ); |
210 | - } |
|
211 | - else |
|
209 | + } else |
|
212 | 210 | { |
213 | 211 | $this->status( 'OK' ); |
214 | 212 | } |
@@ -229,8 +227,7 @@ discard block |
||
229 | 227 | if( $schema->columnExists( $table, 'typeid' ) ) { |
230 | 228 | $this->execute( $stmt, $rname ); |
231 | 229 | $this->status( 'done' ); |
232 | - } |
|
233 | - else |
|
230 | + } else |
|
234 | 231 | { |
235 | 232 | $this->status( 'OK' ); |
236 | 233 | } |
@@ -108,9 +108,12 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function createItem( array $values = [] ) |
110 | 110 | { |
111 | - try { |
|
111 | + try |
|
112 | + { |
|
112 | 113 | $values['locale.currency.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
113 | - } catch( \Exception $e ) { |
|
114 | + } |
|
115 | + catch( \Exception $e ) |
|
116 | + { |
|
114 | 117 | $values['locale.currency.siteid'] = null; |
115 | 118 | } |
116 | 119 | |
@@ -180,8 +183,7 @@ discard block |
||
180 | 183 | * @see mshop/locale/manager/currency/standard/count/ansi |
181 | 184 | */ |
182 | 185 | $path = 'mshop/locale/manager/currency/standard/insert'; |
183 | - } |
|
184 | - else |
|
186 | + } else |
|
185 | 187 | { |
186 | 188 | /** mshop/locale/manager/currency/standard/update/mysql |
187 | 189 | * Updates an existing currency record in the database |
@@ -108,9 +108,12 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function createItem( array $values = [] ) |
110 | 110 | { |
111 | - try { |
|
111 | + try |
|
112 | + { |
|
112 | 113 | $values['locale.language.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
113 | - } catch( \Exception $ex ) { |
|
114 | + } |
|
115 | + catch( \Exception $ex ) |
|
116 | + { |
|
114 | 117 | $values['locale.language.siteid'] = null; |
115 | 118 | } |
116 | 119 | |
@@ -177,8 +180,7 @@ discard block |
||
177 | 180 | * @see mshop/locale/manager/language/standard/count/ansi |
178 | 181 | */ |
179 | 182 | $path = 'mshop/locale/manager/language/standard/insert'; |
180 | - } |
|
181 | - else |
|
183 | + } else |
|
182 | 184 | { |
183 | 185 | /** mshop/locale/manager/language/standard/update/mysql |
184 | 186 | * Updates an existing language record in the database |
@@ -155,9 +155,12 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function createItem( array $values = [] ) |
157 | 157 | { |
158 | - try { |
|
158 | + try |
|
159 | + { |
|
159 | 160 | $values['log.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
160 | - } catch( \Exception $e ) { |
|
161 | + } |
|
162 | + catch( \Exception $e ) |
|
163 | + { |
|
161 | 164 | $values['log.siteid'] = null; |
162 | 165 | } |
163 | 166 | |
@@ -182,9 +185,12 @@ discard block |
||
182 | 185 | |
183 | 186 | $context = $this->getContext(); |
184 | 187 | |
185 | - try { |
|
188 | + try |
|
189 | + { |
|
186 | 190 | $siteid = $context->getLocale()->getSiteId(); |
187 | - } catch( \Exception $e ) { |
|
191 | + } |
|
192 | + catch( \Exception $e ) |
|
193 | + { |
|
188 | 194 | $siteid = null; |
189 | 195 | } |
190 | 196 | |
@@ -234,8 +240,7 @@ discard block |
||
234 | 240 | * @see madmin/log/manager/standard/count/ansi |
235 | 241 | */ |
236 | 242 | $path = 'madmin/log/manager/standard/insert'; |
237 | - } |
|
238 | - else |
|
243 | + } else |
|
239 | 244 | { |
240 | 245 | /** madmin/log/manager/standard/update/mysql |
241 | 246 | * Updates an existing log record in the database |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function checkClass( $name, $object ) |
32 | 32 | { |
33 | - if( ($object instanceof $name) === false ) { |
|
33 | + if( ( $object instanceof $name ) === false ) { |
|
34 | 34 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Object doesn\'t implement "%1$s"', $name ) ); |
35 | 35 | } |
36 | 36 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | foreach( $list as $object ) |
52 | 52 | { |
53 | - if( ($object instanceof $name) === false ) { |
|
53 | + if( ( $object instanceof $name ) === false ) { |
|
54 | 54 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Object doesn\'t implement "%1$s"', $name ) ); |
55 | 55 | } |
56 | 56 | } |