Completed
Push — master ( 2a4ecd...19aca8 )
by Aimeos
03:03
created
controller/frontend/tests/Controller/Frontend/Customer/StandardTest.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -18,114 +18,114 @@  discard block
 block discarded – undo
18 18
 	protected function setUp()
19 19
 	{
20 20
 		$this->context = \TestHelperFrontend::getContext();
21
-		$this->object = new \Aimeos\Controller\Frontend\Customer\Standard( $this->context );
21
+		$this->object = new \Aimeos\Controller\Frontend\Customer\Standard($this->context);
22 22
 	}
23 23
 
24 24
 
25 25
 	protected function tearDown()
26 26
 	{
27
-		unset( $this->context, $this->object );
27
+		unset($this->context, $this->object);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testAddEditSaveDeleteItem()
32 32
 	{
33
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
34
-		$id = $manager->findItem( 'UTC001' )->getId();
33
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer');
34
+		$id = $manager->findItem('UTC001')->getId();
35 35
 
36
-		$this->context->setUserId( $id );
37
-		$item = $this->object->addItem( ['customer.code' => 'unittest-ctnl', 'customer.status' => 1] );
38
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $item );
36
+		$this->context->setUserId($id);
37
+		$item = $this->object->addItem(['customer.code' => 'unittest-ctnl', 'customer.status' => 1]);
38
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $item);
39 39
 
40
-		$this->context->setUserId( $item->getId() );
41
-		$item = $this->object->editItem( $item->getId(), ['customer.code' => 'unittest-ctnl2'] );
42
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $item );
40
+		$this->context->setUserId($item->getId());
41
+		$item = $this->object->editItem($item->getId(), ['customer.code' => 'unittest-ctnl2']);
42
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $item);
43 43
 
44
-		$item->setStatus( 0 );
45
-		$item = $this->object->saveItem( $item );
46
-		$this->assertEquals( 0, $item->getStatus() );
44
+		$item->setStatus(0);
45
+		$item = $this->object->saveItem($item);
46
+		$this->assertEquals(0, $item->getStatus());
47 47
 
48
-		$this->object->deleteItem( $item->getId() );
48
+		$this->object->deleteItem($item->getId());
49 49
 
50
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
51
-		$manager->findItem( 'unittest-ctnl' );
50
+		$this->setExpectedException('\Aimeos\MShop\Exception');
51
+		$manager->findItem('unittest-ctnl');
52 52
 	}
53 53
 
54 54
 
55 55
 	public function testCreateItem()
56 56
 	{
57 57
 		$result = $this->object->createItem();
58
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $result );
58
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $result);
59 59
 	}
60 60
 
61 61
 
62 62
 	public function testGetItem()
63 63
 	{
64
-		$id = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' )->findItem( 'UTC001' )->getId();
65
-		$this->context->setUserId( $id );
64
+		$id = \Aimeos\MShop\Factory::createManager($this->context, 'customer')->findItem('UTC001')->getId();
65
+		$this->context->setUserId($id);
66 66
 
67
-		$result = $this->object->getItem( $id, ['customer/address', 'text'] );
67
+		$result = $this->object->getItem($id, ['customer/address', 'text']);
68 68
 
69
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $result );
70
-		$this->assertEquals( 1, count( $result->getRefItems( 'text' ) ) );
71
-		$this->assertEquals( 1, count( $result->getAddressItems() ) );
69
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $result);
70
+		$this->assertEquals(1, count($result->getRefItems('text')));
71
+		$this->assertEquals(1, count($result->getAddressItems()));
72 72
 	}
73 73
 
74 74
 
75 75
 	public function testFindItem()
76 76
 	{
77
-		$result = $this->object->findItem( 'UTC001' );
78
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $result );
77
+		$result = $this->object->findItem('UTC001');
78
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testAddEditSaveDeleteAddressItem()
83 83
 	{
84
-		$customer = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' )->findItem( 'UTC001' );
85
-		$this->context->setUserId( $customer->getId() );
84
+		$customer = \Aimeos\MShop\Factory::createManager($this->context, 'customer')->findItem('UTC001');
85
+		$this->context->setUserId($customer->getId());
86 86
 
87
-		$item = $this->object->addAddressItem( ['customer.address.lastname' => 'unittest-ctnl'] );
88
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Address\Iface', $item );
87
+		$item = $this->object->addAddressItem(['customer.address.lastname' => 'unittest-ctnl']);
88
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Address\Iface', $item);
89 89
 
90
-		$item = $this->object->editAddressItem( $item->getId(), ['customer.address.lastname' => 'unittest-ctnl2'] );
91
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Address\Iface', $item );
90
+		$item = $this->object->editAddressItem($item->getId(), ['customer.address.lastname' => 'unittest-ctnl2']);
91
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Address\Iface', $item);
92 92
 
93
-		$item->setLastName( 'test' );
94
-		$this->object->saveAddressItem( $item );
95
-		$this->assertEquals( 'test', $item->getLastName() );
93
+		$item->setLastName('test');
94
+		$this->object->saveAddressItem($item);
95
+		$this->assertEquals('test', $item->getLastName());
96 96
 
97
-		$this->object->deleteAddressItem( $item->getId() );
97
+		$this->object->deleteAddressItem($item->getId());
98 98
 	}
99 99
 
100 100
 
101 101
 	public function testCreateAddressItem()
102 102
 	{
103 103
 		$result = $this->object->createAddressItem();
104
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Address\Iface', $result );
104
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Address\Iface', $result);
105 105
 	}
106 106
 
107 107
 
108 108
 	public function testGetAddressItem()
