Completed
Push — master ( f32c43...c49afe )
by Aimeos
02:42
created
frontend/tests/Controller/Frontend/Service/Decorator/BaseTest.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -20,161 +20,161 @@
 block discarded – undo
20 20
 	{
21 21
 		$this->context = \TestHelperFrontend::getContext();
22 22
 
23
-		$this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Standard' )
23
+		$this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Standard')
24 24
 			->disableOriginalConstructor()
25 25
 			->getMock();
26 26
 
27
-		$this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' )
28
-			->setConstructorArgs( [$this->stub, $this->context] )
27
+		$this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base')
28
+			->setConstructorArgs([$this->stub, $this->context])
29 29
 			->getMockForAbstractClass();
30 30
 	}
31 31
 
32 32
 
33 33
 	protected function tearDown()
34 34
 	{
35
-		unset( $this->context, $this->object, $this->stub );
35
+		unset($this->context, $this->object, $this->stub);
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testConstructException()
40 40
 	{
41
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock();
41
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock();
42 42
 
43
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' );
43
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Exception');
44 44
 
45
-		$this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' )
46
-			->setConstructorArgs( [$stub, $this->context] )
45
+		$this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base')
46
+			->setConstructorArgs([$stub, $this->context])
47 47
 			->getMockForAbstractClass();
48 48
 	}
49 49
 
50 50
 
51 51
 	public function testCall()
52 52
 	{
53
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Standard' )
53
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Standard')
54 54
 			->disableOriginalConstructor()
55
-			->setMethods( ['invalid'] )
55
+			->setMethods(['invalid'])
56 56
 			->getMock();
57 57
 
58
-		$object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' )
59
-			->setConstructorArgs( [$stub, $this->context] )
58
+		$object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base')
59
+			->setConstructorArgs([$stub, $this->context])
60 60
 			->getMockForAbstractClass();
61 61
 
62
-		$stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) );
62
+		$stub->expects($this->once())->method('invalid')->will($this->returnValue(true));
63 63
 
64
-		$this->assertTrue( $object->invalid() );
64
+		$this->assertTrue($object->invalid());
65 65
 	}
66 66
 
67 67
 
68 68
 	public function testCheckAttributes()
69 69
 	{
70
-		$this->stub->expects( $this->once() )->method( 'checkAttributes' )
71
-			->will( $this->returnValue( [] ) );
70
+		$this->stub->expects($this->once())->method('checkAttributes')
71
+			->will($this->returnValue([]));
72 72
 
73
-		$this->assertEquals( [], $this->object->checkAttributes( -1, [] ) );
73
+		$this->assertEquals([], $this->object->checkAttributes( -1, [] ));
74 74
 	}
75 75
 
76 76
 
77 77
 	public function testGetProvider()
78 78
 	{
79
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' );
80
-		$provider = $manager->getProvider( $manager->findItem( 'unitcode', [], 'service', 'delivery' ) );
79
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'service');
80
+		$provider = $manager->getProvider($manager->findItem('unitcode', [], 'service', 'delivery'));
81 81
 
82
-		$this->stub->expects( $this->once() )->method( 'getProvider' )
83
-			->will( $this->returnValue( $provider ) );
82
+		$this->stub->expects($this->once())->method('getProvider')
83
+			->will($this->returnValue($provider));
84 84
 
85
-		$this->assertSame( $provider, $this->object->getProvider( -1 ) );
85
+		$this->assertSame($provider, $this->object->getProvider( -1 ));
86 86
 	}
87 87
 
88 88
 
89 89
 	public function testGetProviders()
90 90
 	{
91
-		$this->stub->expects( $this->once() )->method( 'getProviders' )
92
-			->will( $this->returnValue( [] ) );
91
+		$this->stub->expects($this->once())->method('getProviders')
92
+			->will($this->returnValue([]));
93 93
 
94
-		$this->assertEquals( [], $this->object->getProviders( 'payment' ) );
94
+		$this->assertEquals([], $this->object->getProviders('payment'));
95 95
 	}
96 96
 
97 97
 
98 98
 	public function testProcess()
99 99
 	{
100
-		$item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
100
+		$item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
101 101
 
102
-		$this->stub->expects( $this->once() )->method( 'process' )
103
-			->will( $this->returnValue( new \Aimeos\MShop\Common\Item\Helper\Form\Standard() ) );
102
+		$this->stub->expects($this->once())->method('process')
103
+			->will($this->returnValue(new \Aimeos\MShop\Common\Item\Helper\Form\Standard()));
104 104
 
105
-		$this->assertInstanceOf( 'Aimeos\MShop\Common\Item\Helper\Form\Iface', $this->object->process( $item, -1, [], [] ) );
105
+		$this->assertInstanceOf('Aimeos\MShop\Common\Item\Helper\Form\Iface', $this->object->process($item, -1, [], []));
106 106
 	}
107 107
 
108 108
 
109 109
 	public function testUpdateSync()
110 110
 	{
111
-		$response = $this->getMockBuilder( '\Psr\Http\Message\ResponseInterface' )->getMock();
112
-		$request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock();
113
-		$item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
111
+		$response = $this->getMockBuilder('\Psr\Http\Message\ResponseInterface')->getMock();
112
+		$request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock();
113
+		$item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
114 114
 
115
-		$this->stub->expects( $this->once() )->method( 'updateSync' )
116
-			->will( $this->returnValue( $item ) );
115
+		$this->stub->expects($this->once())->method('updateSync')
116
+			->will($this->returnValue($item));
117 117
 
118
-		$this->assertInstanceOf( 'Aimeos\MShop\Order\Item\Iface', $this->object->updateSync( $request, $response, [] ) );
118
+		$this->assertInstanceOf('Aimeos\MShop\Order\Item\Iface', $this->object->updateSync($request, $response, []));
119 119
 	}
120 120
 
121 121
 
122 122
 	public function testGetServices()
123 123
 	{
124
-		$basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem();
124
+		$basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem();
125 125
 
126
-		$this->stub->expects( $this->once() )->method( 'getServices' )
127
-			->will( $this->returnValue( [] ) );
126
+		$this->stub->expects($this->once())->method('getServices')
127
+			->will($this->returnValue([]));
128 128
 
129
-		$this->assertEquals( [], $this->object->getServices( 'payment', $basket ) );
129
+		$this->assertEquals([], $this->object->getServices('payment', $basket));
130 130
 	}
131 131
 
132 132
 
133 133
 	public function testGetServiceAttributes()
134 134
 	{
135
-		$basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem();
135
+		$basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem();
136 136
 
137
-		$this->stub->expects( $this->once() )->method( 'getServiceAttributes' )
138
-			->will( $this->returnValue( [] ) );
137
+		$this->stub->expects($this->once())->method('getServiceAttributes')
138
+			->will($this->returnValue([]));
139 139
 
140
-		$this->assertEquals( [], $this->object->getServiceAttributes( 'payment', -1, $basket ) );
140
+		$this->assertEquals([], $this->object->getServiceAttributes('payment', -1, $basket));
141 141
 	}
