Completed
Push — master ( c7cb6f...a11e92 )
by Aimeos
10:48
created
lib/mshoplib/tests/MShop/Service/Provider/Decorator/QuantityTest.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -137,6 +137,7 @@
 block discarded – undo
137 137
 
138 138
 
139 139
 	/**
140
+	 * @param string $paydate
140 141
 	 * @return \Aimeos\MShop\Order\Item\Base\Iface
141 142
 	 */
142 143
 	protected function getOrderBaseItem( $paydate )
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Service/Provider/Decorator/Quantity.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,8 +98,7 @@
 block discarded – undo
98 98
 				foreach( $products as $prodItem ) { // calculate bundled products
99 99
 					$sum += $qty * $prodItem->getQuantity();
100 100
 				}
101
-			}
102
-			else
101
+			} else
103 102
 			{
104 103
 				$sum += $qty;
105 104
 			}
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Media/Manager/Property/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
109 109
 	{
110 110
 		$search = $this->object->createSearch();
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
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$expr[] = $search->compare( '>=', 'media.property.type.ctime', '1970-01-01 00:00:00' );
167 167
 		$expr[] = $search->compare( '==', 'media.property.type.editor', $this->editor );
168 168
 
169
-		$search->setConditions( $search->combine('&&', $expr) );
169
+		$search->setConditions( $search->combine( '&&', $expr ) );
170 170
 		$results = $this->object->searchItems( $search, [], $total );
171 171
 		$this->assertEquals( 1, count( $results ) );
172 172
 
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
 			$search->compare( '==', 'media.property.editor', $this->editor )
178 178
 		);
179 179
 		$search->setConditions( $search->combine( '&&', $conditions ) );
180
-		$search->setSlice(0, 1);
180
+		$search->setSlice( 0, 1 );
181 181
 		$items = $this->object->searchItems( $search, [], $total );
182 182
 
183 183
 		$this->assertEquals( 1, count( $items ) );
184 184
 		$this->assertEquals( 3, $total );
185 185
 
186
-		foreach($items as $itemId => $item) {
186
+		foreach( $items as $itemId => $item ) {
187 187
 			$this->assertEquals( $itemId, $item->getId() );
188 188
 		}
189 189
 	}
@@ -191,17 +191,17 @@  discard block
 block discarded – undo
191 191
 
192 192
 	public function testGetSubManager()
193 193
 	{
194
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') );
195
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') );
194
+		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'type' ) );
195
+		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'type', 'Standard' ) );
196 196
 
197
-		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
198
-		$this->object->getSubManager('unknown');
197
+		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
198
+		$this->object->getSubManager( 'unknown' );
199 199
 	}
200 200
 
201 201
 
202 202
 	public function testGetSubManagerInvalidName()
203 203
 	{
204
-		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
205
-		$this->object->getSubManager('type', 'unknown');
204
+		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
205
+		$this->object->getSubManager( 'type', 'unknown' );
206 206
 	}
207 207
 }
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Media/Manager/Property/Type/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$this->editor = \TestHelperMShop::getContext()->getEditor();
21 21
 		$manager = \Aimeos\MShop\Media\Manager\Factory::createManager( \TestHelperMShop::getContext() );
22
-		$this->object = $manager->getSubManager( 'property' )->getSubManager('type');
22
+		$this->object = $manager->getSubManager( 'property' )->getSubManager( 'type' );
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		unset($this->object);
28
+		unset( $this->object );
29 29
 	}
30 30
 
31 31
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 		$results = $this->object->searchItems( $search );
70 70
 