109 109
 	{
110
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/address' );
110
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/address');
111 111
 		$search = $manager->createSearch();
112
-		$search->setSlice( 0, 1 );
113
-		$result = $manager->searchItems( $search );
112
+		$search->setSlice(0, 1);
113
+		$result = $manager->searchItems($search);
114 114
 
115
-		if( ( $item = reset( $result ) ) === false ) {
116
-			throw new \RuntimeException( 'No customer address available' );
115
+		if (($item = reset($result)) === false) {
116
+			throw new \RuntimeException('No customer address available');
117 117
 		}
118 118
 
119
-		$this->context->setUserId( $item->getParentId() );
120
-		$result = $this->object->getAddressItem( $item->getId() );
121
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Address\Iface', $result );
119
+		$this->context->setUserId($item->getParentId());
120
+		$result = $this->object->getAddressItem($item->getId());
121
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Address\Iface', $result);
122 122
 	}
123 123
 
124 124
 
125 125
 	public function testAddEditDeleteListItem()
126 126
 	{
127
-		$customer = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' )->findItem( 'UTC001' );
128
-		$this->context->setUserId( $customer->getId() );
127
+		$customer = \Aimeos\MShop\Factory::createManager($this->context, 'customer')->findItem('UTC001');
128
+		$this->context->setUserId($customer->getId());
129 129
 
130 130
 		$values = [
131 131
 			'customer.lists.type' => 'favorite',
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 			'customer.lists.refid' => '-1'
134 134
 		];
135 135
 
136
-		$item = $this->object->addListItem( $values );
137
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Lists\Iface', $item );
136
+		$item = $this->object->addListItem($values);
137
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Lists\Iface', $item);
138 138
 
139 139
 		$values = [
140 140
 			'customer.lists.type' => 'favorite',
@@ -142,46 +142,46 @@  discard block
 block discarded – undo
142 142
 			'customer.lists.refid' => '-2'
143 143
 		];
144 144
 
145
-		$item = $this->object->editListItem( $item->getId(), $values );
146
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Lists\Iface', $item );
145
+		$item = $this->object->editListItem($item->getId(), $values);
146
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Lists\Iface', $item);
147 147
 
148
-		$this->object->deleteListItem( $item->getId() );
148
+		$this->object->deleteListItem($item->getId());
149 149
 
150
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
151
-		$this->object->getListItem( $item->getId() );
150
+		$this->setExpectedException('\Aimeos\MShop\Exception');
151
+		$this->object->getListItem($item->getId());
152 152
 	}
153 153
 
154 154
 
155 155
 	public function testGetListItem()
156 156
 	{
157
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/lists' );
157
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/lists');
158 158
 		$search = $manager->createSearch();
159
-		$search->setSlice( 0, 1 );
160
-		$result = $manager->searchItems( $search );
159
+		$search->setSlice(0, 1);
160
+		$result = $manager->searchItems($search);
161 161
 
162
-		if( ( $item = reset( $result ) ) === false ) {
163
-			throw new \RuntimeException( 'No customer lists item available' );
162
+		if (($item = reset($result)) === false) {
163
+			throw new \RuntimeException('No customer lists item available');
164 164
 		}
165 165
 
166
-		$this->context->setUserId( $item->getParentId() );
167
-		$result = $this->object->getListItem( $item->getId() );
168
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Lists\Iface', $result );
166
+		$this->context->setUserId($item->getParentId());
167
+		$result = $this->object->getListItem($item->getId());
168
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Lists\Iface', $result);
169 169
 	}
170 170
 
171 171
 
172 172
 	public function testSearchListItem()
173 173
 	{
174
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
175
-		$customer = $manager->findItem( 'UTC001' );
176
-		$this->context->setUserId( $customer->getId() );
174
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer');
175
+		$customer = $manager->findItem('UTC001');
176
+		$this->context->setUserId($customer->getId());
177 177
 
178 178
 		$filter = $this->object->createListsFilter();
179
-		$result = $this->object->searchListItems( $filter );
179
+		$result = $this->object->searchListItems($filter);
180 180
 
181
-		foreach( $result as $item )
181
+		foreach ($result as $item)
182 182
 		{
183
-			$this->assertEquals( $customer->getId(), $item->getParentId() );
184
-			$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Lists\Iface', $item );
183
+			$this->assertEquals($customer->getId(), $item->getParentId());
184
+			$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Lists\Iface', $item);
185 185
 		}
186 186
 	}
187 187
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Order/StandardTest.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -18,184 +18,184 @@
 block discarded – undo
18 18
 
19 19
 	protected function setUp()
20 20
 	{
21
-		\Aimeos\MShop\Factory::setCache( true );
21
+		\Aimeos\MShop\Factory::setCache(true);
22 22
 
23 23
 		$this->context = \TestHelperFrontend::getContext();
24
-		$this->object = new \Aimeos\Controller\Frontend\Order\Standard( $this->context );
24
+		$this->object = new \Aimeos\Controller\Frontend\Order\Standard($this->context);
25 25
 	}
26 26
 
27 27
 
28 28
 	protected function tearDown()
29 29
 	{
30
-		unset( $this->object, $this->context );
30
+		unset($this->object, $this->context);
31 31
 
32
-		\Aimeos\MShop\Factory::setCache( false );
32
+		\Aimeos\MShop\Factory::setCache(false);
33 33
 		\Aimeos\MShop\Factory::clear();
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testAddItem()
38 38
 	{
39
-		$manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' )
40
-			->setConstructorArgs( [$this->context] )
41
-			->setMethods( ['saveItem'] )
39
+		$manager = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard')
40
+			->setConstructorArgs([$this->context])
41
+			->setMethods(['saveItem'])
42 42
 			->getMock();
43 43
 
44
-		\Aimeos\MShop\Factory::injectManager( $this->context, 'order', $manager );
44
+		\Aimeos\MShop\Factory::injectManager($this->context, 'order', $manager);
45 45
 
46
-		$manager->expects( $this->once() )->method( 'saveItem' )
47
-			->will( $this->returnValue( $manager->createItem() ) );
46
+		$manager->expects($this->once())->method('saveItem')
47
+			->will($this->returnValue($manager->createItem()));
48 48
 
49
-		$this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' ) );
49
+		$this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' ));
50 50
 	}
51 51
 
52 52
 
53 53
 	public function testAddItemLimit()
54 54
 	{
55
-		$this->context->getConfig()->set( 'controller/frontend/order/limit-seconds', 86400 * 365 );
55
+		$this->context->getConfig()->set('controller/frontend/order/limit-seconds', 86400 * 365);
56 56
 
57
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' );
58
-		$result = $manager->searchItems( $manager->createSearch()->setSlice( 0, 1 ) );
57
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base');
58
+		$result = $manager->searchItems($manager->createSearch()->setSlice(0, 1));
59 59
 
60
-		if( ( $item = reset( $result ) ) === false ) {
61
-			throw new \RuntimeException( 'No order item found' );
60
+		if (($item = reset($result)) === false) {
61
+			throw new \RuntimeException('No order item found');
62 62
 		}
63 63
 
64
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' );
65
-		$this->object->addItem( $item->getId(), 'test' );
64
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception');
65
+		$this->object->addItem($item->getId(), 'test');
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testCreateFilter()
70 70
 	{
71
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() );
71
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter());
72 72
 	}
73 73
 
74 74
 
75 75
 	public function testGetItem()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
78
-		$customerItem = $manager->findItem( 'UTC001' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer');
78
+		$customerItem = $manager->findItem('UTC001');
79 79
 
80
-		$this->context->setEditor( 'core:unittest' );
80
+		$this->context->setEditor('core:unittest');
81 81
 
82
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' );
83
-		$search = $manager->createSearch()->setSlice( 0, 1 );
84
-		$search->setConditions( $search->compare( '==', 'order.base.customerid', $customerItem->getId() ) );
85
-		$result = $manager->searchItems( $search );
82
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'order');
83
+		$search = $manager->createSearch()->setSlice(0, 1);
84
+		$search->setConditions($search->compare('==', 'order.base.customerid', $customerItem->getId()));
85
+		$result = $manager->searchItems($search);
86 86
 
87
-		if( ( $item = reset( $result ) ) === false ) {
88
-			throw new \RuntimeException( 'No order item found' );
87
+		if (($item = reset($result)) === false) {
88
+			throw new \RuntimeException('No order item found');
89 89
 		}
90 90
 
91
-		$this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( $item->getId() ) );
91
+		$this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem($item->getId()));
92 92
 	}
93 93
 
94 94
 
95 95
 	public function testGetItemException()
96 96
 	{
97
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' );
97
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception');
98 98
 		$this->object->getItem( -1 );
99 99
 	}
100 100
 
101 101
 
102 102
 	public function testSearchItems()
103 103
 	{
104
-		$this->assertGreaterThan( 1, $this->object->searchItems( $this->object->createFilter() ) );
104
+		$this->assertGreaterThan(1, $this->object->searchItems($this->object->createFilter()));
105 105
 	}
106 106
 
107 107
 
108 108
 	public function testStore()
109 109
 	{
110 110
 		$name = 'ControllerFrontendOrderStore';
111
-		$this->context->getConfig()->set( 'mshop/order/manager/name', $name );
111
+		$this->context->getConfig()->set('mshop/order/manager/name', $name);
112 112
 
113 113
 
114
-		$orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' )
115
-			->setMethods( array( 'saveItem', 'getSubManager' ) )
116
-			->setConstructorArgs( array( $this->context ) )
114
+		$orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard')
115
+			->setMethods(array('saveItem', 'getSubManager'))
116
+			->setConstructorArgs(array($this->context))
117 117
 			->getMock();
118 118
 
119
-		$orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' )
120
-			->setMethods( array( 'store' ) )
121
-			->setConstructorArgs( array( $this->context ) )
119
+		$orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard')
120
+			->setMethods(array('store'))
121
+			->setConstructorArgs(array($this->context))
122 122
 			->getMock();
123 123
 
124
-		\Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub );
124
+		\Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub);
125 125
 