142 142
 
143 143
 
144 144
 	public function testGetServicePrice()
145 145
 	{
146
-		$priceItem = \Aimeos\MShop\Factory::createManager( $this->context, 'price' )->createItem();
147
-		$basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem();
146
+		$priceItem = \Aimeos\MShop\Factory::createManager($this->context, 'price')->createItem();
147
+		$basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem();
148 148
 
149
-		$this->stub->expects( $this->once() )->method( 'getServicePrice' )
150
-			->will( $this->returnValue( $priceItem ) );
149
+		$this->stub->expects($this->once())->method('getServicePrice')
150
+			->will($this->returnValue($priceItem));
151 151
 
152
-		$this->assertInstanceOf( '\Aimeos\MShop\Price\Item\Iface', $this->object->getServicePrice( 'payment', -1, $basket ) );
152
+		$this->assertInstanceOf('\Aimeos\MShop\Price\Item\Iface', $this->object->getServicePrice('payment', -1, $basket));
153 153
 	}
154 154
 
155 155
 
156 156
 	public function testCheckServiceAttributes()
157 157
 	{
158
-		$this->stub->expects( $this->once() )->method( 'checkServiceAttributes' )
159
-			->will( $this->returnValue( [] ) );
158
+		$this->stub->expects($this->once())->method('checkServiceAttributes')
159
+			->will($this->returnValue([]));
160 160
 
161
-		$this->assertEquals( [], $this->object->checkServiceAttributes( 'payment', -1, [] ) );
161
+		$this->assertEquals([], $this->object->checkServiceAttributes('payment', -1, []));
162 162
 	}
163 163
 
164 164
 
165 165
 	public function testGetController()
166 166
 	{
167
-		$result = $this->access( 'getController' )->invokeArgs( $this->object, [] );
167
+		$result = $this->access('getController')->invokeArgs($this->object, []);
168 168
 
169
-		$this->assertSame( $this->stub, $result );
169
+		$this->assertSame($this->stub, $result);
170 170
 	}
171 171
 
172 172
 
173
-	protected function access( $name )
173
+	protected function access($name)
174 174
 	{
175
-		$class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Service\Decorator\Base' );
176
-		$method = $class->getMethod( $name );
177
-		$method->setAccessible( true );
175
+		$class = new \ReflectionClass('\Aimeos\Controller\Frontend\Service\Decorator\Base');
176
+		$method = $class->getMethod($name);
177
+		$method->setAccessible(true);
178 178
 
179 179
 		return $method;
180 180
 	}
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Order/Decorator/Base.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 	 * @param \Aimeos\Controller\Frontend\Iface $controller Controller object
31 31
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects
32 32
 	 */
33
-	public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context )
33
+	public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context)
34 34
 	{
35 35
 		$iface = '\Aimeos\Controller\Frontend\Order\Iface';
36
-		if( !( $controller instanceof $iface ) )
36
+		if (!($controller instanceof $iface))
37 37
 		{
38
-			$msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface );
39
-			throw new \Aimeos\Controller\Frontend\Exception( $msg );
38
+			$msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface);
39
+			throw new \Aimeos\Controller\Frontend\Exception($msg);
40 40
 		}
41 41
 
42 42
 		$this->controller = $controller;
43 43
 
44
-		parent::__construct( $context );
44
+		parent::__construct($context);
45 45
 	}
46 46
 
47 47
 
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	 * @return mixed Returns the value of the called method
54 54
 	 * @throws \Aimeos\Controller\Frontend\Exception If method call failed
55 55
 	 */
56
-	public function __call( $name, array $param )
56
+	public function __call($name, array $param)
57 57
 	{
58
-		return @call_user_func_array( array( $this->controller, $name ), $param );
58
+		return @call_user_func_array(array($this->controller, $name), $param);
59 59
 	}
60 60
 
61 61
 
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
 	 * @param string $type Arbitrary order type (max. eight chars)
67 67
 	 * @return \Aimeos\MShop\Order\Item\Iface Created order object
68 68
 	 */
69
-	public function addItem( $baseId, $type )
69
+	public function addItem($baseId, $type)
70 70
 	{
71
-		return $this->controller->addItem( $baseId, $type );
71
+		return $this->controller->addItem($baseId, $type);
72 72
 	}
73 73
 
74 74
 
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 	 * @param string $id Unique order ID
90 90
 	 * @return \Aimeos\MShop\Order\Item\Iface Order object
91 91
 	 */
92
-	public function getItem( $id )
92
+	public function getItem($id)
93 93
 	{
94
-		return $this->controller->getItem( $id );
94
+		return $this->controller->getItem($id);
95 95
 	}
96 96
 
97 97
 
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 	 * @param integer &$total|null Variable that will contain the total number of available items
103 103
 	 * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values
104 104
 	 */
105
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
105
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
106 106
 	{
107
-		return $this->controller->searchItems( $filter, $total );
107
+		return $this->controller->searchItems($filter, $total);
108 108
 	}
109 109
 
110 110
 
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
128 128
 	 * @return void
129 129
 	 */
130
-	public function block( \Aimeos\MShop\Order\Item\Iface $orderItem )
130
+	public function block(\Aimeos\MShop\Order\Item\Iface $orderItem)
131 131
 	{
132
-		$this->getController()->block( $orderItem );
132
+		$this->getController()->block($orderItem);
133 133
 	}
134 134
 
135 135
 
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
153 153
 	 * @return void
154 154
 	 */
155
-	public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem )
155
+	public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem)
156 156
 	{
157
-		$this->getController()->unblock( $orderItem );
157
+		$this->getController()->unblock($orderItem);
158 158
 	}
159 159
 
160 160
 
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
174 174
 	 * @return void
175 175
 	 */
176
-	public function update( \Aimeos\MShop\Order\Item\Iface $orderItem )
176
+	public function update(\Aimeos\MShop\Order\Item\Iface $orderItem)
177 177
 	{
178
-		$this->getController()->update( $orderItem );
178
+		$this->getController()->update($orderItem);
179 179
 	}
180 180
 
181 181
 
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 	 * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket
191 191
 	 * @deprecated 2017.04 Use store() from basket controller instead
192 192
 	 */
193
-	public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket )
193
+	public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket)
194 194
 	{
195
-		return $this->getController()->store( $basket );
195
+		return $this->getController()->store($basket);
196 196
 	}
197 197
 
198 198
 
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Order/Iface.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @param string $type Arbitrary order type (max. eight chars)
28 28
 	 * @return \Aimeos\MShop\Order\Item\Iface Created order object
29 29
 	 */
