Completed
Pull Request — master (#12)
by
unknown
02:44
created
controller/jobs/src/Controller/Jobs/Coupon/Import/Csv/Code/Standard.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public function getName()
30 30
 	{
31
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Coupon code import CSV' );
31
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Coupon code import CSV');
32 32
 	}
33 33
 
34 34
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function getDescription()
41 41
 	{
42
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Imports new and updates existing coupon code from CSV files' );
42
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Imports new and updates existing coupon code from CSV files');
43 43
 	}
44 44
 
45 45
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		 * @see controller/jobs/coupon/import/csv/code/skip-lines
72 72
 		 * @see controller/jobs/coupon/import/csv/code/max-size
73 73
 		 */
74
-		$mappings = $config->get( 'controller/jobs/coupon/import/csv/code/mapping', $mappings );
74
+		$mappings = $config->get('controller/jobs/coupon/import/csv/code/mapping', $mappings);
75 75
 
76 76
 
77 77
 		/** controller/jobs/coupon/import/csv/code/max-size
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		 * @see controller/jobs/coupon/import/csv/code/skip-lines
91 91
 		 * @see controller/jobs/coupon/import/csv/code/mapping
92 92
 		 */
93
-		$maxcnt = (int) $config->get( 'controller/jobs/coupon/import/csv/code/max-size', 1000 );
93
+		$maxcnt = (int) $config->get('controller/jobs/coupon/import/csv/code/max-size', 1000);
94 94
 
95 95
 
96 96
 		/** controller/jobs/coupon/import/csv/code/skip-lines
@@ -108,64 +108,64 @@  discard block
 block discarded – undo
108 108
 		 * @see controller/jobs/coupon/import/csv/code/mapping
109 109
 		 * @see controller/jobs/coupon/import/csv/code/max-size
110 110
 		 */
111
-		$skiplines = (int) $config->get( 'controller/jobs/coupon/import/csv/code/skip-lines', 0 );
111
+		$skiplines = (int) $config->get('controller/jobs/coupon/import/csv/code/skip-lines', 0);
112 112
 
113 113
 
114 114
 		try
115 115
 		{
116
-			$processor = $this->getProcessors( $mappings );
117
-			$codePos = $this->getCodePosition( $mappings['code'] );
118
-			$fs = $context->getFileSystemManager()->get( 'fs-import' );
116
+			$processor = $this->getProcessors($mappings);
117
+			$codePos = $this->getCodePosition($mappings['code']);
118
+			$fs = $context->getFileSystemManager()->get('fs-import');
119 119
 			$dir = 'couponcode/' . $context->getLocale()->getSite()->getCode();
120 120
 
121
-			if( $fs->isDir( $dir ) === false ) {
121
+			if ($fs->isDir($dir) === false) {
122 122
 				return;
123 123
 			}
124 124
 
125
-			foreach( $fs->scan( $dir ) as $filename )
125
+			foreach ($fs->scan($dir) as $filename)
126 126
 			{
127
-				if( $filename == '.' || $filename == '..' ) {
127
+				if ($filename == '.' || $filename == '..') {
128 128
 					continue;
129 129
 				}
130 130
 
131
-				list( $couponId, ) = explode( '.', $filename );
132
-				$container = $this->getContainer( $fs->readf( $dir . '/' . $filename ) );
131
+				list($couponId,) = explode('.', $filename);
132
+				$container = $this->getContainer($fs->readf($dir . '/' . $filename));
133 133
 
134
-				$msg = sprintf( 'Started coupon import from "%1$s" (%2$s)', $filename, __CLASS__ );
135
-				$logger->log( $msg, \Aimeos\MW\Logger\Base::NOTICE );
134
+				$msg = sprintf('Started coupon import from "%1$s" (%2$s)', $filename, __CLASS__);
135
+				$logger->log($msg, \Aimeos\MW\Logger\Base::NOTICE);
136 136
 
137
-				foreach( $container as $content )
137
+				foreach ($container as $content)
138 138
 				{
139
-					for( $i = 0; $i < $skiplines; $i++ ) {
139
+					for ($i = 0; $i < $skiplines; $i++) {
140 140
 						$content->next();
141 141
 					}
142 142
 
143
-					while( ( $data = $this->getData( $content, $maxcnt, $codePos ) ) !== [] )
143
+					while (($data = $this->getData($content, $maxcnt, $codePos)) !== [])
144 144
 					{
145
-						$items = $this->getCouponCodeItems( array_keys( $data ) );
146
-						$errcnt = $this->import( $items, $data, $couponId, $processor );
147
-						$chunkcnt = count( $data );
145
+						$items = $this->getCouponCodeItems(array_keys($data));
146
+						$errcnt = $this->import($items, $data, $couponId, $processor);
147
+						$chunkcnt = count($data);
148 148
 
149 149
 						$msg = 'Imported coupon lines from "%1$s": %2$d/%3$d (%4$s)';
150
-						$logger->log( sprintf( $msg, $filename, $chunkcnt - $errcnt, $chunkcnt, __CLASS__ ), \Aimeos\MW\Logger\Base::NOTICE );
150
+						$logger->log(sprintf($msg, $filename, $chunkcnt - $errcnt, $chunkcnt, __CLASS__), \Aimeos\MW\Logger\Base::NOTICE);
151 151
 
152 152
 						$errors += $errcnt;
153 153
 						$total += $chunkcnt;
154
-						unset( $items, $data );
154
+						unset($items, $data);
155 155
 					}
156 156
 				}
157 157
 
158 158
 				$container->close();
159
-				$fs->rm( $dir . '/' . $filename );
159
+				$fs->rm($dir . '/' . $filename);
160 160
 
161 161
 				$msg = 'Finished coupon import: %1$d successful, %2$s errors, %3$s total (%4$s)';
162
-				$logger->log( sprintf( $msg, $total - $errors, $errors, $total, __CLASS__ ), \Aimeos\MW\Logger\Base::NOTICE );
162
+				$logger->log(sprintf($msg, $total - $errors, $errors, $total, __CLASS__), \Aimeos\MW\Logger\Base::NOTICE);
163 163
 			}
164 164
 		}
165
-		catch( \Exception $e )
165
+		catch (\Exception $e)
166 166
 		{
167
-			$logger->log( 'Coupon import error: ' . $e->getMessage() );
168
-			$logger->log( $e->getTraceAsString() );
167
+			$logger->log('Coupon import error: ' . $e->getMessage());
168
+			$logger->log($e->getTraceAsString());
169 169
 
170 170
 			throw $e;
171 171
 		}
@@ -179,16 +179,16 @@  discard block
 block discarded – undo
179 179
 	 * @return integer Position of the "coupon.code" column
180 180
 	 * @throws \Aimeos\Controller\Jobs\Exception If no mapping for "coupon.code.code" is found
181 181
 	 */
182
-	protected function getCodePosition( array $mapping )
182
+	protected function getCodePosition(array $mapping)
183 183
 	{
184
-		foreach( $mapping as $pos => $key )
184
+		foreach ($mapping as $pos => $key)
185 185
 		{
186
-			if( $key === 'coupon.code.code' ) {
186
+			if ($key === 'coupon.code.code') {
187 187
 				return $pos;
188 188
 			}
189 189
 		}
190 190
 
191
-		throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'No "coupon.code.code" column in CSV mapping found' ) );
191
+		throw new \Aimeos\Controller\Jobs\Exception(sprintf('No "coupon.code.code" column in CSV mapping found'));
192 192
 	}
193 193
 
194 194
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 * @param string $filepath Path to the container file
199 199
 	 * @return \Aimeos\MW\Container\Iface Container object
200 200
 	 */
201
-	protected function getContainer( $filepath )
201
+	protected function getContainer($filepath)
202 202
 	{
203 203
 		$config = $this->getContext()->getConfig();
204 204
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		 * @see controller/jobs/coupon/import/csv/code/container/content
223 223
 		 * @see controller/jobs/coupon/import/csv/code/container/options
224 224
 		 */
225
-		$container = $config->get( 'controller/jobs/coupon/import/csv/code/container/type', 'File' );
225
+		$container = $config->get('controller/jobs/coupon/import/csv/code/container/type', 'File');
226 226
 
227 227
 		/** controller/jobs/coupon/import/csv/code/container/content
228 228
 		 * Name of the content type inside the container to read the data from
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 		 * @see controller/jobs/coupon/import/csv/code/container/type
243 243
 		 * @see controller/jobs/coupon/import/csv/code/container/options
244 244
 		 */
245
-		$content = $config->get( 'controller/jobs/coupon/import/csv/code/container/content', 'CSV' );
245
+		$content = $config->get('controller/jobs/coupon/import/csv/code/container/content', 'CSV');
246 246
 
247 247
 		/** controller/jobs/coupon/import/csv/code/container/options
248 248
 		 * List of file container options for the coupon import files
@@ -259,9 +259,9 @@  discard block
 block discarded – undo
259 259
 		 * @see controller/jobs/coupon/import/csv/code/container/content
260 260
 		 * @see controller/jobs/coupon/import/csv/code/container/type
261 261
 		 */
262
-		$options = $config->get( 'controller/jobs/coupon/import/csv/code/container/options', [] );
262
+		$options = $config->get('controller/jobs/coupon/import/csv/code/container/options', []);
263 263
 
264
-		return \Aimeos\MW\Container\Factory::getContainer( $filepath, $container, $content, $options );
264
+		return \Aimeos\MW\Container\Factory::getContainer($filepath, $container, $content, $options);
265 265
 	}
266 266
 
267 267
 
@@ -275,36 +275,36 @@  discard block
 block discarded – undo
275 275
 	 * @return integer Number of coupons that couldn't be imported
276 276
 	 * @throws \Aimeos\Controller\Jobs\Exception
277 277
 	 */
278
-	protected function import( array $items, array $data, $couponId,
279
-		\Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $processor )
278
+	protected function import(array $items, array $data, $couponId,
279
+		\Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $processor)
280 280
 	{
281 281
 		$errors = 0;
282 282
 		$context = $this->getContext();
283
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'coupon/code' );
283
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'coupon/code');
284 284
 
285
-		foreach( $data as $code => $list )
285
+		foreach ($data as $code => $list)
286 286
 		{
287 287
 			$manager->begin();
288 288
 
289 289
 			try
290 290
 			{
291
-				if( isset( $items[$code] ) ) {
291
+				if (isset($items[$code])) {
292 292
 					$item = $items[$code];
293 293
 				} else {
294 294
 					$item = $manager->createItem();
295 295
 				}
296 296
 
297
-				$item->setParentId( $couponId );
298
-				$list = $processor->process( $item, $list );
297
+				$item->setParentId($couponId);
298
+				$list = $processor->process($item, $list);
299 299
 
300 300
 				$manager->commit();
301 301
 			}
302
-			catch( \Exception $e )
302
+			catch (\Exception $e)
303 303
 			{
304 304
 				$manager->rollback();
305 305
 
306
-				$msg = sprintf( 'Unable to import coupon with code "%1$s": %2$s', $code, $e->getMessage() );
307
-				$context->getLogger()->log( $msg );
306
+				$msg = sprintf('Unable to import coupon with code "%1$s": %2$s', $code, $e->getMessage());
307
+				$context->getLogger()->log($msg);
308 308
 
309 309
 				$errors++;
310 310
 			}
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Order/Service/Async/Standard.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function getName()
31 31
 	{
32
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Batch update of payment/delivery status' );
32
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Batch update of payment/delivery status');
33 33
 	}
34 34
 
35 35
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function getDescription()
42 42
 	{
43
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Executes payment or delivery service providers that uses batch updates' );
43
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Executes payment or delivery service providers that uses batch updates');
44 44
 	}
45 45
 
46 46
 
@@ -52,32 +52,32 @@  discard block
 block discarded – undo
52 52
 	public function run()
53 53
 	{
54 54
 		$context = $this->getContext();
55
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
55
+		$serviceManager = \Aimeos\MShop\Factory::createManager($context, 'service');
56 56
 
57 57
 		$search = $serviceManager->createSearch();
58 58
 		$start = 0;
59 59
 
60 60
 		do
61 61
 		{
62
-			$serviceItems = $serviceManager->searchItems( $search );
62
+			$serviceItems = $serviceManager->searchItems($search);
63 63
 
64
-			foreach( $serviceItems as $serviceItem )
64
+			foreach ($serviceItems as $serviceItem)
65 65
 			{
66 66
 				try
67 67
 				{
68
-					$serviceManager->getProvider( $serviceItem, $serviceItem->getType() )->updateAsync();
68
+					$serviceManager->getProvider($serviceItem, $serviceItem->getType())->updateAsync();
69 69
 				}
70
-				catch( \Exception $e )
70
+				catch (\Exception $e)
71 71
 				{
72 72
 					$msg = 'Executing updateAsyc() of "%1$s" failed: %2$s';
73
-					$context->getLogger()->log( sprintf( $msg, $serviceItem->getProvider(), $e->getMessage() ) );
73
+					$context->getLogger()->log(sprintf($msg, $serviceItem->getProvider(), $e->getMessage()));
74 74
 				}
75 75
 			}
76 76
 
77
-			$count = count( $serviceItems );
77
+			$count = count($serviceItems);
78 78
 			$start += $count;
79
-			$search->setSlice( $start );
79
+			$search->setSlice($start);
80 80
 		}
81
-		while( $count >= $search->getSliceSize() );
81
+		while ($count >= $search->getSliceSize());
82 82
 	}
83 83
 }
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Order/Service/Payment/Standard.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function getName()
31 31
 	{
32
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Capture authorized payments' );
32
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Capture authorized payments');
33 33
 	}
34 34
 
35 35
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function getDescription()
42 42
 	{
43
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Authorized payments of orders will be captured after dispatching or after a configurable amount of time' );
43
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Authorized payments of orders will be captured after dispatching or after a configurable amount of time');
44 44
 	}
45 45
 
46 46
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		 * @category User
69 69
 		 * @category Developer
70 70
 		 */
71
-		$days = $config->get( 'controller/jobs/order/service/payment/limit-days', 90 );
72
-		$date = date( 'Y-m-d 00:00:00', time() - 86400 * $days );
71
+		$days = $config->get('controller/jobs/order/service/payment/limit-days', 90);
72
+		$date = date('Y-m-d 00:00:00', time() - 86400 * $days);
73 73
 
74 74
 		/** controller/jobs/order/service/payment/capture-days
75 75
 		 * Automatically capture payments after the configured amount of days
@@ -84,90 +84,90 @@  discard block
 block discarded – undo
84 84
 		 * @category User
85 85
 		 * @category Developer
86 86
 		 */
87
-		$capDays = $config->get( 'controller/jobs/order/service/payment/capture-days', null );
87
+		$capDays = $config->get('controller/jobs/order/service/payment/capture-days', null);
88 88
 
89 89
 
90
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
90
+		$serviceManager = \Aimeos\MShop\Factory::createManager($context, 'service');
91 91
 		$serviceSearch = $serviceManager->createSearch();
92
-		$serviceSearch->setConditions( $serviceSearch->compare( '==', 'service.type.code', 'payment' ) );
92
+		$serviceSearch->setConditions($serviceSearch->compare('==', 'service.type.code', 'payment'));
93 93
 
94
-		$orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
94
+		$orderManager = \Aimeos\MShop\Factory::createManager($context, 'order');
95 95
 		$orderSearch = $orderManager->createSearch();
96 96
 
97
-		$status = array( \Aimeos\MShop\Order\Item\Base::STAT_DISPATCHED, \Aimeos\MShop\Order\Item\Base::STAT_DELIVERED );
97
+		$status = array(\Aimeos\MShop\Order\Item\Base::STAT_DISPATCHED, \Aimeos\MShop\Order\Item\Base::STAT_DELIVERED);
98 98
 		$start = 0;
99 99
 
100 100
 		do
101 101
 		{
102
-			$serviceItems = $serviceManager->searchItems( $serviceSearch );
102
+			$serviceItems = $serviceManager->searchItems($serviceSearch);
103 103
 
104
-			foreach( $serviceItems as $serviceItem )
104
+			foreach ($serviceItems as $serviceItem)
105 105
 			{
106 106
 				try
107 107
 				{
108
-					$serviceProvider = $serviceManager->getProvider( $serviceItem, $serviceItem->getType() );
108
+					$serviceProvider = $serviceManager->getProvider($serviceItem, $serviceItem->getType());
109 109
 
110
-					if( !$serviceProvider->isImplemented( \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_CAPTURE ) ) {
110
+					if (!$serviceProvider->isImplemented(\Aimeos\MShop\Service\Provider\Payment\Base::FEAT_CAPTURE)) {
111 111
 						continue;
112 112
 					}
113 113
 
114 114
 
115 115
 					$expr = [];
116
-					$expr[] = $orderSearch->compare( '>', 'order.datepayment', $date );
116
+					$expr[] = $orderSearch->compare('>', 'order.datepayment', $date);
117 117
 
118
-					if( $capDays !== null )
118
+					if ($capDays !== null)
119 119
 					{
120
-						$capdate = date( 'Y-m-d 00:00:00', time() - 86400 * $capDays );
121
-						$expr[] = $orderSearch->compare( '<=', 'order.datepayment', $capdate );
120
+						$capdate = date('Y-m-d 00:00:00', time() - 86400 * $capDays);
121
+						$expr[] = $orderSearch->compare('<=', 'order.datepayment', $capdate);
122 122
 					}
123 123
 					else
124 124
 					{
125
-						$expr[] = $orderSearch->compare( '==', 'order.statusdelivery', $status );
125
+						$expr[] = $orderSearch->compare('==', 'order.statusdelivery', $status);
126 126
 					}
127 127
 
128
-					$expr[] = $orderSearch->compare( '==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED );
129
-					$expr[] = $orderSearch->compare( '==', 'order.base.service.code', $serviceItem->getCode() );
130
-					$expr[] = $orderSearch->compare( '==', 'order.base.service.type', 'payment' );
128
+					$expr[] = $orderSearch->compare('==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED);
129
+					$expr[] = $orderSearch->compare('==', 'order.base.service.code', $serviceItem->getCode());
130
+					$expr[] = $orderSearch->compare('==', 'order.base.service.type', 'payment');
131 131
 
132
-					$orderSearch->setConditions( $orderSearch->combine( '&&', $expr ) );
132
+					$orderSearch->setConditions($orderSearch->combine('&&', $expr));
133 133
 
134 134
 
135 135
 					$orderStart = 0;
136 136
 
137 137
 					do
138 138
 					{
139
-						$orderItems = $orderManager->searchItems( $orderSearch );
139
+						$orderItems = $orderManager->searchItems($orderSearch);
140 140
 
141
-						foreach( $orderItems as $orderItem )
141
+						foreach ($orderItems as $orderItem)
142 142
 						{
143 143
 							try
144 144
 							{
145
-								$serviceProvider->capture( $orderItem );
145
+								$serviceProvider->capture($orderItem);
146 146
 							}
147
-							catch( \Exception $e )
147
+							catch (\Exception $e)
148 148
 							{
149 149
 								$str = 'Error while capturing payment for order with ID "%1$s": %2$s';
150
-								$context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) );
150
+								$context->getLogger()->log(sprintf($str, $orderItem->getId(), $e->getMessage()));
151 151
 							}
152 152
 						}
153 153
 
154
-						$orderCount = count( $orderItems );
154
+						$orderCount = count($orderItems);
155 155
 						$orderStart += $orderCount;
156
-						$orderSearch->setSlice( $orderStart );
156
+						$orderSearch->setSlice($orderStart);
157 157
 					}
158
-					while( $orderCount >= $orderSearch->getSliceSize() );
158
+					while ($orderCount >= $orderSearch->getSliceSize());
159 159
 				}
160
-				catch( \Exception $e )
160
+				catch (\Exception $e)
161 161
 				{
162 162
 					$str = 'Error while capturing payments for service with ID "%1$s": %2$s';
163
-					$context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) );
163
+					$context->getLogger()->log(sprintf($str, $serviceItem->getId(), $e->getMessage()));
164 164
 				}
165 165
 			}
166 166
 
167
-			$count = count( $serviceItems );
167
+			$count = count($serviceItems);
168 168
 			$start += $count;
169
-			$serviceSearch->setSlice( $start );
169
+			$serviceSearch->setSlice($start);
170 170
 		}
171
-		while( $count >= $serviceSearch->getSliceSize() );
171
+		while ($count >= $serviceSearch->getSliceSize());
172 172
 	}
173 173
 }