126 126
 
127 127
 		$orderBaseItem = $orderBaseManagerStub->createItem();
128
-		$orderBaseItem->setId( 1 );
128
+		$orderBaseItem->setId(1);
129 129
 
130 130
 
131
-		$orderBaseManagerStub->expects( $this->once() )->method( 'store' );
131
+		$orderBaseManagerStub->expects($this->once())->method('store');
132 132
 
133
-		$orderManagerStub->expects( $this->once() )->method( 'getSubManager' )
134
-			->will( $this->returnValue( $orderBaseManagerStub ) );
133
+		$orderManagerStub->expects($this->once())->method('getSubManager')
134
+			->will($this->returnValue($orderBaseManagerStub));
135 135
 
136
-		$orderManagerStub->expects( $this->once() )->method( 'saveItem' );
136
+		$orderManagerStub->expects($this->once())->method('saveItem');
137 137
 
138 138
 
139
-		$this->object->store( $orderBaseItem );
139
+		$this->object->store($orderBaseItem);
140 140
 	}
141 141
 
142 142
 
143 143
 	public function testBlock()
144 144
 	{
145 145
 		$name = 'ControllerFrontendOrderBlock';
146
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
146
+		$this->context->getConfig()->set('controller/common/order/name', $name);
147 147
 
148 148
 
149
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
150
-			->setMethods( array( 'block' ) )
151
-			->setConstructorArgs( array( $this->context ) )
149
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
150
+			->setMethods(array('block'))
151
+			->setConstructorArgs(array($this->context))
152 152
 			->getMock();
153 153
 
154
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
154
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
155 155
 
156
-		$orderCntlStub->expects( $this->once() )->method( 'block' );
156
+		$orderCntlStub->expects($this->once())->method('block');
157 157
 
158 158
 
159
-		$this->object->block( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
159
+		$this->object->block(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
160 160
 	}
161 161
 
162 162
 
163 163
 	public function testUnblock()
164 164
 	{
165 165
 		$name = 'ControllerFrontendOrderUnblock';
166
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
166
+		$this->context->getConfig()->set('controller/common/order/name', $name);
167 167
 
168 168
 
169
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
170
-			->setMethods( array( 'unblock' ) )
171
-			->setConstructorArgs( array( $this->context ) )
169
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
170
+			->setMethods(array('unblock'))
171
+			->setConstructorArgs(array($this->context))
172 172
 			->getMock();
173 173
 
174
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
174
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
175 175
 
176
-		$orderCntlStub->expects( $this->once() )->method( 'unblock' );
176
+		$orderCntlStub->expects($this->once())->method('unblock');
177 177
 
178 178
 
179
-		$this->object->unblock( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
179
+		$this->object->unblock(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
180 180
 	}
181 181
 
182 182
 
183 183
 	public function testUpdate()
184 184
 	{
185 185
 		$name = 'ControllerFrontendOrderUpdate';
186
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
186
+		$this->context->getConfig()->set('controller/common/order/name', $name);
187 187
 
188 188
 
189
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
190
-			->setMethods( array( 'update' ) )
191
-			->setConstructorArgs( array( $this->context ) )
189
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
190
+			->setMethods(array('update'))
191
+			->setConstructorArgs(array($this->context))
192 192
 			->getMock();
193 193
 
194
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
194
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
195 195
 
196
-		$orderCntlStub->expects( $this->once() )->method( 'update' );
196
+		$orderCntlStub->expects($this->once())->method('update');
197 197
 
198 198
 
199
-		$this->object->update( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
199
+		$this->object->update(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
200 200
 	}
201 201
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Customer/Standard.php 1 patch
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -28,15 +28,15 @@  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
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
33
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
34 34
 
35 35
 		$item = $manager->createItem();
36
-		$item->fromArray( $values );
37
-		$item->setId( null );
36
+		$item->fromArray($values);
37
+		$item->setId(null);
38 38
 
39
-		return $manager->saveItem( $item );
39
+		return $manager->saveItem($item);
40 40
 	}
41 41
 
42 42
 
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 	 *
46 46
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
47 47
 	 */
48
-	public function createItem( array $values = [] )
48
+	public function createItem(array $values = [])
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
51 51
 
52 52
 		$item = $manager->createItem();
53
-		$item->fromArray( $values );
54
-		$item->setId( null );
55
-		$item->setStatus( 1 );
53
+		$item->fromArray($values);
54
+		$item->setId(null);
55
+		$item->setStatus(1);
56 56
 
57 57
 		return $item;
58 58
 	}
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 	 * @param string $id Unique customer ID
65 65
 	 * @since 2017.04
66 66
 	 */
67
-	public function deleteItem( $id )
67
+	public function deleteItem($id)
68 68
 	{
69
-		$this->checkUser( $id );
69
+		$this->checkUser($id);
70 70
 
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
72
-		$manager->deleteItem( $id );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
72
+		$manager->deleteItem($id);
73 73
 	}
74 74
 
75 75
 
@@ -81,17 +81,17 @@  discard block
 block discarded – undo
81 81
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
82 82
 	 * @since 2017.04
83 83
 	 */
84
-	public function editItem( $id, array $values )
84
+	public function editItem($id, array $values)
85 85
 	{
86
-		$this->checkUser( $id );
86
+		$this->checkUser($id);
87 87
 
88
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
89
-		$item = $manager->getItem( $id, [], true );
88
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
89
+		$item = $manager->getItem($id, [], true);
90 90
 
91
-		unset( $values['customer.id'] );
92
-		$item->fromArray( $values );
91
+		unset($values['customer.id']);
92
+		$item->fromArray($values);
93 93
 
94
-		return $manager->saveItem( $item );
94
+		return $manager->saveItem($item);
95 95
 	}
96 96
 
97 97
 
@@ -103,17 +103,17 @@  discard block
 block discarded – undo
103 103
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
104 104
 	 * @since 2017.04
105 105
 	 */
106
-	public function getItem( $id = null, array $domains = [] )
106
+	public function getItem($id = null, array $domains = [])
107 107
 	{
108
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
108
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
109 109
 
110
-		if( $id == null ) {
111
-			return $manager->getItem( $this->getContext()->getUserId(), $domains, true );
110
+		if ($id == null) {
111
+			return $manager->getItem($this->getContext()->getUserId(), $domains, true);
112 112
 		}
113 113
 
114
-		$this->checkUser( $id );
114
+		$this->checkUser($id);
115 115
 
116
-		return $manager->getItem( $id, $domains, true );
116
+		return $manager->getItem($id, $domains, true);
117 117
 	}
118 118
 
119 119
 
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
128 128
 	 * @since 2017.04
129 129
 	 */
130
-	public function findItem( $code, array $domains = [] )
130
+	public function findItem($code, array $domains = [])
131 131
 	{
132
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' )->findItem( $code, $domains );
132
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer')->findItem($code, $domains);
133 133
 	}
134 134
 
135 135
 
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 	 * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item
140 140
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item including the generated ID
141 141
 	 */
142
-	public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item )
142
+	public function saveItem(\Aimeos\MShop\Customer\Item\Iface $item)
143 143
 	{
144
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' )->saveItem( $item );
144
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer')->saveItem($item);
145 145
 	}
146 146
 
147 147
 
@@ -152,17 +152,17 @@  discard block
 block discarded – undo
152 152
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
153 153
 	 * @since 2017.04
154 154
 	 */
155
-	public function addAddressItem( array $values )
155
+	public function addAddressItem(array $values)
156 156
 	{
157 157
 		$context = $this->getContext();
158
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/address' );
158
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/address');
159 159
 
160 160
 		$item = $manager->createItem();
161
-		$item->fromArray( $values );
162
-		$item->setId( null );
163
-		$item->setParentId( $context->getUserId() );
161
+		$item->fromArray($values);
162
+		$item->setId(null);
163
+		$item->setParentId($context->getUserId());
164 164
 
165
-		return $manager->saveItem( $item );
165
+		return $manager->saveItem($item);
166 166
 	}
167 167
 
168 168
 
@@ -171,16 +171,16 @@  discard block
 block discarded – undo
171 171
 	 *
172 172
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
173 173
 	 */
174
-	public function createAddressItem( array $values = [] )
174
+	public function createAddressItem(array $values = [])
175 175
 	{
176 176
 		$context = $this->getContext();
177
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/address' );
177
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/address');
178 178
 
179 179
 		$item = $manager->createItem();
180
-		$item->fromArray( $values );
181
-		$item->setId( null );
180
+		$item->fromArray($values);
181
+		$item->setId(null);
182 182
 
183
-		$item->setParentId( $context->getUserId() );
183
+		$item->setParentId($context->getUserId());
184 184
 
185 185
 		return $item;
186 186
 	}
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
 	 * @param string $id Unique customer address ID
193 193
 	 * @since 2017.04
194 194
 	 */
195
-	public function deleteAddressItem( $id )
195
+	public function deleteAddressItem($id)
196 196
 	{
197
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
197
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
198 198
 
199
-		$this->checkUser( $manager->getItem( $id, [], true )->getParentId() );
199
+		$this->checkUser($manager->getItem($id, [], true)->getParentId());
200 200
 
201
-		$manager->deleteItem( $id );
201
+		$manager->deleteItem($id);
202 202
 	}
203 203
 
204 204
 
@@ -210,17 +210,17 @@  discard block
 block discarded – undo
210 210
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
211 211
 	 * @since 2017.04
212 212
 	 */
213
-	public function editAddressItem( $id, array $values )
213
+	public function editAddressItem($id, array $values)
214 214
 	{
215
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
215
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
216 216
 
217
-		$item = $manager->getItem( $id, [], true );
218
-		$this->checkUser( $item->getParentId() );
217
+		$item = $manager->getItem($id, [], true);
218
+		$this->checkUser($item->getParentId());
219 219
 
220
-		unset( $values['customer.address.id'] );
221
-		$item->fromArray( $values );
220
+		unset($values['customer.address.id']);
221
+		$item->fromArray($values);
222 222
 
223
-		return $manager->saveItem( $item );
223
+		return $manager->saveItem($item);
224 224
 	}
225 225
 
226 226
 
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
232 232
 	 * @since 2017.04
233 233
 	 */
234
-	public function getAddressItem( $id )
234
+	public function getAddressItem($id)
235 235
 	{
236
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
236
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
237 237
 
238
-		$item = $manager->getItem( $id );
239
-		$this->checkUser( $item->getParentId() );
238
+		$item = $manager->getItem($id);
239
+		$this->checkUser($item->getParentId());
240 240
 
241 241
 		return $item;
242 242
 	}
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
 	 * @param \Aimeos\MShop\Customer\Item\Address\Iface $item Customer address item
249 249
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item including the generated ID
250 250
 	 */
251
-	public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item )
251
+	public function saveAddressItem(\Aimeos\MShop\Customer\Item\Address\Iface $item)
252 252
 	{
253
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' )->saveItem( $item );
253
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address')->saveItem($item);
254 254
 	}
255 255
 
256 256
 
@@ -261,32 +261,32 @@  discard block
 block discarded – undo
261 261
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
262 262
 	 * @since 2017.06
263 263
 	 */
264
-	public function addListItem( array $values )
264
+	public function addListItem(array $values)
265 265
 	{
266 266
 		$context = $this->getContext();
267
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
267
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
268 268
 
269
-		if( !isset( $values['customer.lists.typeid'] ) )
269
+		if (!isset($values['customer.lists.typeid']))
270 270
 		{
271
-			if( !isset( $values['customer.lists.type'] ) ) {
272
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists type code' ) );
271
+			if (!isset($values['customer.lists.type'])) {
272
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists type code'));
273 273
 			}
274 274
 
275
-			if( !isset( $values['customer.lists.domain'] ) ) {
276
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists domain' ) );
275
+			if (!isset($values['customer.lists.domain'])) {
276
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists domain'));
277 277
 			}
278 278
 
279
-			$typeManager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists/type' );
280
-			$typeItem = $typeManager->findItem( $values['customer.lists.type'], [], $values['customer.lists.domain'] );
279
+			$typeManager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists/type');
280
+			$typeItem = $typeManager->findItem($values['customer.lists.type'], [], $values['customer.lists.domain']);
281 281
 			$values['customer.lists.typeid'] = $typeItem->getId();
282 282
 		}
283 283
 
284 284
 		$item = $manager->createItem();
285
-		$item->fromArray( $values );
286
-		$item->setId( null );
287
-		$item->setParentId( $context->getUserId() );
285
+		$item->fromArray($values);
286
+		$item->setId(null);
287
+		$item->setParentId($context->getUserId());
288 288
 
289
-		return $manager->saveItem( $item );
289
+		return $manager->saveItem($item);
290 290
 	}
291 291
 
292 292
 
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
 	public function createListsFilter()
300 300
 	{
301 301
 		$context = $this->getContext();
302
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
302
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
303 303
 
304 304
 		$filter = $manager->createSearch();
305
-		$filter->setConditions( $filter->compare( '==', 'customer.lists.parentid', $context->getUserId() ) );
305
+		$filter->setConditions($filter->compare('==', 'customer.lists.parentid', $context->getUserId()));
306 306
 
307 307
 		return $filter;
308 308
 	}
@@ -314,13 +314,13 @@  discard block
 block discarded – undo
314 314
 	 * @param string $id Unique customer address ID
315 315
 	 * @since 2017.06
316 316
 	 */
317
-	public function deleteListItem( $id )
317
+	public function deleteListItem($id)
318 318
 	{
319
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
319
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
320 320
 
321
-		$this->checkUser( $manager->getItem( $id )->getParentId() );
321
+		$this->checkUser($manager->getItem($id)->getParentId());
322 322
 
323
-		$manager->deleteItem( $id );
323
+		$manager->deleteItem($id);
324 324
 	}
325 325
 
326 326
 
@@ -332,33 +332,33 @@  discard block
 block discarded – undo
332 332
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
333 333
 	 * @since 2017.06
334 334
 	 */
335
-	public function editListItem( $id, array $values )
335
+	public function editListItem($id, array $values)
336 336
 	{
337 337
 		$context = $this->getContext();
338
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
338
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
339 339
 
340
-		$item = $manager->getItem( $id, [], true );
341
-		$this->checkUser( $item->getParentId() );
340
+		$item = $manager->getItem($id, [], true);
341
+		$this->checkUser($item->getParentId());
342 342
 
343
-		if( !isset( $values['customer.lists.typeid'] ) )
343
+		if (!isset($values['customer.lists.typeid']))
344 344
 		{
345
-			if( !isset( $values['customer.lists.type'] ) ) {
346
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists type code' ) );
345
+			if (!isset($values['customer.lists.type'])) {
346
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists type code'));
347 347
 			}
348 348
 
349
-			if( !isset( $values['customer.lists.domain'] ) ) {
350
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists domain' ) );
349
+			if (!isset($values['customer.lists.domain'])) {
350
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists domain'));
351 351
 			}
352 352
 
353
-			$typeManager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists/type' );
354
-			$typeItem = $typeManager->findItem( $values['customer.lists.type'], [], $values['customer.lists.domain'] );
353
+			$typeManager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists/type');
354
+			$typeItem = $typeManager->findItem($values['customer.lists.type'], [], $values['customer.lists.domain']);
355 355
 			$values['customer.lists.typeid'] = $typeItem->getId();
356 356
 		}
357 357
 
358
-		unset( $values['customer.lists.id'] );
359
-		$item->fromArray( $values );
358
+		unset($values['customer.lists.id']);
359
+		$item->fromArray($values);
360 360
 
361
-		return $manager->saveItem( $item );
361
+		return $manager->saveItem($item);
362 362
 	}
363 363
 
364 364
 
@@ -369,12 +369,12 @@  discard block
 block discarded – undo
369 369
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
370 370
 	 * @since 2017.06
371 371
 	 */
372
-	public function getListItem( $id )
372
+	public function getListItem($id)
373 373
 	{
374
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
375
-		$item = $manager->getItem( $id );
374
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
375
+		$item = $manager->getItem($id);
376 376
 
377
-		$this->checkUser( $item->getParentId() );
377
+		$this->checkUser($item->getParentId());
378 378
 
379 379
 		return $item;
380 380
 	}
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface[] Customer list items
389 389
 	 * @since 2017.06
390 390
 	 */
391
-	public function searchListItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
391
+	public function searchListItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
392 392
 	{
393
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
393
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
394 394
 
395
-		return $manager->searchItems( $filter, [], $total );
395
+		return $manager->searchItems($filter, [], $total);
396 396
 	}
397 397
 
398 398
 
@@ -402,12 +402,12 @@  discard block
 block discarded – undo
402 402
 	 * @param string $id Unique customer ID
403 403
 	 * @throws \Aimeos\Controller\Frontend\Customer\Exception If access isn't allowed
404 404
 	 */
405
-	protected function checkUser( $id )
405
+	protected function checkUser($id)
406 406
 	{
407
-		if( $id != $this->getContext()->getUserId() )
407
+		if ($id != $this->getContext()->getUserId())
408 408
 		{
409
-			$msg = sprintf( 'Not allowed to access customer data for ID "%1$s"', $id );
410
-			throw new \Aimeos\Controller\Frontend\Customer\Exception( $msg );
409
+			$msg = sprintf('Not allowed to access customer data for ID "%1$s"', $id);
410
+			throw new \Aimeos\Controller\Frontend\Customer\Exception($msg);
411 411
 		}
412 412
 	}
413 413
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Customer/Iface.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
27 27
 	 * @since 2017.04
28 28
 	 */
29
-	public function addItem( array $values );
29
+	public function addItem(array $values);
30 30
 
31 31
 
32 32
 	/**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
36 36
 	 * @since 2017.04
37 37
 	 */
38
-	public function createItem( array $values = [] );
38
+	public function createItem(array $values = []);
39 39
 
40 40
 
41 41
 	/**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 * @param string $id Unique customer ID
45 45
 	 * @since 2017.04
46 46
 	 */
47
-	public function deleteItem( $id );
47
+	public function deleteItem($id);
48 48
 
49 49
 
50 50
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
56 56
 	 * @since 2017.04
57 57
 	 */
58
-	public function editItem( $id, array $values );
58
+	public function editItem($id, array $values);
59 59
 
60 60
 
61 61
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
67 67
 	 * @since 2017.04
68 68
 	 */
69
-	public function getItem( $id = null, array $domains = [] );
69
+	public function getItem($id = null, array $domains = []);
70 70
 
71 71
 
72 72
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
80 80
 	 * @since 2017.04
81 81
 	 */
82
-	public function findItem( $code, array $domains = [] );
82
+	public function findItem($code, array $domains = []);
83 83
 
84 84
 
85 85
 	/**
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item including the generated ID
90 90
 	 * @since 2017.04
91 91
 	 */
92
-	public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item );
92
+	public function saveItem(\Aimeos\MShop\Customer\Item\Iface $item);
93 93
 
94 94
 
95 95
 	/**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer address item
100 100
 	 * @since 2017.04
101 101
 	 */
102
-	public function addAddressItem( array $values );
102
+	public function addAddressItem(array $values);
103 103
 
104 104
 
105 105
 	/**
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
109 109
 	 * @since 2017.04
110 110
 	 */
111
-	public function createAddressItem( array $values = [] );
111
+	public function createAddressItem(array $values = []);
112 112
 
113 113
 
114 114
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @param string $id Unique customer address ID
118 118
 	 * @since 2017.04
119 119
 	 */
120
-	public function deleteAddressItem( $id );
120
+	public function deleteAddressItem($id);
121 121
 
122 122
 
123 123
 	/**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer address item
129 129
 	 * @since 2017.04
130 130
 	 */
131
-	public function editAddressItem( $id, array $values );
131
+	public function editAddressItem($id, array $values);
132 132
 
133 133
 
134 134
 	/**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
139 139
 	 * @since 2017.04
140 140
 	 */
141
-	public function getAddressItem( $id );
141
+	public function getAddressItem($id);
142 142
 
143 143
 
144 144
 	/**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item including the generated ID
149 149
 	 * @since 2017.04
150 150
 	 */
151
-	public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item );
151
+	public function saveAddressItem(\Aimeos\MShop\Customer\Item\Address\Iface $item);
152 152
 
153 153
 	/**
154 154
 	 * Creates and returns a new list item object
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
158 158
 	 * @since 2017.06
159 159
 	 */
160
-	public function addListItem( array $values );
160
+	public function addListItem(array $values);
161 161
 
162 162
 	/**
163 163
 	 * Returns a new customer lists filter criteria object
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 * @param string $id Unique customer address ID
174 174
 	 * @since 2017.06
175 175
 	 */
176
-	public function deleteListItem( $id );
176
+	public function deleteListItem($id);
177 177
 
178 178
 	/**
179 179
 	 * Saves a modified customer lists item object
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
184 184
 	 * @since 2017.06
185 185
 	 */
186
-	public function editListItem( $id, array $values );
186
+	public function editListItem($id, array $values);
187 187
 
188 188
 	/**
189 189
 	 * Returns the customer item for the given customer ID
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
193 193
 	 * @since 2017.06
194 194
 	 */
195
-	public function getListItem( $id );
195
+	public function getListItem($id);
196 196
 
197 197
 	/**
198 198
 	 * Returns the customer lists items filtered by the given criteria
@@ -202,5 +202,5 @@  discard block
 block discarded – undo
202 202
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface[] Customer list items
203 203
 	 * @since 2017.06
204 204
 	 */
205
-	public function searchListItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null );
205
+	public function searchListItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null);
206 206
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Order/Standard.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 	 * @param string $type Arbitrary order type (max. eight chars)
30 30
 	 * @return \Aimeos\MShop\Order\Item\Iface Created order object
31 31
 	 */
32
-	public function addItem( $baseId, $type )
32
+	public function addItem($baseId, $type)
33 33
 	{
34 34
 		$total = 0;
35 35
 		$context = $this->getContext();
36
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
36
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'order');
37 37
 
38 38
 		/** controller/frontend/order/limit-seconds
39 39
 		 * Order limitation time frame in seconds
@@ -51,24 +51,24 @@  discard block
 block discarded – undo
51 51
 		 * @see controller/frontend/basket/limit-count
52 52
 		 * @see controller/frontend/basket/limit-seconds
53 53
 		 */
54
-		$seconds = $context->getConfig()->get( 'controller/frontend/order/limit-seconds', 300 );
54
+		$seconds = $context->getConfig()->get('controller/frontend/order/limit-seconds', 300);
55 55
 
56 56
 		$search = $manager->createSearch();
57 57
 		$expr = [
58
-			$search->compare( '==', 'order.baseid', $baseId ),
59
-			$search->compare( '>=', 'order.ctime', date( 'Y-m-d H:i:s', time() - $seconds ) ),
58
+			$search->compare('==', 'order.baseid', $baseId),
59
+			$search->compare('>=', 'order.ctime', date('Y-m-d H:i:s', time() - $seconds)),
60 60
 		];
61
-		$search->setConditions( $search->combine( '&&', $expr ) );
62
-		$search->setSlice( 0, 0 );
61
+		$search->setConditions($search->combine('&&', $expr));
62
+		$search->setSlice(0, 0);
63 63
 
64
-		$manager->searchItems( $search, [], $total );
64
+		$manager->searchItems($search, [], $total);
65 65
 
66
-		if( $total > 0 ) {
67
-			throw new \Aimeos\Controller\Frontend\Order\Exception( sprintf( 'The order has already been created' ) );
66
+		if ($total > 0) {
67
+			throw new \Aimeos\Controller\Frontend\Order\Exception(sprintf('The order has already been created'));
68 68
 		}
69 69
 
70
-		$item = $manager->createItem()->setBaseId( $baseId )->setType( $type );
71
-		return $manager->saveItem( $item );
70
+		$item = $manager->createItem()->setBaseId($baseId)->setType($type);
71
+		return $manager->saveItem($item);
72 72
 	}
73 73
 
74 74
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function createFilter()
81 81
 	{
82
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' )->createSearch( true );
82
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'order')->createSearch(true);
83 83
 	}
84 84
 
85 85
 
@@ -90,30 +90,30 @@  discard block
 block discarded – undo
90 90
 	 * @param boolean $default Use default criteria to limit orders
91 91
 	 * @return \Aimeos\MShop\Order\Item\Iface Order object
92 92
 	 */
93
-	public function getItem( $id, $default = true )
93
+	public function getItem($id, $default = true)
94 94
 	{
95 95
 		$context = $this->getContext();
96
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
96
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'order');
97 97
 
98
-		$search = $manager->createSearch( true );
98
+		$search = $manager->createSearch(true);
99 99
 		$expr = [
100
-			$search->compare( '==', 'order.id', $id ),
100
+			$search->compare('==', 'order.id', $id),
101 101
 			$search->getConditions(),
102 102
 		];
103 103
 
104
-		if( $default !== false ) {
105
-			$expr[] = $search->compare( '==', 'order.editor', $context->getEditor() );
104
+		if ($default !== false) {
105
+			$expr[] = $search->compare('==', 'order.editor', $context->getEditor());
106 106
 		}
107 107
 
108
-		$search->setConditions( $search->combine( '&&', $expr ) );
108
+		$search->setConditions($search->combine('&&', $expr));
109 109
 
110
-		$items = $manager->searchItems( $search );
110
+		$items = $manager->searchItems($search);
111 111
 
112
-		if( ( $item = reset( $items ) ) !== false ) {
112
+		if (($item = reset($items)) !== false) {
113 113
 			return $item;
114 114
 		}
115 115
 
116
-		throw new \Aimeos\Controller\Frontend\Order\Exception( sprintf( 'No order item for ID "%1$s" found', $id ) );
116
+		throw new \Aimeos\Controller\Frontend\Order\Exception(sprintf('No order item for ID "%1$s" found', $id));
117 117
 	}
118 118
 
119 119
 
@@ -124,18 +124,18 @@  discard block
 block discarded – undo
124 124
 	 * @param integer|null &$total Variable that will contain the total number of available items
125 125
 	 * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values
126 126
 	 */
127
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
127
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
128 128
 	{
129 129
 		$context = $this->getContext();
130
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
130
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'order');
131 131
 
132 132
 		$expr = [
133 133
 			$filter->getConditions(),
134
-			$filter->compare( '==', 'order.base.customerid', $context->getUserId() ),
134
+			$filter->compare('==', 'order.base.customerid', $context->getUserId()),
135 135
 		];
136
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
136
+		$filter->setConditions($filter->combine('&&', $expr));
137 137
 
138
-		return $manager->searchItems( $filter, [], $total );
138
+		return $manager->searchItems($filter, [], $total);
139 139
 	}
140 140
 
141 141
 
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
 	 *
158 158
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
159 159
 	 */
160
-	public function block( \Aimeos\MShop\Order\Item\Iface $orderItem )
160
+	public function block(\Aimeos\MShop\Order\Item\Iface $orderItem)
161 161
 	{
162
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->block( $orderItem );
162
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->block($orderItem);
163 163
 	}
164 164
 
165 165
 
@@ -181,9 +181,9 @@  discard block
 block discarded – undo
181 181
 	 *
182 182
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
183 183
 	 */
184
-	public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem )
184
+	public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem)
185 185
 	{
186
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->unblock( $orderItem );
186
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->unblock($orderItem);
187 187
 	}