30
-	public function addItem( $baseId, $type );
30
+	public function addItem($baseId, $type);
31 31
 
32 32
 
33 33
 	/**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 * @param string $id Unique order ID
45 45
 	 * @return \Aimeos\MShop\Order\Item\Iface Order object
46 46
 	 */
47
-	public function getItem( $id );
47
+	public function getItem($id);
48 48
 
49 49
 
50 50
 	/**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * @param integer &$total|null Variable that will contain the total number of available items
55 55
 	 * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values
56 56
 	 */
57
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null );
57
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null);
58 58
 
59 59
 
60 60
 	/**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
77 77
 	 * @return void
78 78
 	 */
79
-	public function block( \Aimeos\MShop\Order\Item\Iface $orderItem );
79
+	public function block(\Aimeos\MShop\Order\Item\Iface $orderItem);
80 80
 
81 81
 
82 82
 	/**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
99 99
 	 * @return void
100 100
 	 */
101
-	public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem );
101
+	public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem);
102 102
 
103 103
 
104 104
 	/**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
117 117
 	 * @return void
118 118
 	 */
119
-	public function update( \Aimeos\MShop\Order\Item\Iface $orderItem );
119
+	public function update(\Aimeos\MShop\Order\Item\Iface $orderItem);
120 120
 
121 121
 
122 122
 	/**
@@ -130,5 +130,5 @@  discard block
 block discarded – undo
130 130
 	 * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket
131 131
 	 * @deprecated 2017.04 Use store() from basket controller instead
132 132
 	 */
133
-	public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket );
133
+	public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket);
134 134
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Order/Decorator/BaseTest.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -20,136 +20,136 @@
 block discarded – undo
20 20
 	{
21 21
 		$this->context = \TestHelperFrontend::getContext();
22 22
 
23
-		$this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Standard' )
23
+		$this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Standard')
24 24
 			->disableOriginalConstructor()
25 25
 			->getMock();
26 26
 
27
-		$this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' )
28
-			->setConstructorArgs( [$this->stub, $this->context] )
27
+		$this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base')
28
+			->setConstructorArgs([$this->stub, $this->context])
29 29
 			->getMockForAbstractClass();
30 30
 	}
31 31
 
32 32
 
33 33
 	protected function tearDown()
34 34
 	{
35
-		unset( $this->context, $this->object, $this->stub );
35
+		unset($this->context, $this->object, $this->stub);
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testConstructException()
40 40
 	{
41
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock();
41
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock();
42 42
 
43
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' );
43
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Exception');
44 44
 
45
-		$this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' )
46
-			->setConstructorArgs( [$stub, $this->context] )
45
+		$this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base')
46
+			->setConstructorArgs([$stub, $this->context])
47 47
 			->getMockForAbstractClass();
48 48
 	}
49 49
 
50 50
 
51 51
 	public function testCall()
52 52
 	{
53
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Standard' )
53
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Standard')
54 54
 			->disableOriginalConstructor()
55
-			->setMethods( ['invalid'] )
55
+			->setMethods(['invalid'])
56 56
 			->getMock();
57 57
 
58
-		$object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' )
59
-			->setConstructorArgs( [$stub, $this->context] )
58
+		$object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base')
59
+			->setConstructorArgs([$stub, $this->context])
60 60
 			->getMockForAbstractClass();
61 61
 
62
-		$stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) );
62
+		$stub->expects($this->once())->method('invalid')->will($this->returnValue(true));
63 63
 
64
-		$this->assertTrue( $object->invalid() );
64
+		$this->assertTrue($object->invalid());
65 65
 	}
66 66
 
67 67
 
68 68
 	public function testAddItem()
69 69
 	{
70
-		$item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
70
+		$item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
71 71
 
72
-		$this->stub->expects( $this->once() )->method( 'addItem' )->will( $this->returnValue( $item ) );
72
+		$this->stub->expects($this->once())->method('addItem')->will($this->returnValue($item));
73 73
 
74
-		$this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, '' ) );
74
+		$this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, '' ));
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testCreateFilter()
79 79
 	{
80
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createSearch();
80
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createSearch();
81 81
 
82
-		$this->stub->expects( $this->once() )->method( 'createFilter' )->will( $this->returnValue( $search ) );
82
+		$this->stub->expects($this->once())->method('createFilter')->will($this->returnValue($search));
83 83
 
84
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() );
84
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter());
85 85
 	}
86 86
 
87 87
 
88 88
 	public function testGetItem()
89 89
 	{
90
-		$item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
90
+		$item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
91 91
 
92
-		$this->stub->expects( $this->once() )->method( 'getItem' )->will( $this->returnValue( $item ) );
92
+		$this->stub->expects($this->once())->method('getItem')->will($this->returnValue($item));
93 93
 
94
-		$this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( -1 ) );
94
+		$this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( -1 ));
95 95
 	}
96 96
 
97 97
 
98 98
 	public function testSearchItems()
99 99
 	{
100
-		$search = $this->getMockBuilder( '\Aimeos\MW\Criteria\Iface' )->getMock();
100
+		$search = $this->getMockBuilder('\Aimeos\MW\Criteria\Iface')->getMock();
101 101
 
102
-		$this->stub->expects( $this->once() )->method( 'searchItems' )->will( $this->returnValue( [] ) );
102
+		$this->stub->expects($this->once())->method('searchItems')->will($this->returnValue([]));
103 103
 
104
-		$this->assertEquals( [], $this->object->searchItems( $search ) );
104
+		$this->assertEquals([], $this->object->searchItems($search));
105 105
 	}
106 106
 
107 107
 
108 108
 	public function testUnblock()
109 109
 	{
110
-		$orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
110
+		$orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
111 111
 
112
-		$this->stub->expects( $this->once() )->method( 'unblock' );
112
+		$this->stub->expects($this->once())->method('unblock');
113 113
 
114
-		$this->object->unblock( $orderItem );
114
+		$this->object->unblock($orderItem);
115 115
 	}
116 116
 
117 117
 
118 118
 	public function testUpdate()
119 119
 	{
120
-		$orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
120
+		$orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
121 121
 
122
-		$this->stub->expects( $this->once() )->method( 'update' );
122
+		$this->stub->expects($this->once())->method('update');
123 123
 
124
-		$this->object->update( $orderItem );
124
+		$this->object->update($orderItem);
125 125
 	}
126 126
 
127 127
 
128 128
 	public function testStore()
129 129
 	{
130
-		$orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
131
-		$basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem();
130
+		$orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
131
+		$basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem();
132 132
 
133
-		$this->stub->expects( $this->once() )->method( 'store' )
134
-			->will( $this->returnValue( $orderItem ) );
133
+		$this->stub->expects($this->once())->method('store')
134
+			->will($this->returnValue($orderItem));
135 135
 
136
-		$this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->store( $basket ) );
136
+		$this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->store($basket));
137 137
 	}