Please login to merge, or discard this patch.
controller/common/tests/Controller/Common/Catalog/Import/Csv/BaseTest.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -16,77 +16,77 @@  discard block
 block discarded – undo
16 16
 
17 17
 	protected function setUp()
18 18
 	{
19
-		\Aimeos\MShop\Factory::setCache( true );
19
+		\Aimeos\MShop\Factory::setCache(true);
20 20
 
21 21
 		$context = \TestHelperCntl::getContext();
22 22
 		$aimeos = \TestHelperCntl::getAimeos();
23 23
 
24
-		$this->object = new TestAbstract( $context, $aimeos );
24
+		$this->object = new TestAbstract($context, $aimeos);
25 25
 	}
26 26
 
27 27
 
28 28
 	protected function tearDown()
29 29
 	{
30
-		\Aimeos\MShop\Factory::setCache( false );
30
+		\Aimeos\MShop\Factory::setCache(false);
31 31
 		\Aimeos\MShop\Factory::clear();
32 32
 	}
33 33
 
34 34
 
35 35
 	public function testGetCacheInvalidType()
36 36
 	{
37
-		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
38
-		$this->object->getCachePublic( '$' );
37
+		$this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception');
38
+		$this->object->getCachePublic('$');
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testGetCacheInvalidClass()
43 43
 	{
44
-		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
45
-		$this->object->getCachePublic( 'unknown' );
44
+		$this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception');
45
+		$this->object->getCachePublic('unknown');
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testGetProcessors()
50 50
 	{
51
-		$processor = $this->object->getProcessorsPublic( array( 'media' => [] ) );
51
+		$processor = $this->object->getProcessorsPublic(array('media' => []));
52 52
 
53
-		$this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $processor );
53
+		$this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $processor);
54 54
 	}
