Completed
Push — master ( ea4e36...aa0b29 )
by Aimeos
01:59
created
controller/frontend/src/Controller/Frontend/Customer/Standard.php 1 patch
Spacing   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -28,28 +28,28 @@  discard block
 block discarded – undo
28 28
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
29 29
 	 * @since 2017.04
30 30
 	 */
31
-	public function addItem( array $values )
31
+	public function addItem(array $values)
32 32
 	{
33 33
 		$context = $this->getContext();
34 34
 		$config = $context->getConfig();
35 35
 
36 36
 		// Show only generated passwords in account creation e-mails
37
-		$pass = ( isset( $values['customer.password'] ) ? false : true );
37
+		$pass = (isset($values['customer.password']) ? false : true);
38 38
 
39
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
40
-		$values = $this->addItemDefaults( $values );
39
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
40
+		$values = $this->addItemDefaults($values);
41 41
 
42 42
 		try
43 43
 		{
44
-			$item = $manager->findItem( $values['customer.code'] );
44
+			$item = $manager->findItem($values['customer.code']);
45 45
 		}
46
-		catch( \Aimeos\MShop\Exception $e )
46
+		catch (\Aimeos\MShop\Exception $e)
47 47
 		{
48
-			$this->checkLimit( $values );
48
+			$this->checkLimit($values);
49 49
 
50 50
 			$item = $manager->createItem();
51
-			$item->fromArray( $values );
52
-			$item->setId( null );
51
+			$item->fromArray($values);
52
+			$item->setId(null);
53 53
 
54 54
 			/** controller/frontend/customer/groupids
55 55
 			 * List of groups new customers should be assigned to
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 			 * @category User
64 64
 			 * @category Developer
65 65
 			 */
66
-			$gids = $config->get( 'client/html/checkout/standard/order/account/standard/groupids', [] ); // @deprecated
67
-			$item->setGroups( (array) $config->get( 'controller/frontend/customer/groupids', $gids ) );
66
+			$gids = $config->get('client/html/checkout/standard/order/account/standard/groupids', []); // @deprecated
67
+			$item->setGroups((array) $config->get('controller/frontend/customer/groupids', $gids));
68 68
 
69
-			$item = $manager->saveItem( $item );
69
+			$item = $manager->saveItem($item);
70 70
 
71 71
 			$msg = $item->toArray();
72
-			$msg['customer.password'] = ( $pass ? $values['customer.password'] : null );
73
-			$context->getMessageQueue( 'mq-email', 'customer/email/account' )->add( json_encode( $msg ) );
72
+			$msg['customer.password'] = ($pass ? $values['customer.password'] : null);
73
+			$context->getMessageQueue('mq-email', 'customer/email/account')->add(json_encode($msg));
74 74
 		}
75 75
 
76 76
 		return $item;
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 	 *
83 83
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
84 84
 	 */
85
-	public function createItem( array $values = [] )
85
+	public function createItem(array $values = [])
86 86
 	{
87
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
87
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
88 88
 
89 89
 		$item = $manager->createItem();
90
-		$item->fromArray( $values );
91
-		$item->setId( null );
92
-		$item->setStatus( 1 );
90
+		$item->fromArray($values);
91
+		$item->setId(null);
92
+		$item->setStatus(1);
93 93
 
94 94
 		return $item;
95 95
 	}
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 	 * @param string $id Unique customer ID
102 102
 	 * @since 2017.04
103 103
 	 */
104
-	public function deleteItem( $id )
104
+	public function deleteItem($id)
105 105
 	{
106
-		$this->checkUser( $id );
106
+		$this->checkUser($id);
107 107
 
108
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
109
-		$manager->deleteItem( $id );
108
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
109
+		$manager->deleteItem($id);
110 110
 	}
111 111
 
112 112
 
@@ -118,17 +118,17 @@  discard block
 block discarded – undo
118 118
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
119 119
 	 * @since 2017.04
120 120
 	 */
121
-	public function editItem( $id, array $values )
121
+	public function editItem($id, array $values)
122 122
 	{
123
-		$this->checkUser( $id );
123
+		$this->checkUser($id);
124 124
 
125
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
126
-		$item = $manager->getItem( $id, [], true );
125
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
126
+		$item = $manager->getItem($id, [], true);
127 127
 
128
-		unset( $values['customer.id'] );
129
-		$item->fromArray( $values );
128
+		unset($values['customer.id']);
129
+		$item->fromArray($values);
130 130
 
131
-		return $manager->saveItem( $item );
131
+		return $manager->saveItem($item);
132 132
 	}
133 133
 
134 134
 
@@ -140,17 +140,17 @@  discard block
 block discarded – undo
140 140
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
141 141
 	 * @since 2017.04
142 142
 	 */
143
-	public function getItem( $id = null, array $domains = [] )
143
+	public function getItem($id = null, array $domains = [])
144 144
 	{
145
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
145
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
146 146
 
147
-		if( $id == null ) {
148
-			return $manager->getItem( $this->getContext()->getUserId(), $domains, true );
147
+		if ($id == null) {
148
+			return $manager->getItem($this->getContext()->getUserId(), $domains, true);
149 149
 		}
150 150
 
151
-		$this->checkUser( $id );
151
+		$this->checkUser($id);
152 152
 
153
-		return $manager->getItem( $id, $domains, true );
153
+		return $manager->getItem($id, $domains, true);
154 154
 	}
155 155
 
156 156
 
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
165 165
 	 * @since 2017.04
166 166
 	 */
167
-	public function findItem( $code, array $domains = [] )
167
+	public function findItem($code, array $domains = [])
168 168
 	{
169
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' )->findItem( $code, $domains );
169
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer')->findItem($code, $domains);
170 170
 	}
171 171
 
172 172
 
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 	 * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item
177 177
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item including the generated ID
178 178
 	 */
179
-	public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item )
179
+	public function saveItem(\Aimeos\MShop\Customer\Item\Iface $item)
180 180
 	{
181
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' )->saveItem( $item );
181
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer')->saveItem($item);
182 182
 	}
183 183
 
184 184
 
@@ -189,17 +189,17 @@  discard block
 block discarded – undo
189 189
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
190 190
 	 * @since 2017.04
191 191
 	 */
192
-	public function addAddressItem( array $values )
192
+	public function addAddressItem(array $values)
193 193
 	{
194 194
 		$context = $this->getContext();
195
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/address' );
195
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/address');
196 196
 
197 197
 		$item = $manager->createItem();
198
-		$item->fromArray( $values );
199
-		$item->setId( null );
200
-		$item->setParentId( $context->getUserId() );
198
+		$item->fromArray($values);
199
+		$item->setId(null);
200
+		$item->setParentId($context->getUserId());
201 201
 
202
-		return $manager->saveItem( $item );
202
+		return $manager->saveItem($item);
203 203
 	}
204 204
 
205 205
 
@@ -208,16 +208,16 @@  discard block
 block discarded – undo
208 208
 	 *
209 209
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
210 210
 	 */
211
-	public function createAddressItem( array $values = [] )
211
+	public function createAddressItem(array $values = [])
212 212
 	{
213 213
 		$context = $this->getContext();
214
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/address' );
214
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/address');
215 215
 
216 216
 		$item = $manager->createItem();
217
-		$item->fromArray( $values );
218
-		$item->setId( null );
217
+		$item->fromArray($values);
218
+		$item->setId(null);
219 219
 
220
-		$item->setParentId( $context->getUserId() );
220
+		$item->setParentId($context->getUserId());
221 221
 
222 222
 		return $item;
223 223
 	}
@@ -229,13 +229,13 @@  discard block
 block discarded – undo
229 229
 	 * @param string $id Unique customer address ID
230 230
 	 * @since 2017.04
231 231
 	 */
232
-	public function deleteAddressItem( $id )
232
+	public function deleteAddressItem($id)
233 233
 	{
234
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
234
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
235 235
 
236
-		$this->checkUser( $manager->getItem( $id, [], true )->getParentId() );
236
+		$this->checkUser($manager->getItem($id, [], true)->getParentId());
237 237
 
238
-		$manager->deleteItem( $id );
238
+		$manager->deleteItem($id);
239 239
 	}
240 240
 
241 241
 
@@ -247,17 +247,17 @@  discard block
 block discarded – undo
247 247
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
248 248
 	 * @since 2017.04
249 249
 	 */
250
-	public function editAddressItem( $id, array $values )
250
+	public function editAddressItem($id, array $values)
251 251
 	{
252
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
252
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
253 253
 
254
-		$item = $manager->getItem( $id, [], true );
255
-		$this->checkUser( $item->getParentId() );
254
+		$item = $manager->getItem($id, [], true);
255
+		$this->checkUser($item->getParentId());
256 256
 
257
-		unset( $values['customer.address.id'] );
258
-		$item->fromArray( $values );
257
+		unset($values['customer.address.id']);
258
+		$item->fromArray($values);
259 259
 
260
-		return $manager->saveItem( $item );
260
+		return $manager->saveItem($item);
261 261
 	}
262 262
 
263 263
 
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
269 269
 	 * @since 2017.04
270 270
 	 */
271
-	public function getAddressItem( $id )
271
+	public function getAddressItem($id)
272 272
 	{
273
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
273
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
274 274
 
275
-		$item = $manager->getItem( $id );
276
-		$this->checkUser( $item->getParentId() );
275
+		$item = $manager->getItem($id);
276
+		$this->checkUser($item->getParentId());
277 277
 
278 278
 		return $item;
279 279
 	}
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
 	 * @param \Aimeos\MShop\Customer\Item\Address\Iface $item Customer address item
286 286
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item including the generated ID
287 287
 	 */
288
-	public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item )
288
+	public function saveAddressItem(\Aimeos\MShop\Customer\Item\Address\Iface $item)
289 289
 	{
290
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' )->saveItem( $item );
290
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address')->saveItem($item);
291 291
 	}