138 138
 
139 139
 
140 140
 	public function testGetController()
141 141
 	{
142
-		$result = $this->access( 'getController' )->invokeArgs( $this->object, [] );
142
+		$result = $this->access('getController')->invokeArgs($this->object, []);
143 143
 
144
-		$this->assertSame( $this->stub, $result );
144
+		$this->assertSame($this->stub, $result);
145 145
 	}
146 146
 
147 147
 
148
-	protected function access( $name )
148
+	protected function access($name)
149 149
 	{
150
-		$class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Order\Decorator\Base' );
151
-		$method = $class->getMethod( $name );
152
-		$method->setAccessible( true );
150
+		$class = new \ReflectionClass('\Aimeos\Controller\Frontend\Order\Decorator\Base');
151
+		$method = $class->getMethod($name);
152
+		$method->setAccessible(true);
153 153
 
154 154
 		return $method;
155 155
 	}
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Service/Standard.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 	 * @param string[] $attributes List of attribute codes as keys and strings entered by the customer as value
36 36
 	 * @return string[] List of attributes codes as keys and error messages as values for invalid or missing values
37 37
 	 */
38
-	public function checkAttributes( $serviceId, array $attributes )
38
+	public function checkAttributes($serviceId, array $attributes)
39 39
 	{
40
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
41
-		$provider = $manager->getProvider( $manager->getItem( $serviceId, [], true ) );
40
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
41
+		$provider = $manager->getProvider($manager->getItem($serviceId, [], true));
42 42
 
43
-		return array_filter( $provider->checkConfigFE( $attributes ) );
43
+		return array_filter($provider->checkConfigFE($attributes));
44 44
 	}
45 45
 
46 46
 
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 	 * @param string[] $ref List of domain names whose items should be fetched too
52 52
 	 * @return \Aimeos\MShop\Service\Provider\Iface Service provider object
53 53
 	 */
54
-	public function getProvider( $serviceId, $ref = ['media', 'price', 'text'] )
54
+	public function getProvider($serviceId, $ref = ['media', 'price', 'text'])
55 55
 	{
56
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
57
-		return $manager->getProvider( $manager->getItem( $serviceId, $ref, true ) );
56
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
57
+		return $manager->getProvider($manager->getItem($serviceId, $ref, true));
58 58
 	}
59 59
 
60 60
 
@@ -65,26 +65,26 @@  discard block
 block discarded – undo
65 65
 	 * @param string[] $ref List of domain names whose items should be fetched too
66 66
 	 * @return \Aimeos\MShop\Service\Provider\Iface[] List of service IDs as keys and service provider objects as values
67 67
 	 */