55 55
 
56 56
 
57 57
 	public function testGetProcessorsInvalidType()
58 58
 	{
59
-		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
60
-		$this->object->getProcessorsPublic( array( '$' => [] ) );
59
+		$this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception');
60
+		$this->object->getProcessorsPublic(array('$' => []));
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testGetProcessorsInvalidClass()
65 65
 	{
66
-		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
67
-		$this->object->getProcessorsPublic( array( 'unknown' => [] ) );
66
+		$this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception');
67
+		$this->object->getProcessorsPublic(array('unknown' => []));
68 68
 	}
69 69
 
70 70
 
71 71
 	public function testGetProcessorsInvalidInterface()
72 72
 	{
73
-		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
74
-		$this->object->getProcessorsPublic( array( 'unknown' => [] ) );
73
+		$this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception');
74
+		$this->object->getProcessorsPublic(array('unknown' => []));
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGetTypeId()
79 79
 	{
80
-		$typeid = $this->object->getTypeIdPublic( 'text/type', 'catalog', 'name' );
80
+		$typeid = $this->object->getTypeIdPublic('text/type', 'catalog', 'name');
81 81
 
82
-		$this->assertNotEquals( null, $typeid );
82
+		$this->assertNotEquals(null, $typeid);
83 83
 	}
84 84
 
85 85
 
86 86
 	public function testGetTypeIdUnknown()
87 87
 	{
88
-		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
89
-		$this->object->getTypeIdPublic( 'text/type', 'catalog', 'unknown' );
88
+		$this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception');
89
+		$this->object->getTypeIdPublic('text/type', 'catalog', 'unknown');
90 90
 	}
91 91
 }
92 92
 
@@ -94,21 +94,21 @@  discard block
 block discarded – undo
94 94
 class TestAbstract
95 95
 	extends \Aimeos\Controller\Common\Catalog\Import\Csv\Base
96 96
 {
97
-	public function getCachePublic( $type, $name = null )
97
+	public function getCachePublic($type, $name = null)
98 98
 	{
99
-		return $this->getCache( $type, $name );
99
+		return $this->getCache($type, $name);
100 100
 	}
101 101
 
102 102
 
103
-	public function getProcessorsPublic( array $mappings )
103
+	public function getProcessorsPublic(array $mappings)
104 104
 	{
105
-		return $this->getProcessors( $mappings );
105
+		return $this->getProcessors($mappings);
106 106
 	}
107 107
 
108 108
 
109
-	public function getTypeIdPublic( $path, $domain, $code )
109
+	public function getTypeIdPublic($path, $domain, $code)
110 110
 	{
111
-		return $this->getTypeId( $path, $domain, $code );
111
+		return $this->getTypeId($path, $domain, $code);
112 112
 	}
113 113
 }
114 114
 
Please login to merge, or discard this patch.
common/tests/Controller/Common/Product/Import/Csv/Processor/DoneTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(true);
21 21
 
22 22
 		$this->context = \TestHelperCntl::getContext();
23
-		$this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] );
23
+		$this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []);
24 24
 	}
