@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'text/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'text/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'text/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'text/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'text/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'text/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'text.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'text.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-text.lists.type.id' ), |
|
295 | + 'sort' => array('-text.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'text/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'text/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Price\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Price\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'price/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'price/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'price/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'price/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Price\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Price\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'price/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'price/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'price' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'price')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'price.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'price.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-price.type.id' ), |
|
295 | + 'sort' => array('-price.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'price/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'price/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'price/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'price/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'price/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'price/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'price/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'price/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'price.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'price.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-price.lists.type.id' ), |
|
295 | + 'sort' => array('-price.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'price/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'price/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Catalog; |
12 | 12 | |
13 | -sprintf( 'catalog' ); // for translation |
|
13 | +sprintf('catalog'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,38 +35,38 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
43 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
43 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemRootId = $this->getRootId(); |
48 | 48 | $view->itemBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $idx => $client ) |
|
50 | + foreach ($this->getSubClients() as $idx => $client) |
|
51 | 51 | { |
52 | 52 | $view->tabindex = ++$idx + 1; |
53 | 53 | $view->itemBody .= $client->copy(); |
54 | 54 | } |
55 | 55 | } |
56 | - catch( \Aimeos\MShop\Exception $e ) |
|
56 | + catch (\Aimeos\MShop\Exception $e) |
|
57 | 57 | { |
58 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
59 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
60 | - $this->logException( $e ); |
|
58 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
59 | + $view->errors = $view->get('errors', []) + $error; |
|
60 | + $this->logException($e); |
|
61 | 61 | } |
62 | - catch( \Exception $e ) |
|
62 | + catch (\Exception $e) |
|
63 | 63 | { |
64 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
65 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
66 | - $this->logException( $e ); |
|
64 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
65 | + $view->errors = $view->get('errors', []) + $error; |
|
66 | + $this->logException($e); |
|
67 | 67 | } |
68 | 68 | |
69 | - return $this->render( $view ); |
|
69 | + return $this->render($view); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,40 +82,40 @@ discard block |
||
82 | 82 | |
83 | 83 | try |
84 | 84 | { |
85 | - $data = $view->param( 'item', [] ); |
|
85 | + $data = $view->param('item', []); |
|
86 | 86 | |
87 | - if( !isset( $view->item ) ) { |
|
88 | - $view->item = \Aimeos\MShop::create( $context, 'catalog' )->createItem(); |
|
87 | + if (!isset($view->item)) { |
|
88 | + $view->item = \Aimeos\MShop::create($context, 'catalog')->createItem(); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $data['catalog.siteid'] = $view->item->getSiteId(); |
92 | - $data['catalog.parentid'] = $view->item->getParentId() ?: $view->param( 'item/catalog.parentid' ); |
|
92 | + $data['catalog.parentid'] = $view->item->getParentId() ?: $view->param('item/catalog.parentid'); |
|
93 | 93 | |
94 | 94 | $view->itemSubparts = $this->getSubClientNames(); |
95 | 95 | $view->itemRootId = $this->getRootId(); |
96 | 96 | $view->itemData = $data; |
97 | 97 | $view->itemBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $idx => $client ) |
|
99 | + foreach ($this->getSubClients() as $idx => $client) |
|
100 | 100 | { |
101 | 101 | $view->tabindex = ++$idx + 1; |
102 | 102 | $view->itemBody .= $client->create(); |
103 | 103 | } |
104 | 104 | } |
105 | - catch( \Aimeos\MShop\Exception $e ) |
|
105 | + catch (\Aimeos\MShop\Exception $e) |
|
106 | 106 | { |
107 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
108 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
109 | - $this->logException( $e ); |
|
107 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
108 | + $view->errors = $view->get('errors', []) + $error; |
|
109 | + $this->logException($e); |
|
110 | 110 | } |
111 | - catch( \Exception $e ) |
|
111 | + catch (\Exception $e) |
|
112 | 112 | { |
113 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
114 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
115 | - $this->logException( $e ); |
|
113 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
114 | + $view->errors = $view->get('errors', []) + $error; |
|
115 | + $this->logException($e); |
|
116 | 116 | } |
117 | 117 | |
118 | - return $this->render( $view ); |
|
118 | + return $this->render($view); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -129,39 +129,39 @@ discard block |
||
129 | 129 | $view = $this->getView(); |
130 | 130 | $context = $this->getContext(); |
131 | 131 | |
132 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
132 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
133 | 133 | $manager->begin(); |
134 | 134 | |
135 | 135 | try |
136 | 136 | { |
137 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
138 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
137 | + if (($id = $view->param('id')) === null) { |
|
138 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
139 | 139 | } |
140 | 140 | |
141 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
141 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
142 | 142 | |
143 | - foreach( $this->getSubClients() as $client ) { |
|
143 | + foreach ($this->getSubClients() as $client) { |
|
144 | 144 | $client->delete(); |
145 | 145 | } |
146 | 146 | |
147 | - $manager->saveItem( $view->item ); |
|
148 | - $manager->deleteItem( $id ); |
|
147 | + $manager->saveItem($view->item); |
|
148 | + $manager->deleteItem($id); |
|
149 | 149 | $manager->commit(); |
150 | 150 | |
151 | - $this->nextAction( $view, 'search', 'catalog', null, 'delete' ); |
|
151 | + $this->nextAction($view, 'search', 'catalog', null, 'delete'); |
|
152 | 152 | return; |
153 | 153 | } |
154 | - catch( \Aimeos\MShop\Exception $e ) |
|
154 | + catch (\Aimeos\MShop\Exception $e) |
|
155 | 155 | { |
156 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
157 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
158 | - $this->logException( $e ); |
|
156 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
157 | + $view->errors = $view->get('errors', []) + $error; |
|
158 | + $this->logException($e); |
|
159 | 159 | } |
160 | - catch( \Exception $e ) |
|
160 | + catch (\Exception $e) |
|
161 | 161 | { |
162 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
163 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
164 | - $this->logException( $e ); |
|
162 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
163 | + $view->errors = $view->get('errors', []) + $error; |
|
164 | + $this->logException($e); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | $manager->rollback(); |
@@ -182,38 +182,38 @@ discard block |
||
182 | 182 | |
183 | 183 | try |
184 | 184 | { |
185 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
186 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
185 | + if (($id = $view->param('id')) === null) { |
|
186 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
187 | 187 | } |
188 | 188 | |
189 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
189 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
190 | 190 | |
191 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
191 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
192 | 192 | $view->itemSubparts = $this->getSubClientNames(); |
193 | - $view->itemData = $this->toArray( $view->item ); |
|
193 | + $view->itemData = $this->toArray($view->item); |
|
194 | 194 | $view->itemRootId = $this->getRootId(); |
195 | 195 | $view->itemBody = ''; |
196 | 196 | |
197 | - foreach( $this->getSubClients() as $idx => $client ) |
|
197 | + foreach ($this->getSubClients() as $idx => $client) |
|
198 | 198 | { |
199 | 199 | $view->tabindex = ++$idx + 1; |
200 | 200 | $view->itemBody .= $client->get(); |
201 | 201 | } |
202 | 202 | } |
203 | - catch( \Aimeos\MShop\Exception $e ) |
|
203 | + catch (\Aimeos\MShop\Exception $e) |
|
204 | 204 | { |
205 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
206 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
207 | - $this->logException( $e ); |
|
205 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
206 | + $view->errors = $view->get('errors', []) + $error; |
|
207 | + $this->logException($e); |
|
208 | 208 | } |
209 | - catch( \Exception $e ) |
|
209 | + catch (\Exception $e) |
|
210 | 210 | { |
211 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
212 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
213 | - $this->logException( $e ); |
|
211 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
212 | + $view->errors = $view->get('errors', []) + $error; |
|
213 | + $this->logException($e); |
|
214 | 214 | } |
215 | 215 | |
216 | - return $this->render( $view ); |
|
216 | + return $this->render($view); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -227,40 +227,40 @@ discard block |
||
227 | 227 | $view = $this->getView(); |
228 | 228 | $context = $this->getContext(); |
229 | 229 | |
230 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
230 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
231 | 231 | $manager->begin(); |
232 | 232 | |
233 | 233 | try |
234 | 234 | { |
235 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
236 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
235 | + $item = $this->fromArray($view->param('item', [])); |
|
236 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
237 | 237 | $view->itemBody = ''; |
238 | 238 | |
239 | - foreach( $this->getSubClients() as $client ) { |
|
239 | + foreach ($this->getSubClients() as $client) { |
|
240 | 240 | $view->itemBody .= $client->save(); |
241 | 241 | } |
242 | 242 | |
243 | - $manager->saveItem( clone $view->item ); |
|
243 | + $manager->saveItem(clone $view->item); |
|
244 | 244 | $manager->commit(); |
245 | 245 | |
246 | - $this->nextAction( $view, $view->param( 'next' ), 'catalog', $view->item->getId(), 'save' ); |
|
246 | + $this->nextAction($view, $view->param('next'), 'catalog', $view->item->getId(), 'save'); |
|
247 | 247 | return; |
248 | 248 | } |
249 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
249 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
250 | 250 | { |
251 | 251 | // fall through to create |
252 | 252 | } |
253 | - catch( \Aimeos\MShop\Exception $e ) |
|
253 | + catch (\Aimeos\MShop\Exception $e) |
|
254 | 254 | { |
255 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
256 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
257 | - $this->logException( $e ); |
|
255 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
256 | + $view->errors = $view->get('errors', []) + $error; |
|
257 | + $this->logException($e); |
|
258 | 258 | } |
259 | - catch( \Exception $e ) |
|
259 | + catch (\Exception $e) |
|
260 | 260 | { |
261 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
262 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
263 | - $this->logException( $e ); |
|
261 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
262 | + $view->errors = $view->get('errors', []) + $error; |
|
263 | + $this->logException($e); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | $manager->rollback(); |
@@ -281,24 +281,24 @@ discard block |
||
281 | 281 | |
282 | 282 | try |
283 | 283 | { |
284 | - $view->item = \Aimeos\MShop::create( $context, 'catalog' )->createItem(); |
|
284 | + $view->item = \Aimeos\MShop::create($context, 'catalog')->createItem(); |
|
285 | 285 | $view->itemRootId = $this->getRootId(); |
286 | 286 | $view->itemBody = ''; |
287 | 287 | } |
288 | - catch( \Aimeos\MShop\Exception $e ) |
|
288 | + catch (\Aimeos\MShop\Exception $e) |
|
289 | 289 | { |
290 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
291 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
292 | - $this->logException( $e ); |
|
290 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
291 | + $view->errors = $view->get('errors', []) + $error; |
|
292 | + $this->logException($e); |
|
293 | 293 | } |
294 | - catch( \Exception $e ) |
|
294 | + catch (\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | 300 | |
301 | - return $this->render( $view ); |
|
301 | + return $this->render($view); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | * @param string|null $name Name of the sub-client (Default if null) |
310 | 310 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
311 | 311 | */ |
312 | - public function getSubClient( $type, $name = null ) |
|
312 | + public function getSubClient($type, $name = null) |
|
313 | 313 | { |
314 | 314 | /** admin/jqadm/catalog/decorators/excludes |
315 | 315 | * Excludes decorators added by the "common" option from the catalog JQAdm client |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | * @see admin/jqadm/catalog/decorators/excludes |
385 | 385 | * @see admin/jqadm/catalog/decorators/global |
386 | 386 | */ |
387 | - return $this->createSubClient( 'catalog/' . $type, $name ); |
|
387 | + return $this->createSubClient('catalog/' . $type, $name); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | |
@@ -406,9 +406,9 @@ discard block |
||
406 | 406 | * @since 2016.01 |
407 | 407 | * @category Developer |
408 | 408 | */ |
409 | - $domains = array( 'media', 'text' ); |
|
409 | + $domains = array('media', 'text'); |
|
410 | 410 | |
411 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/domains', $domains ); |
|
411 | + return $this->getContext()->getConfig()->get('admin/jqadm/catalog/domains', $domains); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | |
@@ -419,11 +419,11 @@ discard block |
||
419 | 419 | */ |
420 | 420 | protected function getRootId() |
421 | 421 | { |
422 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog' ); |
|
422 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog'); |
|
423 | 423 | |
424 | 424 | try { |
425 | - return $manager->getTree( null, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE )->getId(); |
|
426 | - } catch( \Exception $e ) { |
|
425 | + return $manager->getTree(null, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE)->getId(); |
|
426 | + } catch (\Exception $e) { |
|
427 | 427 | return null; |
428 | 428 | } |
429 | 429 | } |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | * @since 2016.01 |
470 | 470 | * @category Developer |
471 | 471 | */ |
472 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/standard/subparts', [] ); |
|
472 | + return $this->getContext()->getConfig()->get('admin/jqadm/catalog/standard/subparts', []); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | |
@@ -479,33 +479,33 @@ discard block |
||
479 | 479 | * @param string[] Data array |
480 | 480 | * @return \Aimeos\MShop\Catalog\Item\Iface New catalog item object |
481 | 481 | */ |
482 | - protected function fromArray( array $data ) |
|
482 | + protected function fromArray(array $data) |
|
483 | 483 | { |
484 | 484 | $conf = []; |
485 | 485 | |
486 | - if( isset( $data['config']['key'] ) ) |
|
486 | + if (isset($data['config']['key'])) |
|
487 | 487 | { |
488 | - foreach( (array) $data['config']['key'] as $idx => $key ) |
|
488 | + foreach ((array) $data['config']['key'] as $idx => $key) |
|
489 | 489 | { |
490 | - if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) { |
|
490 | + if (trim($key) !== '' && isset($data['config']['val'][$idx])) { |
|
491 | 491 | $conf[$key] = $data['config']['val'][$idx]; |
492 | 492 | } |
493 | 493 | } |
494 | 494 | } |
495 | 495 | |
496 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog' ); |
|
496 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog'); |
|
497 | 497 | |
498 | - if( isset( $data['catalog.id'] ) && $data['catalog.id'] != '' ) { |
|
499 | - $item = $manager->getItem( $data['catalog.id'], $this->getDomains() ); |
|
498 | + if (isset($data['catalog.id']) && $data['catalog.id'] != '') { |
|
499 | + $item = $manager->getItem($data['catalog.id'], $this->getDomains()); |
|
500 | 500 | } else { |
501 | 501 | $item = $manager->createItem(); |
502 | 502 | } |
503 | 503 | |
504 | - $item->fromArray( $data ); |
|
505 | - $item->setConfig( $conf ); |
|
504 | + $item->fromArray($data); |
|
505 | + $item->setConfig($conf); |
|
506 | 506 | |
507 | - if( $item->getId() == null ) { |
|
508 | - return $manager->insertItem( $item, $data['catalog.parentid'] ?: null ); |
|
507 | + if ($item->getId() == null) { |
|
508 | + return $manager->insertItem($item, $data['catalog.parentid'] ?: null); |
|
509 | 509 | } |
510 | 510 | |
511 | 511 | return $item; |
@@ -518,19 +518,19 @@ discard block |
||
518 | 518 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item object |
519 | 519 | * @return string[] Multi-dimensional associative list of item data |
520 | 520 | */ |
521 | - protected function toArray( \Aimeos\MShop\Catalog\Item\Iface $item, $copy = false ) |
|
521 | + protected function toArray(\Aimeos\MShop\Catalog\Item\Iface $item, $copy = false) |
|
522 | 522 | { |
523 | - $data = $item->toArray( true ); |
|
523 | + $data = $item->toArray(true); |
|
524 | 524 | $data['config'] = []; |
525 | 525 | |
526 | - if( $copy === true ) |
|
526 | + if ($copy === true) |
|
527 | 527 | { |
528 | 528 | $data['catalog.id'] = ''; |
529 | 529 | $data['catalog.siteid'] = $item->getSiteId(); |
530 | 530 | $data['catalog.code'] = $data['catalog.code'] . '_copy'; |
531 | 531 | } |
532 | 532 | |
533 | - foreach( $item->getConfig() as $key => $value ) |
|
533 | + foreach ($item->getConfig() as $key => $value) |
|
534 | 534 | { |
535 | 535 | $data['config']['key'][] = $key; |
536 | 536 | $data['config']['val'][] = $value; |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
547 | 547 | * @return string HTML output |
548 | 548 | */ |
549 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
549 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
550 | 550 | { |
551 | 551 | /** admin/jqadm/catalog/template-item |
552 | 552 | * Relative path to the HTML body template for the catalog item. |
@@ -570,6 +570,6 @@ discard block |
||
570 | 570 | $tplconf = 'admin/jqadm/catalog/template-item'; |
571 | 571 | $default = 'catalog/item-standard'; |
572 | 572 | |
573 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
573 | + return $view->render($view->config($tplconf, $default)); |
|
574 | 574 | } |
575 | 575 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Customer\Address; |
12 | 12 | |
13 | -sprintf( 'address' ); // for translation |
|
13 | +sprintf('address'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->addressData = $this->toArray( $view->item, true ); |
|
47 | + $view->addressData = $this->toArray($view->item, true); |
|
48 | 48 | $view->addressBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->addressBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | { |
65 | 65 | $view = $this->getView(); |
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'address', [] ); |
|
67 | + $data = $view->param('address', []); |
|
68 | 68 | |
69 | - foreach( $data as $idx => $entry ) { |
|
69 | + foreach ($data as $idx => $entry) { |
|
70 | 70 | $data[$idx]['customer.address.siteid'] = $siteid; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $view->addressData = $data; |
74 | 74 | $view->addressBody = ''; |
75 | 75 | |
76 | - foreach( $this->getSubClients() as $client ) { |
|
76 | + foreach ($this->getSubClients() as $client) { |
|
77 | 77 | $view->addressBody .= $client->create(); |
78 | 78 | } |
79 | 79 | |
80 | - return $this->render( $view ); |
|
80 | + return $this->render($view); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | { |
91 | 91 | $view = $this->getView(); |
92 | 92 | |
93 | - $view->addressData = $this->toArray( $view->item ); |
|
93 | + $view->addressData = $this->toArray($view->item); |
|
94 | 94 | $view->addressBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $client ) { |
|
96 | + foreach ($this->getSubClients() as $client) { |
|
97 | 97 | $view->addressBody .= $client->get(); |
98 | 98 | } |
99 | 99 | |
100 | - return $this->render( $view ); |
|
100 | + return $this->render($view); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -110,26 +110,26 @@ discard block |
||
110 | 110 | |
111 | 111 | try |
112 | 112 | { |
113 | - $this->fromArray( $view->item, $view->param( 'address', [] ) ); |
|
113 | + $this->fromArray($view->item, $view->param('address', [])); |
|
114 | 114 | $view->addressBody = ''; |
115 | 115 | |
116 | - foreach( $this->getSubClients() as $client ) { |
|
116 | + foreach ($this->getSubClients() as $client) { |
|
117 | 117 | $view->addressBody .= $client->save(); |
118 | 118 | } |
119 | 119 | |
120 | 120 | return; |
121 | 121 | } |
122 | - catch( \Aimeos\MShop\Exception $e ) |
|
122 | + catch (\Aimeos\MShop\Exception $e) |
|
123 | 123 | { |
124 | - $error = array( 'customer-item-address' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
125 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
126 | - $this->logException( $e ); |
|
124 | + $error = array('customer-item-address' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
125 | + $view->errors = $view->get('errors', []) + $error; |
|
126 | + $this->logException($e); |
|
127 | 127 | } |
128 | - catch( \Exception $e ) |
|
128 | + catch (\Exception $e) |
|
129 | 129 | { |
130 | - $error = array( 'customer-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
131 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
132 | - $this->logException( $e ); |
|
130 | + $error = array('customer-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
131 | + $view->errors = $view->get('errors', []) + $error; |
|
132 | + $this->logException($e); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param string|null $name Name of the sub-client (Default if null) |
144 | 144 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
145 | 145 | */ |
146 | - public function getSubClient( $type, $name = null ) |
|
146 | + public function getSubClient($type, $name = null) |
|
147 | 147 | { |
148 | 148 | /** admin/jqadm/customer/address/decorators/excludes |
149 | 149 | * Excludes decorators added by the "common" option from the customer JQAdm client |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @see admin/jqadm/customer/address/decorators/excludes |
219 | 219 | * @see admin/jqadm/customer/address/decorators/global |
220 | 220 | */ |
221 | - return $this->createSubClient( 'customer/address/' . $type, $name ); |
|
221 | + return $this->createSubClient('customer/address/' . $type, $name); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @since 2016.01 |
263 | 263 | * @category Developer |
264 | 264 | */ |
265 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/address/standard/subparts', [] ); |
|
265 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/address/standard/subparts', []); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | |
@@ -272,29 +272,29 @@ discard block |
||
272 | 272 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object without referenced domain items |
273 | 273 | * @param string[] $data Data array |
274 | 274 | */ |
275 | - protected function fromArray( \Aimeos\MShop\Customer\Item\Iface $item, array $data ) |
|
275 | + protected function fromArray(\Aimeos\MShop\Customer\Item\Iface $item, array $data) |
|
276 | 276 | { |
277 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer/address' ); |
|
277 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer/address'); |
|
278 | 278 | |
279 | 279 | $addrItems = $item->getAddressItems(); |
280 | 280 | |
281 | - foreach( $data as $entry ) |
|
281 | + foreach ($data as $entry) |
|
282 | 282 | { |
283 | - if( isset( $addrItems[$entry['customer.address.id']] ) ) |
|
283 | + if (isset($addrItems[$entry['customer.address.id']])) |
|
284 | 284 | { |
285 | 285 | $addrItem = $addrItems[$entry['customer.address.id']]; |
286 | - unset( $addrItems[$entry['customer.address.id']] ); |
|
286 | + unset($addrItems[$entry['customer.address.id']]); |
|
287 | 287 | } |
288 | 288 | else |
289 | 289 | { |
290 | 290 | $addrItem = $manager->createItem(); |
291 | 291 | } |
292 | 292 | |
293 | - $addrItem->fromArray( $entry ); |
|
294 | - $item->addAddressItem( $addrItem ); |
|
293 | + $addrItem->fromArray($entry); |
|
294 | + $item->addAddressItem($addrItem); |
|
295 | 295 | } |
296 | 296 | |
297 | - $item->deleteAddressItems( $addrItems ); |
|
297 | + $item->deleteAddressItems($addrItems); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | * @param boolean $copy True if items should be copied, false if not |
306 | 306 | * @return string[] Multi-dimensional associative list of item data |
307 | 307 | */ |
308 | - protected function toArray( \Aimeos\MShop\Customer\Item\Iface $item, $copy = false ) |
|
308 | + protected function toArray(\Aimeos\MShop\Customer\Item\Iface $item, $copy = false) |
|
309 | 309 | { |
310 | 310 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
311 | 311 | $data = []; |
312 | 312 | |
313 | - foreach( $item->getAddressItems() as $addrItem ) |
|
313 | + foreach ($item->getAddressItems() as $addrItem) |
|
314 | 314 | { |
315 | - $list = $addrItem->toArray( true ); |
|
315 | + $list = $addrItem->toArray(true); |
|
316 | 316 | |
317 | - if( $copy === true ) |
|
317 | + if ($copy === true) |
|
318 | 318 | { |
319 | 319 | $list['customer.address.siteid'] = $siteId; |
320 | 320 | $list['customer.address.id'] = ''; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
334 | 334 | * @return string HTML output |
335 | 335 | */ |
336 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
336 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
337 | 337 | { |
338 | 338 | /** admin/jqadm/customer/address/template-item |
339 | 339 | * Relative path to the HTML body template of the address subpart for customers. |
@@ -357,6 +357,6 @@ discard block |
||
357 | 357 | $tplconf = 'admin/jqadm/customer/address/template-item'; |
358 | 358 | $default = 'customer/item-address-standard'; |
359 | 359 | |
360 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
360 | + return $view->render($view->config($tplconf, $default)); |
|
361 | 361 | } |
362 | 362 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Customer\Order; |
12 | 12 | |
13 | -sprintf( 'order' ); // for translation |
|
13 | +sprintf('order'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -69,33 +69,33 @@ discard block |
||
69 | 69 | try |
70 | 70 | { |
71 | 71 | $total = 0; |
72 | - $params = $this->storeSearchParams( $view->param( 'uo', [] ), 'customerorder' ); |
|
73 | - $orderItems = $this->getOrderItems( $view->item, $params, $total ); |
|
74 | - $baseItems = $this->getOrderBaseItems( $orderItems ); |
|
72 | + $params = $this->storeSearchParams($view->param('uo', []), 'customerorder'); |
|
73 | + $orderItems = $this->getOrderItems($view->item, $params, $total); |
|
74 | + $baseItems = $this->getOrderBaseItems($orderItems); |
|
75 | 75 | |
76 | 76 | $view->orderItems = $orderItems; |
77 | 77 | $view->orderBaseItems = $baseItems; |
78 | 78 | $view->orderTotal = $total; |
79 | 79 | $view->orderBody = ''; |
80 | 80 | |
81 | - foreach( $this->getSubClients() as $client ) { |
|
81 | + foreach ($this->getSubClients() as $client) { |
|
82 | 82 | $view->orderBody .= $client->search(); |
83 | 83 | } |
84 | 84 | } |
85 | - catch( \Aimeos\MShop\Exception $e ) |
|
85 | + catch (\Aimeos\MShop\Exception $e) |
|
86 | 86 | { |
87 | - $error = array( 'customer-order' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
88 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
89 | - $this->logException( $e ); |
|
87 | + $error = array('customer-order' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
88 | + $view->errors = $view->get('errors', []) + $error; |
|
89 | + $this->logException($e); |
|
90 | 90 | } |
91 | - catch( \Exception $e ) |
|
91 | + catch (\Exception $e) |
|
92 | 92 | { |
93 | - $error = array( 'customer-order' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
94 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
95 | - $this->logException( $e ); |
|
93 | + $error = array('customer-order' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
94 | + $view->errors = $view->get('errors', []) + $error; |
|
95 | + $this->logException($e); |
|
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param string|null $name Name of the sub-client (Default if null) |
116 | 116 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
117 | 117 | */ |
118 | - public function getSubClient( $type, $name = null ) |
|
118 | + public function getSubClient($type, $name = null) |
|
119 | 119 | { |
120 | 120 | /** admin/jqadm/customer/order/decorators/excludes |
121 | 121 | * Excludes decorators added by the "common" option from the customer JQAdm client |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @see admin/jqadm/customer/order/decorators/excludes |
191 | 191 | * @see admin/jqadm/customer/order/decorators/global |
192 | 192 | */ |
193 | - return $this->createSubClient( 'customer/order/' . $type, $name ); |
|
193 | + return $this->createSubClient('customer/order/' . $type, $name); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | |
@@ -200,20 +200,20 @@ discard block |
||
200 | 200 | * @param \Aimeos\MShop\Order\Item\Iface[] $items Order item objects |
201 | 201 | * @return \Aimeos\MShop\Order\Item\Base\Iface[] Basket items |
202 | 202 | */ |
203 | - protected function getOrderBaseItems( array $items ) |
|
203 | + protected function getOrderBaseItems(array $items) |
|
204 | 204 | { |
205 | 205 | $ids = []; |
206 | 206 | |
207 | - foreach( $items as $item ) { |
|
207 | + foreach ($items as $item) { |
|
208 | 208 | $ids[] = $item->getBaseId(); |
209 | 209 | } |
210 | 210 | |
211 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order/base' ); |
|
211 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order/base'); |
|
212 | 212 | |
213 | - $search = $manager->createSearch()->setSlice( 0, count( $ids ) ); |
|
214 | - $search->setConditions( $search->compare( '==', 'order.base.id', $ids ) ); |
|
213 | + $search = $manager->createSearch()->setSlice(0, count($ids)); |
|
214 | + $search->setConditions($search->compare('==', 'order.base.id', $ids)); |
|
215 | 215 | |
216 | - return $manager->searchItems( $search ); |
|
216 | + return $manager->searchItems($search); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -225,21 +225,21 @@ discard block |
||
225 | 225 | * @param integer $total Value/result parameter that will contain the item total afterwards |
226 | 226 | * @return \Aimeos\MShop\Order\Item\Iface[] Order items of the customer |
227 | 227 | */ |
228 | - protected function getOrderItems( \Aimeos\MShop\Customer\Item\Iface $item, array $params = [], &$total ) |
|
228 | + protected function getOrderItems(\Aimeos\MShop\Customer\Item\Iface $item, array $params = [], &$total) |
|
229 | 229 | { |
230 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order' ); |
|
230 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order'); |
|
231 | 231 | |
232 | 232 | $search = $manager->createSearch(); |
233 | - $search->setSortations( [$search->sort( '-', 'order.ctime' )] ); |
|
233 | + $search->setSortations([$search->sort('-', 'order.ctime')]); |
|
234 | 234 | |
235 | - $search = $this->initCriteria( $search, $params ); |
|
235 | + $search = $this->initCriteria($search, $params); |
|
236 | 236 | $expr = [ |
237 | - $search->compare( '==', 'order.base.customerid', $item->getId() ), |
|
237 | + $search->compare('==', 'order.base.customerid', $item->getId()), |
|
238 | 238 | $search->getConditions(), |
239 | 239 | ]; |
240 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
240 | + $search->setConditions($search->combine('&&', $expr)); |
|
241 | 241 | |
242 | - return $manager->searchItems( $search, [], $total ); |
|
242 | + return $manager->searchItems($search, [], $total); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @since 2017.07 |
284 | 284 | * @category Developer |
285 | 285 | */ |
286 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/order/standard/subparts', [] ); |
|
286 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/order/standard/subparts', []); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
294 | 294 | * @return string HTML output |
295 | 295 | */ |
296 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
296 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
297 | 297 | { |
298 | 298 | /** admin/jqadm/customer/order/template-item |
299 | 299 | * Relative path to the HTML body template of the order subpart for customers. |
@@ -317,6 +317,6 @@ discard block |
||
317 | 317 | $tplconf = 'admin/jqadm/customer/order/template-item'; |
318 | 318 | $default = 'customer/item-order-standard'; |
319 | 319 | |
320 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
320 | + return $view->render($view->config($tplconf, $default)); |
|
321 | 321 | } |
322 | 322 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Customer; |
12 | 12 | |
13 | -sprintf( 'customer' ); // for translation |
|
13 | +sprintf('customer'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,38 +35,38 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
43 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
43 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemGroups = $this->getGroupItems(); |
48 | 48 | $view->itemBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $idx => $client ) |
|
50 | + foreach ($this->getSubClients() as $idx => $client) |
|
51 | 51 | { |
52 | 52 | $view->tabindex = ++$idx + 1; |
53 | 53 | $view->itemBody .= $client->copy(); |
54 | 54 | } |
55 | 55 | } |
56 | - catch( \Aimeos\MShop\Exception $e ) |
|
56 | + catch (\Aimeos\MShop\Exception $e) |
|
57 | 57 | { |
58 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
59 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
60 | - $this->logException( $e ); |
|
58 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
59 | + $view->errors = $view->get('errors', []) + $error; |
|
60 | + $this->logException($e); |
|
61 | 61 | } |
62 | - catch( \Exception $e ) |
|
62 | + catch (\Exception $e) |
|
63 | 63 | { |
64 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
65 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
66 | - $this->logException( $e ); |
|
64 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
65 | + $view->errors = $view->get('errors', []) + $error; |
|
66 | + $this->logException($e); |
|
67 | 67 | } |
68 | 68 | |
69 | - return $this->render( $view ); |
|
69 | + return $this->render($view); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | |
83 | 83 | try |
84 | 84 | { |
85 | - $data = $view->param( 'item', [] ); |
|
85 | + $data = $view->param('item', []); |
|
86 | 86 | |
87 | - if( !isset( $view->item ) ) { |
|
88 | - $view->item = \Aimeos\MShop::create( $context, 'customer' )->createItem(); |
|
87 | + if (!isset($view->item)) { |
|
88 | + $view->item = \Aimeos\MShop::create($context, 'customer')->createItem(); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $data['customer.siteid'] = $view->item->getSiteId(); |
@@ -95,26 +95,26 @@ discard block |
||
95 | 95 | $view->itemData = $data; |
96 | 96 | $view->itemBody = ''; |
97 | 97 | |
98 | - foreach( $this->getSubClients() as $idx => $client ) |
|
98 | + foreach ($this->getSubClients() as $idx => $client) |
|
99 | 99 | { |
100 | 100 | $view->tabindex = ++$idx + 1; |
101 | 101 | $view->itemBody .= $client->create(); |
102 | 102 | } |
103 | 103 | } |
104 | - catch( \Aimeos\MShop\Exception $e ) |
|
104 | + catch (\Aimeos\MShop\Exception $e) |
|
105 | 105 | { |
106 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
107 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
108 | - $this->logException( $e ); |
|
106 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
107 | + $view->errors = $view->get('errors', []) + $error; |
|
108 | + $this->logException($e); |
|
109 | 109 | } |
110 | - catch( \Exception $e ) |
|
110 | + catch (\Exception $e) |
|
111 | 111 | { |
112 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
113 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
114 | - $this->logException( $e ); |
|
112 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
113 | + $view->errors = $view->get('errors', []) + $error; |
|
114 | + $this->logException($e); |
|
115 | 115 | } |
116 | 116 | |
117 | - return $this->render( $view ); |
|
117 | + return $this->render($view); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | |
@@ -128,39 +128,39 @@ discard block |
||
128 | 128 | $view = $this->getView(); |
129 | 129 | $context = $this->getContext(); |
130 | 130 | |
131 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
131 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
132 | 132 | $manager->begin(); |
133 | 133 | |
134 | 134 | try |
135 | 135 | { |
136 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
137 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
136 | + if (($id = $view->param('id')) === null) { |
|
137 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
138 | 138 | } |
139 | 139 | |
140 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
140 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
141 | 141 | |
142 | - foreach( $this->getSubClients() as $client ) { |
|
142 | + foreach ($this->getSubClients() as $client) { |
|
143 | 143 | $client->delete(); |
144 | 144 | } |
145 | 145 | |
146 | - $manager->saveItem( $view->item ); |
|
147 | - $manager->deleteItem( $id ); |
|
146 | + $manager->saveItem($view->item); |
|
147 | + $manager->deleteItem($id); |
|
148 | 148 | $manager->commit(); |
149 | 149 | |
150 | - $this->nextAction( $view, 'search', 'customer', null, 'delete' ); |
|
150 | + $this->nextAction($view, 'search', 'customer', null, 'delete'); |
|
151 | 151 | return; |
152 | 152 | } |
153 | - catch( \Aimeos\MShop\Exception $e ) |
|
153 | + catch (\Aimeos\MShop\Exception $e) |
|
154 | 154 | { |
155 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
156 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
157 | - $this->logException( $e ); |
|
155 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
156 | + $view->errors = $view->get('errors', []) + $error; |
|
157 | + $this->logException($e); |
|
158 | 158 | } |
159 | - catch( \Exception $e ) |
|
159 | + catch (\Exception $e) |
|
160 | 160 | { |
161 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
162 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
163 | - $this->logException( $e ); |
|
161 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
162 | + $view->errors = $view->get('errors', []) + $error; |
|
163 | + $this->logException($e); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | $manager->rollback(); |
@@ -181,38 +181,38 @@ discard block |
||
181 | 181 | |
182 | 182 | try |
183 | 183 | { |
184 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
185 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
184 | + if (($id = $view->param('id')) === null) { |
|
185 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
186 | 186 | } |
187 | 187 | |
188 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
188 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
189 | 189 | |
190 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
190 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
191 | 191 | $view->itemSubparts = $this->getSubClientNames(); |
192 | - $view->itemData = $this->toArray( $view->item ); |
|
192 | + $view->itemData = $this->toArray($view->item); |
|
193 | 193 | $view->itemGroups = $this->getGroupItems(); |
194 | 194 | $view->itemBody = ''; |
195 | 195 | |
196 | - foreach( $this->getSubClients() as $idx => $client ) |
|
196 | + foreach ($this->getSubClients() as $idx => $client) |
|
197 | 197 | { |
198 | 198 | $view->tabindex = ++$idx + 1; |
199 | 199 | $view->itemBody .= $client->get(); |
200 | 200 | } |
201 | 201 | } |
202 | - catch( \Aimeos\MShop\Exception $e ) |
|
202 | + catch (\Aimeos\MShop\Exception $e) |
|
203 | 203 | { |
204 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
205 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
206 | - $this->logException( $e ); |
|
204 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
205 | + $view->errors = $view->get('errors', []) + $error; |
|
206 | + $this->logException($e); |
|
207 | 207 | } |
208 | - catch( \Exception $e ) |
|
208 | + catch (\Exception $e) |
|
209 | 209 | { |
210 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
211 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
212 | - $this->logException( $e ); |
|
210 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
211 | + $view->errors = $view->get('errors', []) + $error; |
|
212 | + $this->logException($e); |
|
213 | 213 | } |
214 | 214 | |
215 | - return $this->render( $view ); |
|
215 | + return $this->render($view); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | |
@@ -226,40 +226,40 @@ discard block |
||
226 | 226 | $view = $this->getView(); |
227 | 227 | $context = $this->getContext(); |
228 | 228 | |
229 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
229 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
230 | 230 | $manager->begin(); |
231 | 231 | |
232 | 232 | try |
233 | 233 | { |
234 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
235 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
234 | + $item = $this->fromArray($view->param('item', [])); |
|
235 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
236 | 236 | $view->itemBody = ''; |
237 | 237 | |
238 | - foreach( $this->getSubClients() as $client ) { |
|
238 | + foreach ($this->getSubClients() as $client) { |
|
239 | 239 | $view->itemBody .= $client->save(); |
240 | 240 | } |
241 | 241 | |
242 | - $manager->saveItem( clone $view->item ); |
|
242 | + $manager->saveItem(clone $view->item); |
|
243 | 243 | $manager->commit(); |
244 | 244 | |
245 | - $this->nextAction( $view, $view->param( 'next' ), 'customer', $view->item->getId(), 'save' ); |
|
245 | + $this->nextAction($view, $view->param('next'), 'customer', $view->item->getId(), 'save'); |
|
246 | 246 | return; |
247 | 247 | } |
248 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
248 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
249 | 249 | { |
250 | 250 | // fall through to create |
251 | 251 | } |
252 | - catch( \Aimeos\MShop\Exception $e ) |
|
252 | + catch (\Aimeos\MShop\Exception $e) |
|
253 | 253 | { |
254 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
255 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
256 | - $this->logException( $e ); |
|
254 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
255 | + $view->errors = $view->get('errors', []) + $error; |
|
256 | + $this->logException($e); |
|
257 | 257 | } |
258 | - catch( \Exception $e ) |
|
258 | + catch (\Exception $e) |
|
259 | 259 | { |
260 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
261 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
262 | - $this->logException( $e ); |
|
260 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
261 | + $view->errors = $view->get('errors', []) + $error; |
|
262 | + $this->logException($e); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | $manager->rollback(); |
@@ -281,31 +281,31 @@ discard block |
||
281 | 281 | try |
282 | 282 | { |
283 | 283 | $total = 0; |
284 | - $params = $this->storeSearchParams( $view->param(), 'customer' ); |
|
285 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
286 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
284 | + $params = $this->storeSearchParams($view->param(), 'customer'); |
|
285 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
286 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
287 | 287 | |
288 | - $view->items = $manager->searchItems( $search, $this->getDomains(), $total ); |
|
289 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
288 | + $view->items = $manager->searchItems($search, $this->getDomains(), $total); |
|
289 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
290 | 290 | $view->filterOperators = $search->getOperators(); |
291 | 291 | $view->total = $total; |
292 | 292 | $view->itemBody = ''; |
293 | 293 | |
294 | - foreach( $this->getSubClients() as $client ) { |
|
294 | + foreach ($this->getSubClients() as $client) { |
|
295 | 295 | $view->itemBody .= $client->search(); |
296 | 296 | } |
297 | 297 | } |
298 | - catch( \Aimeos\MShop\Exception $e ) |
|
298 | + catch (\Aimeos\MShop\Exception $e) |
|
299 | 299 | { |
300 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
301 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
302 | - $this->logException( $e ); |
|
300 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
301 | + $view->errors = $view->get('errors', []) + $error; |
|
302 | + $this->logException($e); |
|
303 | 303 | } |
304 | - catch( \Exception $e ) |
|
304 | + catch (\Exception $e) |
|
305 | 305 | { |
306 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
307 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
308 | - $this->logException( $e ); |
|
306 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
307 | + $view->errors = $view->get('errors', []) + $error; |
|
308 | + $this->logException($e); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** admin/jqadm/customer/template-list |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $tplconf = 'admin/jqadm/customer/template-list'; |
331 | 331 | $default = 'customer/list-standard'; |
332 | 332 | |
333 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
333 | + return $view->render($view->config($tplconf, $default)); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | * @param string|null $name Name of the sub-client (Default if null) |
342 | 342 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
343 | 343 | */ |
344 | - public function getSubClient( $type, $name = null ) |
|
344 | + public function getSubClient($type, $name = null) |
|
345 | 345 | { |
346 | 346 | /** admin/jqadm/customer/decorators/excludes |
347 | 347 | * Excludes decorators added by the "common" option from the customer JQAdm client |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | * @see admin/jqadm/customer/decorators/excludes |
417 | 417 | * @see admin/jqadm/customer/decorators/global |
418 | 418 | */ |
419 | - return $this->createSubClient( 'customer/' . $type, $name ); |
|
419 | + return $this->createSubClient('customer/' . $type, $name); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | */ |
441 | 441 | $domains = ['customer/address', 'customer/group', 'customer/property']; |
442 | 442 | |
443 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/domains', $domains ); |
|
443 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/domains', $domains); |
|
444 | 444 | } |
445 | 445 | |
446 | 446 | |
@@ -452,20 +452,20 @@ discard block |
||
452 | 452 | protected function getGroupItems() |
453 | 453 | { |
454 | 454 | $list = []; |
455 | - $isSuper = $this->getView()->access( ['super'] ); |
|
456 | - $isAdmin = $this->getView()->access( ['admin'] ); |
|
455 | + $isSuper = $this->getView()->access(['super']); |
|
456 | + $isAdmin = $this->getView()->access(['admin']); |
|
457 | 457 | |
458 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer/group' ); |
|
458 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer/group'); |
|
459 | 459 | $search = $manager->createSearch(); |
460 | - $search->setSortations( [$search->sort( '+', 'customer.group.label' )] ); |
|
460 | + $search->setSortations([$search->sort('+', 'customer.group.label')]); |
|
461 | 461 | |
462 | - foreach( $manager->searchItems( $search ) as $groupId => $groupItem ) |
|
462 | + foreach ($manager->searchItems($search) as $groupId => $groupItem) |
|
463 | 463 | { |
464 | - if( !$isSuper && in_array( $groupItem->getCode(), ['super'] ) ) { |
|
464 | + if (!$isSuper && in_array($groupItem->getCode(), ['super'])) { |
|
465 | 465 | continue; |
466 | 466 | } |
467 | 467 | |
468 | - if( !$isSuper && !$isAdmin && in_array( $groupItem->getCode(), ['super', 'admin', 'editor'] ) ) { |
|
468 | + if (!$isSuper && !$isAdmin && in_array($groupItem->getCode(), ['super', 'admin', 'editor'])) { |
|
469 | 469 | continue; |
470 | 470 | } |
471 | 471 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | * @since 2017.07 |
517 | 517 | * @category Developer |
518 | 518 | */ |
519 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/standard/subparts', [] ); |
|
519 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/standard/subparts', []); |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | |
@@ -527,21 +527,21 @@ discard block |
||
527 | 527 | * @param string[] Data array |
528 | 528 | * @return \Aimeos\MShop\Customer\Item\Iface New customer item object |
529 | 529 | */ |
530 | - protected function fromArray( array $data ) |
|
530 | + protected function fromArray(array $data) |
|
531 | 531 | { |
532 | 532 | $data['customer.label'] = $data['customer.firstname'] . ' ' . $data['customer.lastname']; |
533 | 533 | $data['customer.code'] = $data['customer.email']; |
534 | 534 | |
535 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer' ); |
|
535 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer'); |
|
536 | 536 | |
537 | - if( isset( $data['customer.id'] ) && $data['customer.id'] != '' ) { |
|
538 | - $item = $manager->getItem( $data['customer.id'], $this->getDomains() ); |
|
537 | + if (isset($data['customer.id']) && $data['customer.id'] != '') { |
|
538 | + $item = $manager->getItem($data['customer.id'], $this->getDomains()); |
|
539 | 539 | } else { |
540 | 540 | $item = $manager->createItem(); |
541 | 541 | } |
542 | 542 | |
543 | - $item->fromArray( $data ); |
|
544 | - $item->setGroups( array_intersect( array_keys( $this->getGroupItems() ), $item->getGroups() ) ); |
|
543 | + $item->fromArray($data); |
|
544 | + $item->setGroups(array_intersect(array_keys($this->getGroupItems()), $item->getGroups())); |
|
545 | 545 | |
546 | 546 | return $item; |
547 | 547 | } |
@@ -553,11 +553,11 @@ discard block |
||
553 | 553 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object |
554 | 554 | * @return string[] Multi-dimensional associative list of item data |
555 | 555 | */ |
556 | - protected function toArray( \Aimeos\MShop\Customer\Item\Iface $item, $copy = false ) |
|
556 | + protected function toArray(\Aimeos\MShop\Customer\Item\Iface $item, $copy = false) |
|
557 | 557 | { |
558 | - $data = $item->toArray( true ); |
|
558 | + $data = $item->toArray(true); |
|
559 | 559 | |
560 | - if( $copy === true ) |
|
560 | + if ($copy === true) |
|
561 | 561 | { |
562 | 562 | $data['customer.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
563 | 563 | $data['customer.email'] = ''; |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
575 | 575 | * @return string HTML output |
576 | 576 | */ |
577 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
577 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
578 | 578 | { |
579 | 579 | /** admin/jqadm/customer/template-item |
580 | 580 | * Relative path to the HTML body template for the customer item. |
@@ -598,6 +598,6 @@ discard block |
||
598 | 598 | $tplconf = 'admin/jqadm/customer/template-item'; |
599 | 599 | $default = 'customer/item-standard'; |
600 | 600 | |
601 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
601 | + return $view->render($view->config($tplconf, $default)); |
|
602 | 602 | } |
603 | 603 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Supplier\Address; |
12 | 12 | |
13 | -sprintf( 'address' ); // for translation |
|
13 | +sprintf('address'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->addressData = $this->toArray( $view->item, true ); |
|
47 | + $view->addressData = $this->toArray($view->item, true); |
|
48 | 48 | $view->addressBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->addressBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | { |
65 | 65 | $view = $this->getView(); |
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'address', [] ); |
|
67 | + $data = $view->param('address', []); |
|
68 | 68 | |
69 | - foreach( $data as $idx => $entry ) { |
|
69 | + foreach ($data as $idx => $entry) { |
|
70 | 70 | $data[$idx]['supplier.address.siteid'] = $siteid; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $view->addressData = $data; |
74 | 74 | $view->addressBody = ''; |
75 | 75 | |
76 | - foreach( $this->getSubClients() as $client ) { |
|
76 | + foreach ($this->getSubClients() as $client) { |
|
77 | 77 | $view->addressBody .= $client->create(); |
78 | 78 | } |
79 | 79 | |
80 | - return $this->render( $view ); |
|
80 | + return $this->render($view); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | { |
91 | 91 | $view = $this->getView(); |
92 | 92 | |
93 | - $view->addressData = $this->toArray( $view->item ); |
|
93 | + $view->addressData = $this->toArray($view->item); |
|
94 | 94 | $view->addressBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $client ) { |
|
96 | + foreach ($this->getSubClients() as $client) { |
|
97 | 97 | $view->addressBody .= $client->get(); |
98 | 98 | } |
99 | 99 | |
100 | - return $this->render( $view ); |
|
100 | + return $this->render($view); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -110,26 +110,26 @@ discard block |
||
110 | 110 | |
111 | 111 | try |
112 | 112 | { |
113 | - $this->fromArray( $view->item, $view->param( 'address', [] ) ); |
|
113 | + $this->fromArray($view->item, $view->param('address', [])); |
|
114 | 114 | $view->addressBody = ''; |
115 | 115 | |
116 | - foreach( $this->getSubClients() as $client ) { |
|
116 | + foreach ($this->getSubClients() as $client) { |
|
117 | 117 | $view->addressBody .= $client->save(); |
118 | 118 | } |
119 | 119 | |
120 | 120 | return; |
121 | 121 | } |
122 | - catch( \Aimeos\MShop\Exception $e ) |
|
122 | + catch (\Aimeos\MShop\Exception $e) |
|
123 | 123 | { |
124 | - $error = array( 'supplier-item-address' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
125 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
126 | - $this->logException( $e ); |
|
124 | + $error = array('supplier-item-address' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
125 | + $view->errors = $view->get('errors', []) + $error; |
|
126 | + $this->logException($e); |
|
127 | 127 | } |
128 | - catch( \Exception $e ) |
|
128 | + catch (\Exception $e) |
|
129 | 129 | { |
130 | - $error = array( 'supplier-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
131 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
132 | - $this->logException( $e ); |
|
130 | + $error = array('supplier-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
131 | + $view->errors = $view->get('errors', []) + $error; |
|
132 | + $this->logException($e); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param string|null $name Name of the sub-client (Default if null) |
144 | 144 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
145 | 145 | */ |
146 | - public function getSubClient( $type, $name = null ) |
|
146 | + public function getSubClient($type, $name = null) |
|
147 | 147 | { |
148 | 148 | /** admin/jqadm/supplier/address/decorators/excludes |
149 | 149 | * Excludes decorators added by the "common" option from the supplier JQAdm client |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @see admin/jqadm/supplier/address/decorators/excludes |
219 | 219 | * @see admin/jqadm/supplier/address/decorators/global |
220 | 220 | */ |
221 | - return $this->createSubClient( 'supplier/address/' . $type, $name ); |
|
221 | + return $this->createSubClient('supplier/address/' . $type, $name); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @since 2017.10 |
263 | 263 | * @category Developer |
264 | 264 | */ |
265 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/address/standard/subparts', [] ); |
|
265 | + return $this->getContext()->getConfig()->get('admin/jqadm/supplier/address/standard/subparts', []); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | |
@@ -272,29 +272,29 @@ discard block |
||
272 | 272 | * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object without referenced domain items |
273 | 273 | * @param string[] $data Data array |
274 | 274 | */ |
275 | - protected function fromArray( \Aimeos\MShop\Supplier\Item\Iface $item, array $data ) |
|
275 | + protected function fromArray(\Aimeos\MShop\Supplier\Item\Iface $item, array $data) |
|
276 | 276 | { |
277 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'supplier/address' ); |
|
277 | + $manager = \Aimeos\MShop::create($this->getContext(), 'supplier/address'); |
|
278 | 278 | |
279 | 279 | $addrItems = $item->getAddressItems(); |
280 | 280 | |
281 | - foreach( $data as $entry ) |
|
281 | + foreach ($data as $entry) |
|
282 | 282 | { |
283 | - if( isset( $addrItems[$entry['supplier.address.id']] ) ) |
|
283 | + if (isset($addrItems[$entry['supplier.address.id']])) |
|
284 | 284 | { |
285 | 285 | $addrItem = $addrItems[$entry['supplier.address.id']]; |
286 | - unset( $addrItems[$entry['supplier.address.id']] ); |
|
286 | + unset($addrItems[$entry['supplier.address.id']]); |
|
287 | 287 | } |
288 | 288 | else |
289 | 289 | { |
290 | 290 | $addrItem = $manager->createItem(); |
291 | 291 | } |
292 | 292 | |
293 | - $addrItem->fromArray( $entry ); |
|
294 | - $item->addAddressItem( $addrItem ); |
|
293 | + $addrItem->fromArray($entry); |
|
294 | + $item->addAddressItem($addrItem); |
|
295 | 295 | } |
296 | 296 | |
297 | - $item->deleteAddressItems( $addrItems ); |
|
297 | + $item->deleteAddressItems($addrItems); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | * @param boolean $copy True if items should be copied, false if not |
306 | 306 | * @return string[] Multi-dimensional associative list of item data |
307 | 307 | */ |
308 | - protected function toArray( \Aimeos\MShop\Supplier\Item\Iface $item, $copy = false ) |
|
308 | + protected function toArray(\Aimeos\MShop\Supplier\Item\Iface $item, $copy = false) |
|
309 | 309 | { |
310 | 310 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
311 | 311 | $data = []; |
312 | 312 | |
313 | - foreach( $item->getAddressItems() as $addrItem ) |
|
313 | + foreach ($item->getAddressItems() as $addrItem) |
|
314 | 314 | { |
315 | - $list = $addrItem->toArray( true ); |
|
315 | + $list = $addrItem->toArray(true); |
|
316 | 316 | |
317 | - if( $copy === true ) |
|
317 | + if ($copy === true) |
|
318 | 318 | { |
319 | 319 | $list['supplier.address.siteid'] = $siteId; |
320 | 320 | $list['supplier.address.id'] = ''; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
334 | 334 | * @return string HTML output |
335 | 335 | */ |
336 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
336 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
337 | 337 | { |
338 | 338 | /** admin/jqadm/supplier/address/template-item |
339 | 339 | * Relative path to the HTML body template of the address subpart for suppliers. |
@@ -357,6 +357,6 @@ discard block |
||
357 | 357 | $tplconf = 'admin/jqadm/supplier/address/template-item'; |
358 | 358 | $default = 'supplier/item-address-standard'; |
359 | 359 | |
360 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
360 | + return $view->render($view->config($tplconf, $default)); |
|
361 | 361 | } |
362 | 362 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Supplier; |
12 | 12 | |
13 | -sprintf( 'supplier' ); // for translation |
|
13 | +sprintf('supplier'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
43 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
43 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'supplier' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'supplier')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['supplier.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,39 +126,39 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
138 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->saveItem( $view->item ); |
|
145 | - $manager->deleteItem( $id ); |
|
144 | + $manager->saveItem($view->item); |
|
145 | + $manager->deleteItem($id); |
|
146 | 146 | $manager->commit(); |
147 | 147 | |
148 | - $this->nextAction( $view, 'search', 'supplier', null, 'delete' ); |
|
148 | + $this->nextAction($view, 'search', 'supplier', null, 'delete'); |
|
149 | 149 | return; |
150 | 150 | } |
151 | - catch( \Aimeos\MShop\Exception $e ) |
|
151 | + catch (\Aimeos\MShop\Exception $e) |
|
152 | 152 | { |
153 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
154 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
155 | - $this->logException( $e ); |
|
153 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
154 | + $view->errors = $view->get('errors', []) + $error; |
|
155 | + $this->logException($e); |
|
156 | 156 | } |
157 | - catch( \Exception $e ) |
|
157 | + catch (\Exception $e) |
|
158 | 158 | { |
159 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
160 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
161 | - $this->logException( $e ); |
|
159 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
160 | + $view->errors = $view->get('errors', []) + $error; |
|
161 | + $this->logException($e); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | $manager->rollback(); |
@@ -179,37 +179,37 @@ discard block |
||
179 | 179 | |
180 | 180 | try |
181 | 181 | { |
182 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
183 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
182 | + if (($id = $view->param('id')) === null) { |
|
183 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
184 | 184 | } |
185 | 185 | |
186 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
186 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
187 | 187 | |
188 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
188 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
189 | 189 | $view->itemSubparts = $this->getSubClientNames(); |
190 | - $view->itemData = $this->toArray( $view->item ); |
|
190 | + $view->itemData = $this->toArray($view->item); |
|
191 | 191 | $view->itemBody = ''; |
192 | 192 | |
193 | - foreach( $this->getSubClients() as $idx => $client ) |
|
193 | + foreach ($this->getSubClients() as $idx => $client) |
|
194 | 194 | { |
195 | 195 | $view->tabindex = ++$idx + 1; |
196 | 196 | $view->itemBody .= $client->get(); |
197 | 197 | } |
198 | 198 | } |
199 | - catch( \Aimeos\MShop\Exception $e ) |
|
199 | + catch (\Aimeos\MShop\Exception $e) |
|
200 | 200 | { |
201 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
202 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
203 | - $this->logException( $e ); |
|
201 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
202 | + $view->errors = $view->get('errors', []) + $error; |
|
203 | + $this->logException($e); |
|
204 | 204 | } |
205 | - catch( \Exception $e ) |
|
205 | + catch (\Exception $e) |
|
206 | 206 | { |
207 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
208 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
209 | - $this->logException( $e ); |
|
207 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
208 | + $view->errors = $view->get('errors', []) + $error; |
|
209 | + $this->logException($e); |
|
210 | 210 | } |
211 | 211 | |
212 | - return $this->render( $view ); |
|
212 | + return $this->render($view); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | |
@@ -223,40 +223,40 @@ discard block |
||
223 | 223 | $view = $this->getView(); |
224 | 224 | $context = $this->getContext(); |
225 | 225 | |
226 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
226 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
227 | 227 | $manager->begin(); |
228 | 228 | |
229 | 229 | try |
230 | 230 | { |
231 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
232 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
231 | + $item = $this->fromArray($view->param('item', [])); |
|
232 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
233 | 233 | $view->itemBody = ''; |
234 | 234 | |
235 | - foreach( $this->getSubClients() as $client ) { |
|
235 | + foreach ($this->getSubClients() as $client) { |
|
236 | 236 | $view->itemBody .= $client->save(); |
237 | 237 | } |
238 | 238 | |
239 | - $manager->saveItem( clone $view->item ); |
|
239 | + $manager->saveItem(clone $view->item); |
|
240 | 240 | $manager->commit(); |
241 | 241 | |
242 | - $this->nextAction( $view, $view->param( 'next' ), 'supplier', $view->item->getId(), 'save' ); |
|
242 | + $this->nextAction($view, $view->param('next'), 'supplier', $view->item->getId(), 'save'); |
|
243 | 243 | return; |
244 | 244 | } |
245 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
245 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
246 | 246 | { |
247 | 247 | // fall through to create |
248 | 248 | } |
249 | - catch( \Aimeos\MShop\Exception $e ) |
|
249 | + catch (\Aimeos\MShop\Exception $e) |
|
250 | 250 | { |
251 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
252 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
253 | - $this->logException( $e ); |
|
251 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
252 | + $view->errors = $view->get('errors', []) + $error; |
|
253 | + $this->logException($e); |
|
254 | 254 | } |
255 | - catch( \Exception $e ) |
|
255 | + catch (\Exception $e) |
|
256 | 256 | { |
257 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
258 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
259 | - $this->logException( $e ); |
|
257 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
258 | + $view->errors = $view->get('errors', []) + $error; |
|
259 | + $this->logException($e); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | $manager->rollback(); |
@@ -278,31 +278,31 @@ discard block |
||
278 | 278 | try |
279 | 279 | { |
280 | 280 | $total = 0; |
281 | - $params = $this->storeSearchParams( $view->param(), 'supplier' ); |
|
282 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
283 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
281 | + $params = $this->storeSearchParams($view->param(), 'supplier'); |
|
282 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
283 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
284 | 284 | |
285 | - $view->items = $manager->searchItems( $search, $this->getDomains(), $total ); |
|
286 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
285 | + $view->items = $manager->searchItems($search, $this->getDomains(), $total); |
|
286 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
287 | 287 | $view->filterOperators = $search->getOperators(); |
288 | 288 | $view->total = $total; |
289 | 289 | $view->itemBody = ''; |
290 | 290 | |
291 | - foreach( $this->getSubClients() as $client ) { |
|
291 | + foreach ($this->getSubClients() as $client) { |
|
292 | 292 | $view->itemBody .= $client->search(); |
293 | 293 | } |
294 | 294 | } |
295 | - catch( \Aimeos\MShop\Exception $e ) |
|
295 | + catch (\Aimeos\MShop\Exception $e) |
|
296 | 296 | { |
297 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
298 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
299 | - $this->logException( $e ); |
|
297 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
298 | + $view->errors = $view->get('errors', []) + $error; |
|
299 | + $this->logException($e); |
|
300 | 300 | } |
301 | - catch( \Exception $e ) |
|
301 | + catch (\Exception $e) |
|
302 | 302 | { |
303 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
304 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
305 | - $this->logException( $e ); |
|
303 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
304 | + $view->errors = $view->get('errors', []) + $error; |
|
305 | + $this->logException($e); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** admin/jqadm/supplier/template-list |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $tplconf = 'admin/jqadm/supplier/template-list'; |
328 | 328 | $default = 'supplier/list-standard'; |
329 | 329 | |
330 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
330 | + return $view->render($view->config($tplconf, $default)); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @param string|null $name Name of the sub-client (Default if null) |
339 | 339 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
340 | 340 | */ |
341 | - public function getSubClient( $type, $name = null ) |
|
341 | + public function getSubClient($type, $name = null) |
|
342 | 342 | { |
343 | 343 | /** admin/jqadm/supplier/decorators/excludes |
344 | 344 | * Excludes decorators added by the "common" option from the supplier JQAdm client |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * @see admin/jqadm/supplier/decorators/excludes |
414 | 414 | * @see admin/jqadm/supplier/decorators/global |
415 | 415 | */ |
416 | - return $this->createSubClient( 'supplier/' . $type, $name ); |
|
416 | + return $this->createSubClient('supplier/' . $type, $name); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | $domains = ['media', 'supplier/address', 'text']; |
439 | 439 | |
440 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/domains', $domains ); |
|
440 | + return $this->getContext()->getConfig()->get('admin/jqadm/supplier/domains', $domains); |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | * @since 2017.10 |
482 | 482 | * @category Developer |
483 | 483 | */ |
484 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/standard/subparts', [] ); |
|
484 | + return $this->getContext()->getConfig()->get('admin/jqadm/supplier/standard/subparts', []); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | |
@@ -492,17 +492,17 @@ discard block |
||
492 | 492 | * @param string[] Data array |
493 | 493 | * @return \Aimeos\MShop\Supplier\Item\Iface New supplier item object |
494 | 494 | */ |
495 | - protected function fromArray( array $data ) |
|
495 | + protected function fromArray(array $data) |
|
496 | 496 | { |
497 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'supplier' ); |
|
497 | + $manager = \Aimeos\MShop::create($this->getContext(), 'supplier'); |
|
498 | 498 | |
499 | - if( isset( $data['supplier.id'] ) && $data['supplier.id'] != '' ) { |
|
500 | - $item = $manager->getItem( $data['supplier.id'], $this->getDomains() ); |
|
499 | + if (isset($data['supplier.id']) && $data['supplier.id'] != '') { |
|
500 | + $item = $manager->getItem($data['supplier.id'], $this->getDomains()); |
|
501 | 501 | } else { |
502 | 502 | $item = $manager->createItem(); |
503 | 503 | } |
504 | 504 | |
505 | - $item->fromArray( $data ); |
|
505 | + $item->fromArray($data); |
|
506 | 506 | |
507 | 507 | return $item; |
508 | 508 | } |
@@ -514,11 +514,11 @@ discard block |
||
514 | 514 | * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object |
515 | 515 | * @return string[] Multi-dimensional associative list of item data |
516 | 516 | */ |
517 | - protected function toArray( \Aimeos\MShop\Supplier\Item\Iface $item, $copy = false ) |
|
517 | + protected function toArray(\Aimeos\MShop\Supplier\Item\Iface $item, $copy = false) |
|
518 | 518 | { |
519 | - $data = $item->toArray( true ); |
|
519 | + $data = $item->toArray(true); |
|
520 | 520 | |
521 | - if( $copy === true ) |
|
521 | + if ($copy === true) |
|
522 | 522 | { |
523 | 523 | $data['supplier.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
524 | 524 | $data['supplier.code'] = $data['supplier.code'] . '_copy'; |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
536 | 536 | * @return string HTML output |
537 | 537 | */ |
538 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
538 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
539 | 539 | { |
540 | 540 | /** admin/jqadm/supplier/template-item |
541 | 541 | * Relative path to the HTML body template for the supplier item. |
@@ -559,6 +559,6 @@ discard block |
||
559 | 559 | $tplconf = 'admin/jqadm/supplier/template-item'; |
560 | 560 | $default = 'supplier/item-standard'; |
561 | 561 | |
562 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
562 | + return $view->render($view->config($tplconf, $default)); |
|
563 | 563 | } |
564 | 564 | } |