68
-	public function getProviders( $type = null, $ref = ['media', 'price', 'text'] )
68
+	public function getProviders($type = null, $ref = ['media', 'price', 'text'])
69 69
 	{
70 70
 		$list = [];
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
72 72
 
73
-		$search = $manager->createSearch( true );
74
-		$search->setSortations( array( $search->sort( '+', 'service.position' ) ) );
73
+		$search = $manager->createSearch(true);
74
+		$search->setSortations(array($search->sort('+', 'service.position')));
75 75
 
76
-		if( $type != null )
76
+		if ($type != null)
77 77
 		{
78 78
 			$expr = array(
79 79
 				$search->getConditions(),
80
-				$search->compare( '==', 'service.type.code', $type ),
81
-				$search->compare( '==', 'service.type.domain', 'service' ),
80
+				$search->compare('==', 'service.type.code', $type),
81
+				$search->compare('==', 'service.type.domain', 'service'),
82 82
 			);
83
-			$search->setConditions( $search->combine( '&&', $expr ) );
83
+			$search->setConditions($search->combine('&&', $expr));
84 84
 		}
85 85
 
86
-		foreach( $manager->searchItems( $search, $ref ) as $id => $item ) {
87
-			$list[$id] = $manager->getProvider( $item );
86
+		foreach ($manager->searchItems($search, $ref) as $id => $item) {
87
+			$list[$id] = $manager->getProvider($item);
88 88
 		}
89 89
 
90 90
 		return $list;
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
 	 * @return \Aimeos\MShop\Common\Item\Helper\Form\Iface|null Form object with URL, parameters, etc.
103 103
 	 * 	or null if no form data is required
104 104
 	 */
105
-	public function process( \Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params )
105
+	public function process(\Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params)
106 106
 	{
107
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
107
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
108 108
 
109
-		$provider = $manager->getProvider( $manager->getItem( $serviceId, [], true ) );
110
-		$provider->injectGlobalConfigBE( $urls );
109
+		$provider = $manager->getProvider($manager->getItem($serviceId, [], true));
110
+		$provider->injectGlobalConfigBE($urls);
111 111
 
112
-		return $provider->process( $orderItem, $params );
112
+		return $provider->process($orderItem, $params);
113 113
 	}
114 114
 
115 115
 
@@ -122,35 +122,35 @@  discard block
 block discarded – undo
122 122
 	 * 	(keys are <type>.url-self, <type>.url-success, <type>.url-update where type can be "delivery" or "payment")
123 123
 	 * @return \Aimeos\MShop\Order\Item\Iface $orderItem Order item that has been updated
124 124
 	 */
125
-	public function updateSync( ServerRequestInterface $request, ResponseInterface $response, array $urls )
125
+	public function updateSync(ServerRequestInterface $request, ResponseInterface $response, array $urls)
126 126
 	{
127 127
 		$queryParams = $request->getQueryParams();
128 128
 
129
-		if( !isset( $queryParams['code'] ) ) {
129
+		if (!isset($queryParams['code'])) {
130 130
 			return;
131 131
 		}
132 132
 
133 133
 		$context = $this->getContext();
134
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
134
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'service');
135 135
 
136
-		$provider = $manager->getProvider( $manager->findItem( $queryParams['code'] ) );
137
-		$provider->injectGlobalConfigBE( $urls );
136
+		$provider = $manager->getProvider($manager->findItem($queryParams['code']));
137
+		$provider->injectGlobalConfigBE($urls);
138 138
 
139
-		$params = array_merge( $queryParams, (array) $request->getParsedBody() );
139
+		$params = array_merge($queryParams, (array) $request->getParsedBody());
140 140
 		$body = (string) $request->getBody();
141 141
 		$response = null;
142 142
 		$headers = [];
143 143
 
144
-		if( ( $orderItem = $provider->updateSync( $params, $body, $response, $headers ) ) !== null )
144
+		if (($orderItem = $provider->updateSync($params, $body, $response, $headers)) !== null)
145 145
 		{
146
-			if( $orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED
147
-				&& $provider->isImplemented( \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY )
146
+			if ($orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED
147
+				&& $provider->isImplemented(\Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY)
148 148
 			) {
149
-				$provider->query( $orderItem );
149
+				$provider->query($orderItem);
150 150
 			}
151 151
 
152 152
 			// update stock, coupons, etc.
153
-			\Aimeos\Controller\Frontend\Factory::createController( $context, 'order' )->update( $orderItem );
153
+			\Aimeos\Controller\Frontend\Factory::createController($context, 'order')->update($orderItem);
154 154
 		}
155 155
 
156 156
 		return $orderItem;
@@ -167,38 +167,38 @@  discard block
 block discarded – undo
167 167
 	 * @throws \Exception If an error occurs
168 168
 	 * @deprecated Use getProviders() instead
169 169
 	 */
170
-	public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket, $ref = ['media', 'price', 'text'] )
170
+	public function getServices($type, \Aimeos\MShop\Order\Item\Base\Iface $basket, $ref = ['media', 'price', 'text'])
171 171
 	{
172
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
172
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
173 173
 
174
-		$search = $serviceManager->createSearch( true );
174
+		$search = $serviceManager->createSearch(true);
175 175
 		$expr = array(
176 176
 			$search->getConditions(),
177
-			$search->compare( '==', 'service.type.domain', 'service' ),
178
-			$search->compare( '==', 'service.type.code', $type ),
177
+			$search->compare('==', 'service.type.domain', 'service'),
178
+			$search->compare('==', 'service.type.code', $type),
179 179
 		);
180
-		$search->setConditions( $search->combine( '&&', $expr ) );
181
-		$search->setSortations( array( $search->sort( '+', 'service.position' ) ) );
180
+		$search->setConditions($search->combine('&&', $expr));
181
+		$search->setSortations(array($search->sort('+', 'service.position')));
182 182
 
183
-		$items = $serviceManager->searchItems( $search, $ref );
183
+		$items = $serviceManager->searchItems($search, $ref);
184 184
 
185 185
 
186
-		foreach( $items as $id => $service )
186
+		foreach ($items as $id => $service)
187 187
 		{
188 188
 			try
189 189
 			{
190
-				$provider = $serviceManager->getProvider( $service );
190
+				$provider = $serviceManager->getProvider($service);
191 191
 
192
-				if( $provider->isAvailable( $basket ) ) {
192
+				if ($provider->isAvailable($basket)) {
193 193
 					$this->providers[$type][$id] = $provider;
194 194
 				} else {
195
-					unset( $items[$id] );
195
+					unset($items[$id]);
196 196
 				}
197 197
 			}
198
-			catch( \Aimeos\MShop\Service\Exception $e )
198
+			catch (\Aimeos\MShop\Service\Exception $e)
199 199
 			{
200
-				$msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id );
201
-				$this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::WARN );
200
+				$msg = sprintf('Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id);
201
+				$this->getContext()->getLogger()->log($msg, \Aimeos\MW\Logger\Base::WARN);
202 202
 			}
203 203
 		}
204 204
 
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
 	 * @throws \Exception If an error occurs
220 220
 	 * @deprecated Use getProvider() instead
221 221
 	 */
222
-	public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket )
222
+	public function getServiceAttributes($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket)
223 223
 	{
224
-		if( isset( $this->providers[$type][$serviceId] ) ) {
225
-			return $this->providers[$type][$serviceId]->getConfigFE( $basket );
224
+		if (isset($this->providers[$type][$serviceId])) {
225
+			return $this->providers[$type][$serviceId]->getConfigFE($basket);
226 226
 		}
227 227
 
228
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
229
-		$item = $serviceManager->getItem( $serviceId, ['price'], true );
228
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
229
+		$item = $serviceManager->getItem($serviceId, ['price'], true);
230 230
 
231
-		return $serviceManager->getProvider( $item )->getConfigFE( $basket );
231
+		return $serviceManager->getProvider($item)->getConfigFE($basket);
232 232
 	}
233 233
 
234 234
 
@@ -244,16 +244,16 @@  discard block
 block discarded – undo
244 244
 	 * @throws \Exception If an error occurs
245 245
 	 * @deprecated Use getProvider() instead
246 246
 	 */
247
-	public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket )
247
+	public function getServicePrice($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket)
248 248
 	{
249
-		if( isset( $this->providers[$type][$serviceId] ) ) {
250
-			return $this->providers[$type][$serviceId]->calcPrice( $basket );
249
+		if (isset($this->providers[$type][$serviceId])) {
250
+			return $this->providers[$type][$serviceId]->calcPrice($basket);
251 251
 		}
252 252
 
253
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
254
-		$item = $serviceManager->getItem( $serviceId, ['price'], true );
253
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
254
+		$item = $serviceManager->getItem($serviceId, ['price'], true);
255 255
 
256
-		return $serviceManager->getProvider( $item )->calcPrice( $basket );
256
+		return $serviceManager->getProvider($item)->calcPrice($basket);
257 257
 	}
258 258
 
259 259
 
@@ -269,22 +269,22 @@  discard block
 block discarded – undo
269 269
 	 * @throws \Aimeos\Controller\Frontend\Service\Exception If no active service provider for this ID is available
270 270
 	 * @deprecated Use checkAttributes() instead
271 271
 	 */
272
-	public function checkServiceAttributes( $type, $serviceId, array $attributes )
272
+	public function checkServiceAttributes($type, $serviceId, array $attributes)
273 273
 	{
274
-		if( !isset( $this->providers[$type][$serviceId] ) )
274
+		if (!isset($this->providers[$type][$serviceId]))
275 275
 		{
276
-			$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
277
-			$item = $serviceManager->getItem( $serviceId, ['price'], true );
276
+			$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
277
+			$item = $serviceManager->getItem($serviceId, ['price'], true);
278 278
 
279
-			$this->providers[$type][$serviceId] = $serviceManager->getProvider( $item );
279
+			$this->providers[$type][$serviceId] = $serviceManager->getProvider($item);
280 280
 		}
281 281
 
282
-		$errors = $this->providers[$type][$serviceId]->checkConfigFE( $attributes );
282
+		$errors = $this->providers[$type][$serviceId]->checkConfigFE($attributes);
283 283
 
284
-		foreach( $errors as $key => $msg )
284
+		foreach ($errors as $key => $msg)
285 285
 		{
286
-			if( $msg === null ) {
287
-				unset( $errors[$key] );
286
+			if ($msg === null) {
287
+				unset($errors[$key]);
288 288
 			}
289 289
 		}
290 290
 
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Service/Iface.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string[] $attributes List of attribute codes as keys and strings entered by the customer as value
31 31
 	 * @return string[] List of attributes codes as keys and error messages as values for invalid or missing values
32 32
 	 */
33
-	public function checkAttributes( $serviceId, array $attributes );
33
+	public function checkAttributes($serviceId, array $attributes);
34 34
 
35 35
 	/**
36 36
 	 * Returns the service item for the given ID
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 * @param array $ref List of domains for which the items referenced by the services should be fetched too
40 40
 	 * @return \Aimeos\MShop\Service\Provider\Iface Service provider object
41 41
 	 */
42
-	public function getProvider( $serviceId, $ref = ['media', 'price', 'text'] );
42
+	public function getProvider($serviceId, $ref = ['media', 'price', 'text']);
43 43
 
44 44
 	/**
45 45
 	 * Returns the service providers for the given type
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * @param array $ref List of domains for which the items referenced by the services should be fetched too
49 49
 	 * @return \Aimeos\MShop\Service\Provider\Iface[] List of service IDs as keys and service provider objects as values
50 50
 	 */
51
-	public function getProviders( $type = null, $ref = ['media', 'price', 'text'] );
51
+	public function getProviders($type = null, $ref = ['media', 'price', 'text']);
52 52
 
53 53
 	/**
54 54
 	 * Processes the service for the given order, e.g. payment and delivery services
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 * @return \Aimeos\MShop\Common\Item\Helper\Form\Iface|null Form object with URL, parameters, etc.
62 62
 	 * 	or null if no form data is required
63 63
 	 */
64
-	public function process( \Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params );
64
+	public function process(\Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params);
65 65
 
66 66
 	/**
67 67
 	 * Updates the payment or delivery status for the given request
@@ -72,5 +72,5 @@  discard block
 block discarded – undo
72 72
 	 * 	(keys are <type>.url-self, <type>.url-success, <type>.url-update where type can be "delivery" or "payment")
73 73
 	 * @return \Aimeos\MShop\Order\Item\Iface $orderItem Order item that has been updated
74 74
 	 */
75
-	public function updateSync( ServerRequestInterface $request, ResponseInterface $response, array $urls );
75
+	public function updateSync(ServerRequestInterface $request, ResponseInterface $response, array $urls);
76 76
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Service/Decorator/Base.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
 	 * @param \Aimeos\Controller\Frontend\Iface $controller Controller object
34 34
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects
35 35
 	 */
36
-	public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context )
36
+	public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context)
37 37
 	{
38 38
 		$iface = '\Aimeos\Controller\Frontend\Service\Iface';
39
-		if( !( $controller instanceof $iface ) )
39
+		if (!($controller instanceof $iface))
40 40
 		{
41
-			$msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface );
42
-			throw new \Aimeos\Controller\Frontend\Exception( $msg );
41
+			$msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface);
42
+			throw new \Aimeos\Controller\Frontend\Exception($msg);
43 43
 		}
44 44
 
45 45
 		$this->controller = $controller;
46 46
 
47
-		parent::__construct( $context );
47
+		parent::__construct($context);
48 48
 	}
49 49
 
50 50
 
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 	 * @return mixed Returns the value of the called method
57 57
 	 * @throws \Aimeos\Controller\Frontend\Exception If method call failed
58 58
 	 */
59
-	public function __call( $name, array $param )
59
+	public function __call($name, array $param)
60 60
 	{
61
-		return @call_user_func_array( array( $this->controller, $name ), $param );
61
+		return @call_user_func_array(array($this->controller, $name), $param);
62 62
 	}
63 63
 
64 64
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 * @param string[] $attributes List of attribute codes as keys and strings entered by the customer as value
70 70
 	 * @return string[] List of attributes codes as keys and error messages as values for invalid or missing values
71 71
 	 */
72
-	public function checkAttributes( $serviceId, array $attributes )
72
+	public function checkAttributes($serviceId, array $attributes)
73 73
 	{
74
-		return $this->controller->checkAttributes( $serviceId, $attributes );
74
+		return $this->controller->checkAttributes($serviceId, $attributes);
75 75
 	}
76 76
 
77 77
 
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 	 * @param array $ref List of domains for which the items referenced by the services should be fetched too
83 83
 	 * @return \Aimeos\MShop\Service\Provider\Iface Service provider object
84 84
 	 */
85
-	public function getProvider( $serviceId, $ref = ['media', 'price', 'text'] )
85
+	public function getProvider($serviceId, $ref = ['media', 'price', 'text'])
86 86
 	{
87
-		return $this->controller->getProvider( $serviceId, $ref );
87
+		return $this->controller->getProvider($serviceId, $ref);
88 88
 	}
89 89
 
90 90
 
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	 * @param array $ref List of domains for which the items referenced by the services should be fetched too
96 96
 	 * @return \Aimeos\MShop\Service\Provider\Iface[] List of service IDs as keys and service provider objects as values
97 97
 	 */
98
-	public function getProviders( $type = null, $ref = ['media', 'price', 'text'] )
98
+	public function getProviders($type = null, $ref = ['media', 'price', 'text'])
99 99
 	{
100
-		return $this->controller->getProviders( $type, $ref );
100
+		return $this->controller->getProviders($type, $ref);
101 101
 	}
102 102
 
103 103
 
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 	 * @return \Aimeos\MShop\Common\Item\Helper\Form\Iface|null Form object with URL, parameters, etc.
113 113
 	 * 	or null if no form data is required
114 114
 	 */
115
-	public function process( \Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params )
115
+	public function process(\Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params)
116 116
 	{
117
-		return $this->controller->process( $orderItem, $serviceId, $urls, $params );
117
+		return $this->controller->process($orderItem, $serviceId, $urls, $params);
118 118
 	}
119 119
 
120 120
 
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 	 * 	(keys are <type>.url-self, <type>.url-success, <type>.url-update where type can be "delivery" or "payment")
128 128
 	 * @return \Aimeos\MShop\Order\Item\Iface $orderItem Order item that has been updated
129 129
 	 */
130
-	public function updateSync( ServerRequestInterface $request, ResponseInterface $response, array $urls )
130
+	public function updateSync(ServerRequestInterface $request, ResponseInterface $response, array $urls)
131 131
 	{
132
-		return $this->controller->updateSync( $request, $response, $urls );
132
+		return $this->controller->updateSync($request, $response, $urls);
133 133
 	}
134 134
 
135 135
 
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
 	 * @return array List of service items implementing \Aimeos\MShop\Service\Item\Iface with referenced items
143 143
 	 * @deprecated Use getProviders() instead
144 144
 	 */
145
-	public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket,
146
-		$ref = array( 'media', 'price', 'text' ) )
145
+	public function getServices($type, \Aimeos\MShop\Order\Item\Base\Iface $basket,
146
+		$ref = array('media', 'price', 'text'))
147 147
 	{
148
-		return $this->controller->getServices( $type, $basket, $ref );
148
+		return $this->controller->getServices($type, $basket, $ref);
149 149
 	}
150 150
 
151 151
 
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
 	 * @return array List of attribute definitions implementing \Aimeos\MW\Criteria\Attribute\Iface
160 160
 	 * @deprecated Use getProvider() instead
161 161
 	 */
162
-	public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket )
162
+	public function getServiceAttributes($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket)
163 163
 	{
164
-		return $this->controller->getServiceAttributes( $type, $serviceId, $basket );
164
+		return $this->controller->getServiceAttributes($type, $serviceId, $basket);
165 165
 	}