188 188
 
189 189
 
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
 	 *
202 202
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
203 203
 	 */
204
-	public function update( \Aimeos\MShop\Order\Item\Iface $orderItem )
204
+	public function update(\Aimeos\MShop\Order\Item\Iface $orderItem)
205 205
 	{
206
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->update( $orderItem );
206
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->update($orderItem);
207 207
 	}
208 208
 
209 209
 
@@ -218,22 +218,22 @@  discard block
 block discarded – undo
218 218
 	 * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket
219 219
 	 * @deprecated 2017.04 Use store() from basket controller instead
220 220
 	 */
221
-	public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket )
221
+	public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket)
222 222
 	{
223 223
 		$context = $this->getContext();
224 224
 
225
-		$orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
226
-		$orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' );
225
+		$orderManager = \Aimeos\MShop\Factory::createManager($context, 'order');
226
+		$orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base');
227 227
 
228 228
 
229 229
 		$orderBaseManager->begin();
230
-		$orderBaseManager->store( $basket );
230
+		$orderBaseManager->store($basket);
231 231
 		$orderBaseManager->commit();
232 232
 
233 233
 		$orderItem = $orderManager->createItem();
234
-		$orderItem->setBaseId( $basket->getId() );
235
-		$orderItem->setType( \Aimeos\MShop\Order\Item\Base::TYPE_WEB );
234
+		$orderItem->setBaseId($basket->getId());
235
+		$orderItem->setType(\Aimeos\MShop\Order\Item\Base::TYPE_WEB);
236 236
 
237
-		return $orderManager->saveItem( $orderItem );
237
+		return $orderManager->saveItem($orderItem);
238 238
 	}
239 239
 }
Please login to merge, or discard this patch.