25 25
 
26 26
 
27 27
 	protected function tearDown()
28 28
 	{
29
-		\Aimeos\MShop\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 
32 32
 		$this->object = null;
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 
36 36
 	public function testProcess()
37 37
 	{
38
-		$product = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->createItem();
38
+		$product = \Aimeos\MShop\Factory::createManager($this->context, 'product')->createItem();
39 39
 
40
-		$result = $this->object->process( $product, array( 'test' ) );
40
+		$result = $this->object->process($product, array('test'));
41 41
 
42
-		$this->assertEquals( array( 'test' ), $result );
42
+		$this->assertEquals(array('test'), $result);
43 43
 	}
44 44
 }
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
common/src/Controller/Common/Catalog/Import/Csv/Processor/Done.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
28 28
 	 * @param \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor Decorated processor
29 29
 	 */
30
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
31
-		\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor = null )
30
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
31
+		\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor = null)
32 32
 	{
33 33
 	}
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @param array $data List of CSV fields with position as key and data as value
41 41
 	 * @return array List of data which hasn't been imported
42 42
 	 */
43
-	public function process( \Aimeos\MShop\Catalog\Item\Iface $catalog, array $data )
43
+	public function process(\Aimeos\MShop\Catalog\Item\Iface $catalog, array $data)
44 44
 	{
45 45
 		return $data;
46 46
 	}