166 166
 
167 167
 
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 	 * @throws \Exception If an error occurs
178 178
 	 * @deprecated Use getProvider() instead
179 179
 	 */
180
-	public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket )
180
+	public function getServicePrice($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket)
181 181
 	{
182
-		return $this->controller->getServicePrice( $type, $serviceId, $basket );
182
+		return $this->controller->getServicePrice($type, $serviceId, $basket);
183 183
 	}
184 184
 
185 185
 
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
 	 * 	missing
195 195
 	 * @deprecated Use checkAttributes() instead
196 196
 	 */
197
-	public function checkServiceAttributes( $type, $serviceId, array $attributes )
197
+	public function checkServiceAttributes($type, $serviceId, array $attributes)
198 198
 	{
199
-		return $this->controller->checkServiceAttributes( $type, $serviceId, $attributes );
199
+		return $this->controller->checkServiceAttributes($type, $serviceId, $attributes);
200 200
 	}
201 201
 
202 202
 
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Order/Standard.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@  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
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' );
34
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order');
35 35
 
36
-		$item = $manager->createItem()->setBaseId( $baseId )->setType( $type );
37
-		$manager->saveItem( $item );
36
+		$item = $manager->createItem()->setBaseId($baseId)->setType($type);
37
+		$manager->saveItem($item);
38 38
 