71
-		if( ($expected = reset($results) ) === false )
71
+		if( ( $expected = reset( $results ) ) === false )
72 72
 		{
73 73
 			throw new \RuntimeException( 'No property type item found.' );
74 74
 		}
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 	{
91 91
 		$search = $this->object->createSearch();
92 92
 		$search->setConditions( $search->compare( '==', 'media.property.type.editor', $this->editor ) );
93
-		$results = $this->object->searchItems($search);
93
+		$results = $this->object->searchItems( $search );
94 94
 
95
-		if( ( $item = reset($results) ) === false ) {
95
+		if( ( $item = reset( $results ) ) === false ) {
96 96
 			throw new \RuntimeException( 'No type item found' );
97 97
 		}
98 98
 
99
-		$item->setId(null);
99
+		$item->setId( null );
100 100
 		$item->setCode( 'unitTestSave' );
101 101
 		$resultSaved = $this->object->saveItem( $item );
102 102
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		$expr[] = $search->compare( '>=', 'media.property.type.ctime', '1970-01-01 00:00:00' );
157 157
 		$expr[] = $search->compare( '==', 'media.property.type.editor', $this->editor );
158 158
 
159
-		$search->setConditions( $search->combine('&&', $expr) );
159
+		$search->setConditions( $search->combine( '&&', $expr ) );
160 160
 		$results = $this->object->searchItems( $search, [], $total );
161 161
 		$this->assertEquals( 1, count( $results ) );
162 162
 
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
 			$search->compare( '=~', 'media.property.type.code', '' ),
167 167
 			$search->compare( '==', 'media.property.type.editor', $this->editor )
168 168
 		);
169
-		$search->setConditions( $search->combine('&&', $conditions ) );
170
-		$search->setSlice(0, 1);
171
-		$items = $this->object->searchItems( $search, [], $total);
169
+		$search->setConditions( $search->combine( '&&', $conditions ) );
170
+		$search->setSlice( 0, 1 );
171
+		$items = $this->object->searchItems( $search, [], $total );
172 172
 
173 173
 		$this->assertEquals( 1, count( $items ) );
174 174
 		$this->assertEquals( 3, $total );
175 175
 
176
-		foreach($items as $itemId => $item) {
176
+		foreach( $items as $itemId => $item ) {
177 177
 			$this->assertEquals( $itemId, $item->getId() );
178 178
 		}
179 179
 	}
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 	public function testGetSubManager()
183 183
 	{
184
-		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
185
-		$this->object->getSubManager('unknown');
184
+		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
185
+		$this->object->getSubManager( 'unknown' );
186 186
 	}
187 187
 }
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Media/Manager/Property/Standard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -288,7 +288,7 @@
 block discarded – undo
288 288
 		 * @see mshop/media/manager/property/decorators/global
289 289
 		 */
290 290
 
291
-		return $this->getSubManagerBase( 'media', 'property/' . $manager, $name );
291
+		return $this->getSubManagerBase( 'media', 'property/'.$manager, $name );
292 292
 	}
293 293
 
294 294
 
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Media/Manager/Property/Type/Standard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -284,7 +284,7 @@
 block discarded – undo
284 284
 		 * @see mshop/media/manager/property/type/decorators/global
285 285
 		 */
286 286
 
287
-		return $this->getSubManagerBase( 'media', 'property/type/' . $manager, $name );
287
+		return $this->getSubManagerBase( 'media', 'property/type/'.$manager, $name );
288 288
 	}
289 289
 
290 290
 
Please login to merge, or discard this patch.
lib/mshoplib/setup/unittest/MediaAddPropertyTestData.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		$this->additional->setEditor( 'core:unittest' );
52 52
 
53 53
 		$ds = DIRECTORY_SEPARATOR;
54
-		$path = __DIR__ . $ds . 'data' . $ds . 'media-property.php';
54
+		$path = __DIR__.$ds.'data'.$ds.'media-property.php';
55 55
 
56 56
 		if( ( $testdata = include( $path ) ) == false ) {
57 57
 			throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for media domain', $path ) );
@@ -89,19 +89,19 @@  discard block
 block discarded – undo
89 89
 			$type->setStatus( $dataset['status'] );
90 90
 
91 91
 			$mediaPropertyTypeManager->saveItem( $type );
92
-			$typeIds[ $key ] = $type->getId();
92
+			$typeIds[$key] = $type->getId();
93 93
 		}
94 94
 
95 95
 		$prodProperty = $mediaPropertyManager->createItem();
96 96
 		foreach( $testdata['media/property'] as $key => $dataset )