Please login to merge, or discard this patch.
common/src/Controller/Common/Catalog/Import/Csv/Processor/Iface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
27 27
 	 * @param \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor Decorated processor
28 28
 	 */
29
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
30
-		\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor = null );
29
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
30
+		\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor = null);
31 31
 
32 32
 
33 33
 	/**
@@ -37,5 +37,5 @@  discard block
 block discarded – undo
37 37
 	 * @param array $data List of CSV fields with position as key and data as value
38 38
 	 * @return array List of data which hasn't been imported
39 39
 	 */
40
-	public function process( \Aimeos\MShop\Catalog\Item\Iface $catalog, array $data );
40
+	public function process(\Aimeos\MShop\Catalog\Item\Iface $catalog, array $data);
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
common/src/Controller/Common/Catalog/Import/Csv/Processor/Base.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
33 33
 	 * @param \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object Decorated processor
34 34
 	 */
35
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
36
-		\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object = null )
35
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
36
+		\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object = null)
37 37
 	{
38 38
 		$this->context = $context;
39 39
 		$this->mapping = $mapping;
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
 	 * @param integer $pos Computed position of the list item in the associated list of items
49 49
 	 * @return array Given associative list enriched by default values if they were not already set
50 50
 	 */
51
-	protected function addListItemDefaults( array $list, $pos )
51
+	protected function addListItemDefaults(array $list, $pos)
52 52
 	{
53
-		if( !isset( $list['catalog.lists.position'] ) ) {
53
+		if (!isset($list['catalog.lists.position'])) {
54 54
 			$list['catalog.lists.position'] = $pos;
55 55
 		}
56 56
 
57
-		if( !isset( $list['catalog.lists.status'] ) ) {
57
+		if (!isset($list['catalog.lists.status'])) {
58 58
 			$list['catalog.lists.status'] = 1;
59 59
 		}
60 60
 
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 	 */
93 93
 	protected function getObject()
94 94
 	{
95
-		if( $this->object === null ) {
96
-			throw new \Aimeos\Controller\Jobs\Exception( 'No processor object available' );
95
+		if ($this->object === null) {
96
+			throw new \Aimeos\Controller\Jobs\Exception('No processor object available');
97 97
 		}
98 98
 
99 99
 		return $this->object;
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 	 * @param mixed $default Default value if key isn't found
109 109
 	 * @param mixed Value for the key in the list of the default value
110 110
 	 */
111
-	protected function getValue( array $list, $key, $default )
111
+	protected function getValue(array $list, $key, $default)
112 112
 	{
113
-		return ( isset( $list[$key] ) ? $list[$key] : $default );
113
+		return (isset($list[$key]) ? $list[$key] : $default);
114 114
 	}
115 115
 }
Please login to merge, or discard this patch.
controller/common/src/Controller/Common/Catalog/Import/Csv/Cache/Iface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 *
25 25
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
26 26
 	 */
27
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context );
27
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context);
28 28
 
29 29
 	/**
30 30
 	 * Returns the item or ID for the given code
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
 	 * @param string|null $type Item type if used and required
34 34
 	 * @return \Aimeos\MShop\Common\Item\Iface|string|null Item object, unique ID or null if not found
35 35
 	 */
36
-	public function get( $code, $type = null );
36
+	public function get($code, $type = null);
37 37
 
38 38
 	/**
39 39
 	 * Adds the item or ID to the cache
40 40
 	 *
41 41
 	 * @param \Aimeos\MShop\Common\Item\Iface $item Item object
42 42
 	 */
43
-	public function set( \Aimeos\MShop\Common\Item\Iface $item );
43
+	public function set(\Aimeos\MShop\Common\Item\Iface $item);
44 44
 }
Please login to merge, or discard this patch.