39 39
 		return $item;
40 40
 	}
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function createFilter()
49 49
 	{
50
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' )->createSearch( true );
50
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'order')->createSearch(true);
51 51
 	}
52 52
 
53 53
 
@@ -57,26 +57,26 @@  discard block
 block discarded – undo
57 57
 	 * @param string $id Unique order ID
58 58
 	 * @return \Aimeos\MShop\Order\Item\Iface Order object
59 59
 	 */
60
-	public function getItem( $id )
60
+	public function getItem($id)
61 61
 	{
62 62
 		$context = $this->getContext();
63
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
63
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'order');
64 64
 
65
-		$search = $manager->createSearch( true );
65
+		$search = $manager->createSearch(true);
66 66
 		$expr = [
67
-			$search->compare( '==', 'order.id', $id ),
68
-			$search->compare( '==', 'order.base.customerid', $context->getUserId() ),
67
+			$search->compare('==', 'order.id', $id),
68
+			$search->compare('==', 'order.base.customerid', $context->getUserId()),
69 69
 			$search->getConditions(),
70 70
 		];
71
-		$search->setConditions( $search->combine( '&&', $expr ) );
71
+		$search->setConditions($search->combine('&&', $expr));
72 72
 
73
-		$items = $manager->searchItems( $search );
73
+		$items = $manager->searchItems($search);
74 74
 
75
-		if( ( $item = reset( $items ) ) !== false ) {
75
+		if (($item = reset($items)) !== false) {
76 76
 			return $item;
77 77
 		}
78 78
 
79
-		throw new \Aimeos\Controller\Frontend\Order\Exception( sprintf( 'No order item for ID "%1$s" found', $id ) );
79
+		throw new \Aimeos\Controller\Frontend\Order\Exception(sprintf('No order item for ID "%1$s" found', $id));
80 80
 	}
81 81
 
82 82
 
@@ -87,18 +87,18 @@  discard block
 block discarded – undo
87 87
 	 * @param integer|null &$total Variable that will contain the total number of available items
88 88
 	 * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values
89 89
 	 */
90
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
90
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
91 91
 	{
92 92
 		$context = $this->getContext();
93
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
93
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'order');
94 94
 
95 95
 		$expr = [
96 96
 			$filter->getConditions(),
97
-			$filter->compare( '==', 'order.base.customerid', $context->getUserId() ),
97
+			$filter->compare('==', 'order.base.customerid', $context->getUserId()),
98 98
 		];
99
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
99
+		$filter->setConditions($filter->combine('&&', $expr));
100 100
 
101
-		return $manager->searchItems( $filter, [], $total );
101
+		return $manager->searchItems($filter, [], $total);
102 102
 	}
103 103
 
104 104
 
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 	 *
121 121
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
122 122
 	 */
123
-	public function block( \Aimeos\MShop\Order\Item\Iface $orderItem )
123
+	public function block(\Aimeos\MShop\Order\Item\Iface $orderItem)
124 124
 	{
125
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->block( $orderItem );
125
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->block($orderItem);
126 126
 	}
127 127
 
128 128
 
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 	 *
145 145
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
146 146
 	 */
147
-	public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem )
147
+	public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem)
148 148
 	{
149
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->unblock( $orderItem );
149
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->unblock($orderItem);
150 150
 	}
151 151
 
152 152
 
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 	 *
165 165
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
166 166
 	 */
167
-	public function update( \Aimeos\MShop\Order\Item\Iface $orderItem )
167
+	public function update(\Aimeos\MShop\Order\Item\Iface $orderItem)
168 168
 	{
169
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->update( $orderItem );
169
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->update($orderItem);
170 170
 	}
171 171
 
172 172
 
@@ -181,22 +181,22 @@  discard block
 block discarded – undo
181 181
 	 * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket
182 182
 	 * @deprecated 2017.04 Use store() from basket controller instead
183 183
 	 */
184
-	public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket )
184
+	public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket)
185 185
 	{
186 186
 		$context = $this->getContext();
187 187
 
188
-		$orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
189
-		$orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' );
188
+		$orderManager = \Aimeos\MShop\Factory::createManager($context, 'order');
189
+		$orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base');
190 190
 
191 191
 
192 192
 		$orderBaseManager->begin();
193
-		$orderBaseManager->store( $basket );
193
+		$orderBaseManager->store($basket);
194 194
 		$orderBaseManager->commit();
195 195
 
196 196
 		$orderItem = $orderManager->createItem();
197
-		$orderItem->setBaseId( $basket->getId() );
198
-		$orderItem->setType( \Aimeos\MShop\Order\Item\Base::TYPE_WEB );
199
-		$orderManager->saveItem( $orderItem );
197
+		$orderItem->setBaseId($basket->getId());
198
+		$orderItem->setType(\Aimeos\MShop\Order\Item\Base::TYPE_WEB);
199
+		$orderManager->saveItem($orderItem);
200 200
 
201 201
 
202 202
 		return $orderItem;
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Order/StandardTest.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -18,175 +18,175 @@
 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' );
46
+		$manager->expects($this->once())->method('saveItem');
47 47
 
48
-		$this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' ) );
48
+		$this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' ));
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateFilter()
53 53
 	{
54
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() );
54
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter());
55 55
 	}
56 56
 
57 57
 