97 97
 		{
98
-			if( !isset( $typeIds[ $dataset['typeid'] ] ) ) {
98
+			if( !isset( $typeIds[$dataset['typeid']] ) ) {
99 99
 				throw new \Aimeos\MW\Setup\Exception( sprintf( 'No media property type ID found for "%1$s"', $dataset['typeid'] ) );
100 100
 			}
101 101
 
102 102
 			$prodProperty->setId( null );
103
-			$prodProperty->setParentId( $prodIds[ $dataset['parentid'] ] );
104
-			$prodProperty->setTypeId( $typeIds[ $dataset['typeid'] ] );
103
+			$prodProperty->setParentId( $prodIds[$dataset['parentid']] );
104
+			$prodProperty->setTypeId( $typeIds[$dataset['typeid']] );
105 105
 			$prodProperty->setLanguageId( $dataset['langid'] );
106 106
 			$prodProperty->setValue( $dataset['value'] );
107 107
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		$search = $mediaManager->createSearch();
125 125
 
126 126
 		foreach( $mediaManager->searchItems( $search ) as $id => $item ) {
127
-			$entry[ 'media/' . $item->getUrl() ] = $id;
127
+			$entry['media/'.$item->getUrl()] = $id;
128 128
 		}
129 129
 
130 130
 		return $entry;
Please login to merge, or discard this patch.
lib/mshoplib/setup/unittest/data/media-property.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2017
6 6
  */
7 7
 
8
-return array (
8
+return array(
9 9
 	'media/property/type' => array(
10 10
 		'media/property/type/size' => array( 'domain' => 'media', 'code' => 'size', 'label' => 'Size', 'status' => 1 ),
11 11
 		'media/property/type/mtime' => array( 'domain' => 'media', 'code' => 'mtime', 'label' => 'Modification time', 'status' => 1 ),
Please login to merge, or discard this patch.
lib/mshoplib/setup/default/schema/media.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 return array(
10 10
 	'table' => array(
11
-		'mshop_media_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
11
+		'mshop_media_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
12 12
 
13 13
 			$table = $schema->createTable( 'mshop_media_type' );
14 14
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 			return $schema;
32 32
 		},
33 33
 
34
-		'mshop_media' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
34
+		'mshop_media' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
35 35
 
36 36
 			$table = $schema->createTable( 'mshop_media' );
37 37
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 			$table->addColumn( 'status', 'smallint', [] );
48 48
 			$table->addColumn( 'mtime', 'datetime', [] );
49 49
 			$table->addColumn( 'ctime', 'datetime', [] );
50
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
50
+			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
51 51
 
52 52
 			$table->setPrimaryKey( array( 'id' ), 'pk_msmed_id' );
53 53
 			$table->addIndex( array( 'siteid', 'domain', 'langid' ), 'idx_msmed_sid_dom_langid' );
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			return $schema;
63 63
 		},
64 64
 
65
-		'mshop_media_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
65
+		'mshop_media_list_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
66 66
 
67 67
 			$table = $schema->createTable( 'mshop_media_list_type' );
68 68
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			return $schema;
86 86
 		},
87 87
 
88
-		'mshop_media_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
88
+		'mshop_media_list' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
89 89
 
90 90
 			$table = $schema->createTable( 'mshop_media_list' );
91 91
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 			return $schema;
124 124
 		},
125 125
 
126
-		'mshop_media_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
126
+		'mshop_media_property_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
127 127
 
128 128
 			$table = $schema->createTable( 'mshop_media_property_type' );
129 129
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 			return $schema;
147 147
 		},
148 148
 
149
-		'mshop_media_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
149
+		'mshop_media_property' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
150 150
 
151 151
 			$table = $schema->createTable( 'mshop_media_property' );
152 152
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@  discard block
 block discarded – undo
8 8
 
9 9
 return array(
10 10
 	'table' => array(
11
-		'mshop_media_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
11
+		'mshop_media_type' => function ( \Doctrine\DBAL\Schema\Schema $schema )
12
+		{
12 13
 
13 14
 			$table = $schema->createTable( 'mshop_media_type' );
14 15
 
@@ -31,7 +32,8 @@  discard block
 block discarded – undo
31 32
 			return $schema;
32 33
 		},
33 34
 
34
-		'mshop_media' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
35
+		'mshop_media' => function ( \Doctrine\DBAL\Schema\Schema $schema )
36
+		{
35 37
 
36 38
 			$table = $schema->createTable( 'mshop_media' );
37 39
 
@@ -62,7 +64,8 @@  discard block
 block discarded – undo
62 64
 			return $schema;
63 65
 		},
64 66
 
65
-		'mshop_media_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
67
+		'mshop_media_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema )
68
+		{
66 69
 
67 70
 			$table = $schema->createTable( 'mshop_media_list_type' );
68 71
 
@@ -85,7 +88,8 @@  discard block
 block discarded – undo
85 88
 			return $schema;
86 89
 		},
87 90
 
88
-		'mshop_media_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
91
+		'mshop_media_list' => function ( \Doctrine\DBAL\Schema\Schema $schema )
92
+		{
89 93
 
90 94
 			$table = $schema->createTable( 'mshop_media_list' );
91 95
 
@@ -123,7 +127,8 @@  discard block
 block discarded – undo
123 127
 			return $schema;
124 128
 		},
125 129
 
126
-		'mshop_media_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
130
+		'mshop_media_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema )
131
+		{
127 132
 
128 133
 			$table = $schema->createTable( 'mshop_media_property_type' );
129 134
 
@@ -146,7 +151,8 @@  discard block
 block discarded – undo
146 151
 			return $schema;
147 152
 		},
148 153
 
149
-		'mshop_media_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
154
+		'mshop_media_property' => function ( \Doctrine\DBAL\Schema\Schema $schema )
155
+		{
150 156
 
151 157
 			$table = $schema->createTable( 'mshop_media_property' );
152 158
 
Please login to merge, or discard this patch.