292 292
 
293 293
 
@@ -298,32 +298,32 @@  discard block
 block discarded – undo
298 298
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
299 299
 	 * @since 2017.06
300 300
 	 */
301
-	public function addListItem( array $values )
301
+	public function addListItem(array $values)
302 302
 	{
303 303
 		$context = $this->getContext();
304
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
304
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
305 305
 
306
-		if( !isset( $values['customer.lists.typeid'] ) )
306
+		if (!isset($values['customer.lists.typeid']))
307 307
 		{
308
-			if( !isset( $values['customer.lists.type'] ) ) {
309
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists type code' ) );
308
+			if (!isset($values['customer.lists.type'])) {
309
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists type code'));
310 310
 			}
311 311
 
312
-			if( !isset( $values['customer.lists.domain'] ) ) {
313
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists domain' ) );
312
+			if (!isset($values['customer.lists.domain'])) {
313
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists domain'));
314 314
 			}
315 315
 
316
-			$typeManager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists/type' );
317
-			$typeItem = $typeManager->findItem( $values['customer.lists.type'], [], $values['customer.lists.domain'] );
316
+			$typeManager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists/type');
317
+			$typeItem = $typeManager->findItem($values['customer.lists.type'], [], $values['customer.lists.domain']);
318 318
 			$values['customer.lists.typeid'] = $typeItem->getId();
319 319
 		}
320 320
 
321 321
 		$item = $manager->createItem();
322
-		$item->fromArray( $values );
323
-		$item->setId( null );
324
-		$item->setParentId( $context->getUserId() );
322
+		$item->fromArray($values);
323
+		$item->setId(null);
324
+		$item->setParentId($context->getUserId());
325 325
 
326
-		return $manager->saveItem( $item );
326
+		return $manager->saveItem($item);
327 327
 	}
328 328
 
329 329
 
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
 	public function createListsFilter()
337 337
 	{
338 338
 		$context = $this->getContext();
339
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
339
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
340 340
 
341 341
 		$filter = $manager->createSearch();
342
-		$filter->setConditions( $filter->compare( '==', 'customer.lists.parentid', $context->getUserId() ) );
342
+		$filter->setConditions($filter->compare('==', 'customer.lists.parentid', $context->getUserId()));
343 343
 
344 344
 		return $filter;
345 345
 	}
@@ -351,13 +351,13 @@  discard block
 block discarded – undo
351 351
 	 * @param string $id Unique customer address ID
352 352
 	 * @since 2017.06
353 353
 	 */
354
-	public function deleteListItem( $id )
354
+	public function deleteListItem($id)
355 355
 	{
356
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
356
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
357 357
 
358
-		$this->checkUser( $manager->getItem( $id )->getParentId() );
358
+		$this->checkUser($manager->getItem($id)->getParentId());
359 359
 
360
-		$manager->deleteItem( $id );
360
+		$manager->deleteItem($id);
361 361
 	}
362 362
 
363 363
 
@@ -369,33 +369,33 @@  discard block
 block discarded – undo
369 369
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
370 370
 	 * @since 2017.06
371 371
 	 */
372
-	public function editListItem( $id, array $values )
372
+	public function editListItem($id, array $values)
373 373
 	{
374 374
 		$context = $this->getContext();
375
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
375
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
376 376
 
377
-		$item = $manager->getItem( $id, [], true );
378
-		$this->checkUser( $item->getParentId() );
377
+		$item = $manager->getItem($id, [], true);
378
+		$this->checkUser($item->getParentId());
379 379
 
380
-		if( !isset( $values['customer.lists.typeid'] ) )
380
+		if (!isset($values['customer.lists.typeid']))
381 381
 		{
382
-			if( !isset( $values['customer.lists.type'] ) ) {
383
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists type code' ) );
382
+			if (!isset($values['customer.lists.type'])) {
383
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists type code'));
384 384
 			}
385 385
 
386
-			if( !isset( $values['customer.lists.domain'] ) ) {
387
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists domain' ) );
386
+			if (!isset($values['customer.lists.domain'])) {
387
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists domain'));
388 388
 			}
389 389
 
390
-			$typeManager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists/type' );
391
-			$typeItem = $typeManager->findItem( $values['customer.lists.type'], [], $values['customer.lists.domain'] );
390
+			$typeManager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists/type');
391
+			$typeItem = $typeManager->findItem($values['customer.lists.type'], [], $values['customer.lists.domain']);
392 392
 			$values['customer.lists.typeid'] = $typeItem->getId();
393 393
 		}
394 394
 
395
-		unset( $values['customer.lists.id'] );
396
-		$item->fromArray( $values );
395
+		unset($values['customer.lists.id']);
396
+		$item->fromArray($values);
397 397
 
398
-		return $manager->saveItem( $item );
398
+		return $manager->saveItem($item);
399 399
 	}
400 400
 
401 401
 
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
407 407
 	 * @since 2017.06
408 408
 	 */
409
-	public function getListItem( $id )
409
+	public function getListItem($id)
410 410
 	{
411
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
412
-		$item = $manager->getItem( $id );
411
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
412
+		$item = $manager->getItem($id);
413 413
 
414
-		$this->checkUser( $item->getParentId() );
414
+		$this->checkUser($item->getParentId());
415 415
 
416 416
 		return $item;
417 417
 	}
@@ -425,11 +425,11 @@  discard block
 block discarded – undo
425 425
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface[] Customer list items
426 426
 	 * @since 2017.06
427 427
 	 */
428
-	public function searchListItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
428
+	public function searchListItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
429 429
 	{
430
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
430
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
431 431
 
432
-		return $manager->searchItems( $filter, [], $total );
432
+		return $manager->searchItems($filter, [], $total);
433 433
 	}
434 434
 
435 435
 
@@ -439,37 +439,37 @@  discard block
 block discarded – undo
439 439
 	 * @param string[] $values Associative list of customer keys (e.g. "customer.label") and their values
440 440
 	 * @return string[] Associative list of customer key/value pairs with default values set
441 441
 	 */
442
-	protected function addItemDefaults( array $values )
442
+	protected function addItemDefaults(array $values)
443 443
 	{
444
-		if( !isset( $values['customer.label'] ) || $values['customer.label'] == '' )
444
+		if (!isset($values['customer.label']) || $values['customer.label'] == '')
445 445
 		{
446 446
 			$label = '';
447 447
 
448
-			if( isset( $values['customer.lastname'] ) ) {
448
+			if (isset($values['customer.lastname'])) {
449 449
 				$label = $values['customer.lastname'];
450 450
 			}
451 451
 
452
-			if( isset( $values['customer.firstname'] ) && $values['customer.firstname'] != '' ) {
452
+			if (isset($values['customer.firstname']) && $values['customer.firstname'] != '') {
453 453
 				$label = $values['customer.firstname'] . ' ' . $label;
454 454
 			}
455 455
 
456
-			if( isset( $values['customer.company'] ) && $values['customer.company'] != '' ) {
456
+			if (isset($values['customer.company']) && $values['customer.company'] != '') {
457 457
 				$label .= ' (' . $values['customer.company'] . ')';
458 458
 			}
459 459
 
460 460
 			$values['customer.label'] = $label;
461 461
 		}
462 462
 
463
-		if( !isset( $values['customer.code'] ) ) {
463
+		if (!isset($values['customer.code'])) {
464 464
 			$values['customer.code'] = $values['customer.email'];
465 465
 		}
466 466
 
467
-		if( !isset( $values['customer.status'] ) ) {
467
+		if (!isset($values['customer.status'])) {
468 468
 			$values['customer.status'] = 1;
469 469
 		}
470 470
 
471
-		if( !isset( $values['customer.password'] ) ) {
472
-			$values['customer.password'] = substr( md5( microtime( true ) . getmypid() . rand() ), -8 );
471
+		if (!isset($values['customer.password'])) {
472
+			$values['customer.password'] = substr(md5(microtime(true) . getmypid() . rand()), -8);
473 473
 		}
474 474
 
475 475
 		return $values;
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 	 * @param string[] $values Associative list of customer keys (e.g. "customer.label") and their values
483 483
 	 * @throws \Aimeos\Controller\Frontend\Customer\Exception If access isn't allowed
484 484
 	 */
485
-	protected function checkLimit( array $values )
485
+	protected function checkLimit(array $values)
486 486
 	{
487 487
 		$total = 0;
488 488
 		$context = $this->getContext();
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 		 * @category Developer
504 504
 		 * @see controller/frontend/customer/limit-seconds
505 505
 		 */
506
-		$count = $config->get( 'controller/frontend/customer/limit-count', 5 );
506
+		$count = $config->get('controller/frontend/customer/limit-count', 5);
507 507
 
508 508
 		/** controller/frontend/customer/limit-seconds
509 509
 		 * Customer account limitation time frame in seconds
@@ -521,22 +521,22 @@  discard block
 block discarded – undo
521 521
 		 * @category Developer
522 522
 		 * @see controller/frontend/customer/limit-count
523 523
 		 */
524
-		$seconds = $config->get( 'controller/frontend/customer/limit-seconds', 300 );
524
+		$seconds = $config->get('controller/frontend/customer/limit-seconds', 300);
525 525
 
526
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
526
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
527 527
 
528 528
 		$search = $manager->createSearch();
529 529
 		$expr = [
530
-			$search->compare( '==', 'customer.editor', $context->getEditor() ),
531
-			$search->compare( '>=', 'customer.ctime', date( 'Y-m-d H:i:s', time() - $seconds ) ),
530
+			$search->compare('==', 'customer.editor', $context->getEditor()),
531
+			$search->compare('>=', 'customer.ctime', date('Y-m-d H:i:s', time() - $seconds)),
532 532
 		];
533
-		$search->setConditions( $search->combine( '&&', $expr ) );
534
-		$search->setSlice( 0, 0 );
533
+		$search->setConditions($search->combine('&&', $expr));
534
+		$search->setSlice(0, 0);
535 535
 
536
-		$manager->searchItems( $search, [], $total );
536
+		$manager->searchItems($search, [], $total);
537 537
 
538
-		if( $total > $count ) {
539
-			throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( 'Temporary limit reached' ) );
538
+		if ($total > $count) {
539
+			throw new \Aimeos\Controller\Frontend\Basket\Exception(sprintf('Temporary limit reached'));
540 540
 		}
541 541
 	}
542 542
 
@@ -547,12 +547,12 @@  discard block
 block discarded – undo
547 547
 	 * @param string $id Unique customer ID
548 548
 	 * @throws \Aimeos\Controller\Frontend\Customer\Exception If access isn't allowed
549 549
 	 */
550
-	protected function checkUser( $id )
550
+	protected function checkUser($id)
551 551
 	{
552
-		if( $id != $this->getContext()->getUserId() )
552
+		if ($id != $this->getContext()->getUserId())
553 553
 		{
554
-			$msg = sprintf( 'Not allowed to access customer data for ID "%1$s"', $id );
555
-			throw new \Aimeos\Controller\Frontend\Customer\Exception( $msg );
554
+			$msg = sprintf('Not allowed to access customer data for ID "%1$s"', $id);
555
+			throw new \Aimeos\Controller\Frontend\Customer\Exception($msg);
556 556
 		}
557 557
 	}
558 558
 }
Please login to merge, or discard this patch.