58 58
 	public function testGetItem()
59 59
 	{
60
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
61
-		$customerItem = $manager->findItem( 'UTC001' );
60
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer');
61
+		$customerItem = $manager->findItem('UTC001');
62 62
 
63
-		$this->context->setUserId( $customerItem->getId() );
63
+		$this->context->setUserId($customerItem->getId());
64 64
 
65
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' );
66
-		$search = $manager->createSearch()->setSlice( 0, 1 );
67
-		$search->setConditions( $search->compare( '==', 'order.base.customerid', $customerItem->getId() ) );
68
-		$result = $manager->searchItems( $search );
65
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'order');
66
+		$search = $manager->createSearch()->setSlice(0, 1);
67
+		$search->setConditions($search->compare('==', 'order.base.customerid', $customerItem->getId()));
68
+		$result = $manager->searchItems($search);
69 69
 
70
-		if( ( $item = reset( $result ) ) === false ) {
71
-			throw new \RuntimeException( 'No order item found' );
70
+		if (($item = reset($result)) === false) {
71
+			throw new \RuntimeException('No order item found');
72 72
 		}
73 73
 
74
-		$this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( $item->getId() ) );
74
+		$this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem($item->getId()));
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGetItemException()
79 79
 	{
80
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' );
81
-		$search = $manager->createSearch()->setSlice( 0, 1 );
82
-		$result = $manager->searchItems( $search );
80
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'order');
81
+		$search = $manager->createSearch()->setSlice(0, 1);
82
+		$result = $manager->searchItems($search);
83 83
 
84
-		if( ( $item = reset( $result ) ) === false ) {
85
-			throw new \RuntimeException( 'No order item found' );
84
+		if (($item = reset($result)) === false) {
85
+			throw new \RuntimeException('No order item found');
86 86
 		}
87 87
 
88
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' );
89
-		$this->object->getItem( $item->getId() );
88
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception');
89
+		$this->object->getItem($item->getId());
90 90
 	}
91 91
 
92 92
 
93 93
 	public function testSearchItems()
94 94
 	{
95
-		$this->assertGreaterThan( 1, $this->object->searchItems( $this->object->createFilter() ) );
95
+		$this->assertGreaterThan(1, $this->object->searchItems($this->object->createFilter()));
96 96
 	}
97 97
 
98 98
 
99 99
 	public function testStore()
100 100
 	{
101 101
 		$name = 'ControllerFrontendOrderStore';
102
-		$this->context->getConfig()->set( 'mshop/order/manager/name', $name );
102
+		$this->context->getConfig()->set('mshop/order/manager/name', $name);
103 103
 
104 104
 
105
-		$orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' )
106
-			->setMethods( array( 'saveItem', 'getSubManager' ) )
107
-			->setConstructorArgs( array( $this->context ) )
105
+		$orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard')
106
+			->setMethods(array('saveItem', 'getSubManager'))
107
+			->setConstructorArgs(array($this->context))
108 108
 			->getMock();
109 109
 
110
-		$orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' )
111
-			->setMethods( array( 'store' ) )
112
-			->setConstructorArgs( array( $this->context ) )
110
+		$orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard')
111
+			->setMethods(array('store'))
112
+			->setConstructorArgs(array($this->context))
113 113
 			->getMock();
114 114
 
115
-		\Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub );
115
+		\Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub);
116 116
 
117 117
 
118 118
 		$orderBaseItem = $orderBaseManagerStub->createItem();
119
-		$orderBaseItem->setId( 1 );
119
+		$orderBaseItem->setId(1);
120 120
 
121 121
 
122
-		$orderBaseManagerStub->expects( $this->once() )->method( 'store' );
122
+		$orderBaseManagerStub->expects($this->once())->method('store');
123 123
 
124
-		$orderManagerStub->expects( $this->once() )->method( 'getSubManager' )
125
-			->will( $this->returnValue( $orderBaseManagerStub ) );
124
+		$orderManagerStub->expects($this->once())->method('getSubManager')
125
+			->will($this->returnValue($orderBaseManagerStub));
126 126
 
127
-		$orderManagerStub->expects( $this->once() )->method( 'saveItem' );
127
+		$orderManagerStub->expects($this->once())->method('saveItem');
128 128
 
129 129
 
130
-		$this->object->store( $orderBaseItem );
130
+		$this->object->store($orderBaseItem);
131 131
 	}
132 132
 
133 133
 
134 134
 	public function testBlock()
135 135
 	{
136 136
 		$name = 'ControllerFrontendOrderBlock';
137
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
137
+		$this->context->getConfig()->set('controller/common/order/name', $name);
138 138
 
139 139
 
140
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
141
-			->setMethods( array( 'block' ) )
142
-			->setConstructorArgs( array( $this->context ) )
140
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
141
+			->setMethods(array('block'))
142
+			->setConstructorArgs(array($this->context))
143 143
 			->getMock();
144 144
 
145
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
145
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
146 146
 
147
-		$orderCntlStub->expects( $this->once() )->method( 'block' );
147
+		$orderCntlStub->expects($this->once())->method('block');
148 148
 
149 149
 
150
-		$this->object->block( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
150
+		$this->object->block(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testUnblock()
155 155
 	{
156 156
 		$name = 'ControllerFrontendOrderUnblock';
157
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
157
+		$this->context->getConfig()->set('controller/common/order/name', $name);
158 158
 
159 159
 
160
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
161
-			->setMethods( array( 'unblock' ) )
162
-			->setConstructorArgs( array( $this->context ) )
160
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
161
+			->setMethods(array('unblock'))
162
+			->setConstructorArgs(array($this->context))
163 163
 			->getMock();
164 164
 
165
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
165
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
166 166
 
167
-		$orderCntlStub->expects( $this->once() )->method( 'unblock' );
167
+		$orderCntlStub->expects($this->once())->method('unblock');
168 168
 
169 169
 
170
-		$this->object->unblock( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
170
+		$this->object->unblock(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
171 171
 	}
172 172
 
173 173
 
174 174
 	public function testUpdate()
175 175
 	{
176 176
 		$name = 'ControllerFrontendOrderUpdate';
177
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
177
+		$this->context->getConfig()->set('controller/common/order/name', $name);
178 178
 
179 179
 
180
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
181
-			->setMethods( array( 'update' ) )
182
-			->setConstructorArgs( array( $this->context ) )
180
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
181
+			->setMethods(array('update'))
182
+			->setConstructorArgs(array($this->context))
183 183
 			->getMock();
184 184
 
185
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
185
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
186 186
 
187
-		$orderCntlStub->expects( $this->once() )->method( 'update' );
187
+		$orderCntlStub->expects($this->once())->method('update');
188 188
 
189 189
 
190
-		$this->object->update( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
190
+		$this->object->update(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
191 191
 	}
192 192
 }
Please login to merge, or discard this patch.