@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | 'table' => array( |
17 | 17 | |
18 | - 'mshop_index_attribute' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
18 | + 'mshop_index_attribute' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
19 | 19 | |
20 | 20 | $table = $schema->createTable( 'mshop_index_attribute' ); |
21 | 21 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | return $schema; |
35 | 35 | }, |
36 | 36 | |
37 | - 'mshop_index_catalog' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
37 | + 'mshop_index_catalog' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
38 | 38 | |
39 | 39 | $table = $schema->createTable( 'mshop_index_catalog' ); |
40 | 40 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | return $schema; |
52 | 52 | }, |
53 | 53 | |
54 | - 'mshop_index_price' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
54 | + 'mshop_index_price' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
55 | 55 | |
56 | 56 | $table = $schema->createTable( 'mshop_index_price' ); |
57 | 57 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | return $schema; |
76 | 76 | }, |
77 | 77 | |
78 | - 'mshop_index_supplier' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
78 | + 'mshop_index_supplier' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
79 | 79 | |
80 | 80 | $table = $schema->createTable( 'mshop_index_supplier' ); |
81 | 81 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return $schema; |
93 | 93 | }, |
94 | 94 | |
95 | - 'mshop_index_text' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
95 | + 'mshop_index_text' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
96 | 96 | |
97 | 97 | $table = $schema->createTable( 'mshop_index_text' ); |
98 | 98 | $table->addOption( 'engine', 'MyISAM' ); |
@@ -71,8 +71,7 @@ discard block |
||
71 | 71 | $this->execute( $this->clear ); |
72 | 72 | $this->execute( $stmt ); |
73 | 73 | $this->status( 'done' ); |
74 | - } |
|
75 | - else |
|
74 | + } else |
|
76 | 75 | { |
77 | 76 | $this->status( 'OK' ); |
78 | 77 | } |
@@ -87,8 +86,7 @@ discard block |
||
87 | 86 | { |
88 | 87 | $this->execute( $stmt ); |
89 | 88 | $this->status( 'done' ); |
90 | - } |
|
91 | - else |
|
89 | + } else |
|
92 | 90 | { |
93 | 91 | $this->status( 'OK' ); |
94 | 92 | } |
@@ -71,8 +71,7 @@ discard block |
||
71 | 71 | $this->execute( $this->clear ); |
72 | 72 | $this->execute( $stmt ); |
73 | 73 | $this->status( 'done' ); |
74 | - } |
|
75 | - else |
|
74 | + } else |
|
76 | 75 | { |
77 | 76 | $this->status( 'OK' ); |
78 | 77 | } |
@@ -87,8 +86,7 @@ discard block |
||
87 | 86 | { |
88 | 87 | $this->execute( $stmt ); |
89 | 88 | $this->status( 'done' ); |
90 | - } |
|
91 | - else |
|
89 | + } else |
|
92 | 90 | { |
93 | 91 | $this->status( 'OK' ); |
94 | 92 | } |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | $search->setConditions( $search->compare( '==', 'media.property.editor', $this->editor ) ); |
55 | 55 | $results = $this->object->searchItems( $search ); |
56 | 56 | |
57 | - if( ( $item = reset($results) ) === false ) { |
|
57 | + if( ( $item = reset( $results ) ) === false ) { |
|
58 | 58 | throw new \RuntimeException( 'No property item found' ); |
59 | 59 | } |
60 | 60 | |
61 | - $item->setId(null); |
|
61 | + $item->setId( null ); |
|
62 | 62 | $item->setLanguageId( 'en' ); |
63 | 63 | $resultSaved = $this->object->saveItem( $item ); |
64 | 64 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | { |
110 | 110 | $search = $this->object->createSearch()->setSlice( 0, 1 ); |
111 | 111 | $conditions = array( |
112 | - $search->compare( '~=', 'media.property.value', '1024'), |
|
112 | + $search->compare( '~=', 'media.property.value', '1024' ), |
|
113 | 113 | $search->compare( '==', 'media.property.editor', $this->editor ) |
114 | 114 | ); |
115 | 115 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
116 | 116 | $results = $this->object->searchItems( $search ); |
117 | 117 | |
118 | - if( ($expected = reset($results)) === false ) { |
|
118 | + if( ( $expected = reset( $results ) ) === false ) { |
|
119 | 119 | throw new \RuntimeException( sprintf( 'No media property item found for value "%1$s".', '1024' ) ); |
120 | 120 | } |
121 | 121 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $expr[] = $search->compare( '==', 'media.property.value', '1024' ); |
155 | 155 | $expr[] = $search->compare( '==', 'media.property.editor', $this->editor ); |
156 | 156 | |
157 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
157 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
158 | 158 | $results = $this->object->searchItems( $search, [], $total ); |
159 | 159 | $this->assertEquals( 1, count( $results ) ); |
160 | 160 | } |
@@ -162,17 +162,17 @@ discard block |
||
162 | 162 | |
163 | 163 | public function testGetSubManager() |
164 | 164 | { |
165 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') ); |
|
166 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') ); |
|
165 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) ); |
|
166 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) ); |
|
167 | 167 | |
168 | 168 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
169 | - $this->object->getSubManager('unknown'); |
|
169 | + $this->object->getSubManager( 'unknown' ); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetSubManagerInvalidName() |
174 | 174 | { |
175 | 175 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
176 | - $this->object->getSubManager('type', 'unknown'); |
|
176 | + $this->object->getSubManager( 'type', 'unknown' ); |
|
177 | 177 | } |
178 | 178 | } |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | $search->setConditions( $search->compare( '==', 'attribute.property.editor', $this->editor ) ); |
62 | 62 | $results = $this->object->searchItems( $search ); |
63 | 63 | |
64 | - if( ( $item = reset($results) ) === false ) { |
|
64 | + if( ( $item = reset( $results ) ) === false ) { |
|
65 | 65 | throw new \RuntimeException( 'No property item found' ); |
66 | 66 | } |
67 | 67 | |
68 | - $item->setId(null); |
|
68 | + $item->setId( null ); |
|
69 | 69 | $item->setLanguageId( 'en' ); |
70 | 70 | $resultSaved = $this->object->saveItem( $item ); |
71 | 71 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -116,13 +116,13 @@ discard block |
||
116 | 116 | { |
117 | 117 | $search = $this->object->createSearch()->setSlice( 0, 1 ); |
118 | 118 | $conditions = array( |
119 | - $search->compare( '~=', 'attribute.property.value', '1024'), |
|
119 | + $search->compare( '~=', 'attribute.property.value', '1024' ), |
|
120 | 120 | $search->compare( '==', 'attribute.property.editor', $this->editor ) |
121 | 121 | ); |
122 | 122 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
123 | 123 | $results = $this->object->searchItems( $search ); |
124 | 124 | |
125 | - if( ($expected = reset($results)) === false ) { |
|
125 | + if( ( $expected = reset( $results ) ) === false ) { |
|
126 | 126 | throw new \RuntimeException( sprintf( 'No attribute property item found for value "%1$s".', '1024' ) ); |
127 | 127 | } |
128 | 128 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $expr[] = $search->compare( '==', 'attribute.property.value', '1024' ); |
162 | 162 | $expr[] = $search->compare( '==', 'attribute.property.editor', $this->editor ); |
163 | 163 | |
164 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
164 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
165 | 165 | $results = $this->object->searchItems( $search, [], $total ); |
166 | 166 | $this->assertEquals( 1, count( $results ) ); |
167 | 167 | } |
@@ -169,17 +169,17 @@ discard block |
||
169 | 169 | |
170 | 170 | public function testGetSubManager() |
171 | 171 | { |
172 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') ); |
|
173 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') ); |
|
172 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) ); |
|
173 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) ); |
|
174 | 174 | |
175 | 175 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
176 | - $this->object->getSubManager('unknown'); |
|
176 | + $this->object->getSubManager( 'unknown' ); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | |
180 | 180 | public function testGetSubManagerInvalidName() |
181 | 181 | { |
182 | 182 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
183 | - $this->object->getSubManager('type', 'unknown'); |
|
183 | + $this->object->getSubManager( 'type', 'unknown' ); |
|
184 | 184 | } |
185 | 185 | } |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | $search->setConditions( $search->compare( '==', 'customer.property.editor', $this->editor ) ); |
55 | 55 | $results = $this->object->searchItems( $search ); |
56 | 56 | |
57 | - if( ( $item = reset($results) ) === false ) { |
|
57 | + if( ( $item = reset( $results ) ) === false ) { |
|
58 | 58 | throw new \RuntimeException( 'No property item found' ); |
59 | 59 | } |
60 | 60 | |
61 | - $item->setId(null); |
|
61 | + $item->setId( null ); |
|
62 | 62 | $item->setLanguageId( 'en' ); |
63 | 63 | $resultSaved = $this->object->saveItem( $item ); |
64 | 64 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | { |
110 | 110 | $search = $this->object->createSearch()->setSlice( 0, 1 ); |
111 | 111 | $conditions = array( |
112 | - $search->compare( '~=', 'customer.property.value', '1'), |
|
112 | + $search->compare( '~=', 'customer.property.value', '1' ), |
|
113 | 113 | $search->compare( '==', 'customer.property.editor', $this->editor ) |
114 | 114 | ); |
115 | 115 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
116 | 116 | $results = $this->object->searchItems( $search ); |
117 | 117 | |
118 | - if( ($expected = reset($results)) === false ) { |
|
118 | + if( ( $expected = reset( $results ) ) === false ) { |
|
119 | 119 | throw new \RuntimeException( sprintf( 'No customer property item found for value "%1$s".', '1' ) ); |
120 | 120 | } |
121 | 121 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $expr[] = $search->compare( '==', 'customer.property.value', '1' ); |
155 | 155 | $expr[] = $search->compare( '==', 'customer.property.editor', $this->editor ); |
156 | 156 | |
157 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
157 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
158 | 158 | $results = $this->object->searchItems( $search, [], $total ); |
159 | 159 | $this->assertEquals( 1, count( $results ) ); |
160 | 160 | } |
@@ -162,17 +162,17 @@ discard block |
||
162 | 162 | |
163 | 163 | public function testGetSubManager() |
164 | 164 | { |
165 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') ); |
|
166 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') ); |
|
165 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) ); |
|
166 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) ); |
|
167 | 167 | |
168 | 168 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
169 | - $this->object->getSubManager('unknown'); |
|
169 | + $this->object->getSubManager( 'unknown' ); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetSubManagerInvalidName() |
174 | 174 | { |
175 | 175 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
176 | - $this->object->getSubManager('type', 'unknown'); |
|
176 | + $this->object->getSubManager( 'type', 'unknown' ); |
|
177 | 177 | } |
178 | 178 | } |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | $search->setConditions( $search->compare( '==', 'product.property.editor', $this->editor ) ); |
55 | 55 | $results = $this->object->searchItems( $search ); |
56 | 56 | |
57 | - if( ( $item = reset($results) ) === false ) { |
|
57 | + if( ( $item = reset( $results ) ) === false ) { |
|
58 | 58 | throw new \RuntimeException( 'No property item found' ); |
59 | 59 | } |
60 | 60 | |
61 | - $item->setId(null); |
|
61 | + $item->setId( null ); |
|
62 | 62 | $item->setLanguageId( 'en' ); |
63 | 63 | $resultSaved = $this->object->saveItem( $item ); |
64 | 64 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | { |
110 | 110 | $search = $this->object->createSearch()->setSlice( 0, 1 ); |
111 | 111 | $conditions = array( |
112 | - $search->compare( '~=', 'product.property.value', '25.0'), |
|
112 | + $search->compare( '~=', 'product.property.value', '25.0' ), |
|
113 | 113 | $search->compare( '==', 'product.property.editor', $this->editor ) |
114 | 114 | ); |
115 | 115 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
116 | 116 | $results = $this->object->searchItems( $search ); |
117 | 117 | |
118 | - if( ($expected = reset($results)) === false ) { |
|
118 | + if( ( $expected = reset( $results ) ) === false ) { |
|
119 | 119 | throw new \RuntimeException( sprintf( 'No product property item found for value "%1$s".', '25.0' ) ); |
120 | 120 | } |
121 | 121 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $expr[] = $search->compare( '==', 'product.property.value', '25.00' ); |
155 | 155 | $expr[] = $search->compare( '==', 'product.property.editor', $this->editor ); |
156 | 156 | |
157 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
157 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
158 | 158 | $results = $this->object->searchItems( $search, [], $total ); |
159 | 159 | $this->assertEquals( 1, count( $results ) ); |
160 | 160 | } |
@@ -162,17 +162,17 @@ discard block |
||
162 | 162 | |
163 | 163 | public function testGetSubManager() |
164 | 164 | { |
165 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') ); |
|
166 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') ); |
|
165 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) ); |
|
166 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) ); |
|
167 | 167 | |
168 | 168 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
169 | - $this->object->getSubManager('unknown'); |
|
169 | + $this->object->getSubManager( 'unknown' ); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetSubManagerInvalidName() |
174 | 174 | { |
175 | 175 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
176 | - $this->object->getSubManager('type', 'unknown'); |
|
176 | + $this->object->getSubManager( 'type', 'unknown' ); |
|
177 | 177 | } |
178 | 178 | } |
@@ -100,8 +100,7 @@ discard block |
||
100 | 100 | $search->compare( '==', $prefix . '.lists.domain', $key ), |
101 | 101 | $search->compare( '==', $prefix . '.lists.type', $domain ), |
102 | 102 | ] ); |
103 | - } |
|
104 | - else |
|
103 | + } else |
|
105 | 104 | { |
106 | 105 | $list[] = $search->compare( '==', $prefix . '.lists.domain', $domain ); |
107 | 106 | } |
@@ -109,8 +108,7 @@ discard block |
||
109 | 108 | |
110 | 109 | $expr[] = $search->combine( '||', $list ); |
111 | 110 | $search->setConditions( $search->combine( '&&', $expr ) ); |
112 | - } |
|
113 | - else |
|
111 | + } else |
|
114 | 112 | { |
115 | 113 | $search->setConditions( $search->compare( '==', $prefix . '.lists.parentid', $ids ) ); |
116 | 114 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | foreach( $testdata['media/property'] as $key => $dataset ) |
92 | 92 | { |
93 | 93 | $prodProperty->setId( null ); |
94 | - $prodProperty->setParentId( $prodIds[ $dataset['parentid'] ] ); |
|
94 | + $prodProperty->setParentId( $prodIds[$dataset['parentid']] ); |
|
95 | 95 | $prodProperty->setLanguageId( $dataset['langid'] ); |
96 | 96 | $prodProperty->setValue( $dataset['value'] ); |
97 | 97 | $prodProperty->setType( $dataset['type'] ); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $search = $mediaManager->createSearch(); |
116 | 116 | |
117 | 117 | foreach( $mediaManager->searchItems( $search ) as $id => $item ) { |
118 | - $entry[ 'media/' . $item->getUrl() ] = $id; |
|
118 | + $entry['media/' . $item->getUrl()] = $id; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | return $entry; |