@@ -40,24 +40,24 @@ discard block |
||
40 | 40 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Full order with associated items |
41 | 41 | * @return array Two dimensional associative list of order data representing the lines in CSV |
42 | 42 | */ |
43 | - public function process( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Base\Iface $order ) |
|
43 | + public function process(\Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Base\Iface $order) |
|
44 | 44 | { |
45 | 45 | $result = []; |
46 | 46 | |
47 | - foreach( $order->getProducts() as $item ) |
|
47 | + foreach ($order->getProducts() as $item) |
|
48 | 48 | { |
49 | - if( $subscription->getOrderProductId() != $item->getId() ) { |
|
49 | + if ($subscription->getOrderProductId() != $item->getId()) { |
|
50 | 50 | continue; |
51 | 51 | } |
52 | 52 | |
53 | 53 | $data = []; |
54 | 54 | $list = $item->toArray(); |
55 | 55 | |
56 | - foreach( $item->getAttributeItems() as $attrItem ) |
|
56 | + foreach ($item->getAttributeItems() as $attrItem) |
|
57 | 57 | { |
58 | - foreach( $attrItem->toArray() as $key => $value ) |
|
58 | + foreach ($attrItem->toArray() as $key => $value) |
|
59 | 59 | { |
60 | - if( isset( $list[$key] ) ) { |
|
60 | + if (isset($list[$key])) { |
|
61 | 61 | $list[$key] .= "\n" . $value; |
62 | 62 | } else { |
63 | 63 | $list[$key] = $value; |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | - foreach( $this->getMapping() as $pos => $key ) |
|
68 | + foreach ($this->getMapping() as $pos => $key) |
|
69 | 69 | { |
70 | - if( array_key_exists( $key, $list ) ) { |
|
70 | + if (array_key_exists($key, $list)) { |
|
71 | 71 | $data[$pos] = $list[$key]; |
72 | 72 | } else { |
73 | 73 | $data[$pos] = ''; |
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | - ksort( $data ); |
|
77 | + ksort($data); |
|
78 | 78 | $result[] = $data; |
79 | 79 | } |
80 | 80 |
@@ -40,20 +40,20 @@ discard block |
||
40 | 40 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Full order with associated items |
41 | 41 | * @return array Two dimensional associative list of order data representing the lines in CSV |
42 | 42 | */ |
43 | - public function process( \Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order ) |
|
43 | + public function process(\Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order) |
|
44 | 44 | { |
45 | 45 | $result = []; |
46 | 46 | |
47 | - foreach( $order->getProducts() as $item ) |
|
47 | + foreach ($order->getProducts() as $item) |
|
48 | 48 | { |
49 | 49 | $data = []; |
50 | 50 | $list = $item->toArray(); |
51 | 51 | |
52 | - foreach( $item->getAttributeItems() as $attrItem ) |
|
52 | + foreach ($item->getAttributeItems() as $attrItem) |
|
53 | 53 | { |
54 | - foreach( $attrItem->toArray() as $key => $value ) |
|
54 | + foreach ($attrItem->toArray() as $key => $value) |
|
55 | 55 | { |
56 | - if( isset( $list[$key] ) ) { |
|
56 | + if (isset($list[$key])) { |
|
57 | 57 | $list[$key] .= "\n" . $value; |
58 | 58 | } else { |
59 | 59 | $list[$key] = $value; |
@@ -61,16 +61,16 @@ discard block |
||
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | - foreach( $this->getMapping() as $pos => $key ) |
|
64 | + foreach ($this->getMapping() as $pos => $key) |
|
65 | 65 | { |
66 | - if( array_key_exists( $key, $list ) ) { |
|
66 | + if (array_key_exists($key, $list)) { |
|
67 | 67 | $data[$pos] = $list[$key]; |
68 | 68 | } else { |
69 | 69 | $data[$pos] = ''; |
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - ksort( $data ); |
|
73 | + ksort($data); |
|
74 | 74 | $result[] = $data; |
75 | 75 | } |
76 | 76 |
@@ -40,25 +40,25 @@ discard block |
||
40 | 40 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Full order with associated items |
41 | 41 | * @return array Two dimensional associative list of order data representing the lines in CSV |
42 | 42 | */ |
43 | - public function process( \Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order ) |
|
43 | + public function process(\Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order) |
|
44 | 44 | { |
45 | 45 | $result = []; |
46 | 46 | $services = $order->getServices(); |
47 | 47 | |
48 | - krsort( $services ); |
|
48 | + krsort($services); |
|
49 | 49 | |
50 | - foreach( $services as $list ) |
|
50 | + foreach ($services as $list) |
|
51 | 51 | { |
52 | - foreach( $list as $item ) |
|
52 | + foreach ($list as $item) |
|
53 | 53 | { |
54 | 54 | $data = []; |
55 | 55 | $list = $item->toArray(); |
56 | 56 | |
57 | - foreach( $item->getAttributeItems() as $attrItem ) |
|
57 | + foreach ($item->getAttributeItems() as $attrItem) |
|
58 | 58 | { |
59 | - foreach( $attrItem->toArray() as $key => $value ) |
|
59 | + foreach ($attrItem->toArray() as $key => $value) |
|
60 | 60 | { |
61 | - if( isset( $list[$key] ) ) { |
|
61 | + if (isset($list[$key])) { |
|
62 | 62 | $list[$key] .= "\n" . $value; |
63 | 63 | } else { |
64 | 64 | $list[$key] = $value; |
@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - foreach( $this->getMapping() as $pos => $key ) |
|
69 | + foreach ($this->getMapping() as $pos => $key) |
|
70 | 70 | { |
71 | - if( array_key_exists( $key, $list ) ) { |
|
71 | + if (array_key_exists($key, $list)) { |
|
72 | 72 | $data[$pos] = $list[$key]; |
73 | 73 | } else { |
74 | 74 | $data[$pos] = ''; |
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
78 | - ksort( $data ); |
|
78 | + ksort($data); |
|
79 | 79 | $result[] = $data; |
80 | 80 | } |
81 | 81 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $context = \TestHelperJobs::getContext(); |
21 | 21 | $aimeos = \TestHelperJobs::getAimeos(); |
22 | 22 | |
23 | - $this->object = new \Aimeos\Controller\Jobs\Order\Service\Delivery\Standard( $context, $aimeos ); |
|
23 | + $this->object = new \Aimeos\Controller\Jobs\Order\Service\Delivery\Standard($context, $aimeos); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | |
33 | 33 | public function testGetName() |
34 | 34 | { |
35 | - $this->assertEquals( 'Process order delivery services', $this->object->getName() ); |
|
35 | + $this->assertEquals('Process order delivery services', $this->object->getName()); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testGetDescription() |
40 | 40 | { |
41 | 41 | $text = 'Sends paid orders to the ERP system or logistic partner'; |
42 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
42 | + $this->assertEquals($text, $this->object->getDescription()); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -50,47 +50,47 @@ discard block |
||
50 | 50 | |
51 | 51 | |
52 | 52 | $name = 'ControllerJobsServiceDeliveryProcessDefaultRun'; |
53 | - $context->getConfig()->set( 'mshop/service/manager/name', $name ); |
|
54 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
53 | + $context->getConfig()->set('mshop/service/manager/name', $name); |
|
54 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
55 | 55 | |
56 | 56 | |
57 | - $serviceManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' ) |
|
58 | - ->setMethods( array( 'getProvider', 'searchItems' ) ) |
|
59 | - ->setConstructorArgs( array( $context ) ) |
|
57 | + $serviceManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard') |
|
58 | + ->setMethods(array('getProvider', 'searchItems')) |
|
59 | + ->setConstructorArgs(array($context)) |
|
60 | 60 | ->getMock(); |
61 | 61 | |
62 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
63 | - ->setMethods( array( 'saveItems', 'searchItems' ) ) |
|
64 | - ->setConstructorArgs( array( $context ) ) |
|
62 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
63 | + ->setMethods(array('saveItems', 'searchItems')) |
|
64 | + ->setConstructorArgs(array($context)) |
|
65 | 65 | ->getMock(); |
66 | 66 | |
67 | - \Aimeos\MShop\Service\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub ); |
|
68 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
67 | + \Aimeos\MShop\Service\Manager\Factory::injectManager('\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub); |
|
68 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub); |
|
69 | 69 | |
70 | 70 | |
71 | 71 | $serviceItem = $serviceManagerStub->createItem(); |
72 | 72 | $orderItem = $orderManagerStub->createItem(); |
73 | 73 | |
74 | - $serviceProviderStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard' ) |
|
75 | - ->setConstructorArgs( array( $context, $serviceItem ) ) |
|
74 | + $serviceProviderStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard') |
|
75 | + ->setConstructorArgs(array($context, $serviceItem)) |
|
76 | 76 | ->getMock(); |
77 | 77 | |
78 | 78 | |
79 | - $serviceManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
80 | - ->will( $this->onConsecutiveCalls( array( $serviceItem ), [] ) ); |
|
79 | + $serviceManagerStub->expects($this->once())->method('searchItems') |
|
80 | + ->will($this->onConsecutiveCalls(array($serviceItem), [])); |
|
81 | 81 | |
82 | - $serviceManagerStub->expects( $this->once() )->method( 'getProvider' ) |
|
83 | - ->will( $this->returnValue( $serviceProviderStub ) ); |
|
82 | + $serviceManagerStub->expects($this->once())->method('getProvider') |
|
83 | + ->will($this->returnValue($serviceProviderStub)); |
|
84 | 84 | |
85 | - $orderManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
86 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), [] ) ); |
|
85 | + $orderManagerStub->expects($this->once())->method('searchItems') |
|
86 | + ->will($this->onConsecutiveCalls(array($orderItem), [])); |
|
87 | 87 | |
88 | - $serviceProviderStub->expects( $this->once() )->method( 'processBatch' ); |
|
88 | + $serviceProviderStub->expects($this->once())->method('processBatch'); |
|
89 | 89 | |
90 | - $orderManagerStub->expects( $this->once() )->method( 'saveItems' ); |
|
90 | + $orderManagerStub->expects($this->once())->method('saveItems'); |
|
91 | 91 | |
92 | 92 | |
93 | - $object = new \Aimeos\Controller\Jobs\Order\Service\Delivery\Standard( $context, $aimeos ); |
|
93 | + $object = new \Aimeos\Controller\Jobs\Order\Service\Delivery\Standard($context, $aimeos); |
|
94 | 94 | $object->run(); |
95 | 95 | } |
96 | 96 | |
@@ -102,48 +102,48 @@ discard block |
||
102 | 102 | |
103 | 103 | |
104 | 104 | $name = 'ControllerJobsServiceDeliveryProcessDefaultRun'; |
105 | - $context->getConfig()->set( 'mshop/service/manager/name', $name ); |
|
106 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
105 | + $context->getConfig()->set('mshop/service/manager/name', $name); |
|
106 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
107 | 107 | |
108 | 108 | |
109 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
110 | - ->setMethods( array( 'saveItems', 'searchItems' ) ) |
|
111 | - ->setConstructorArgs( array( $context ) ) |
|
109 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
110 | + ->setMethods(array('saveItems', 'searchItems')) |
|
111 | + ->setConstructorArgs(array($context)) |
|
112 | 112 | ->getMock(); |
113 | 113 | |
114 | - $serviceManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' ) |
|
115 | - ->setMethods( array( 'getProvider', 'searchItems' ) ) |
|
116 | - ->setConstructorArgs( array( $context ) ) |
|
114 | + $serviceManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard') |
|
115 | + ->setMethods(array('getProvider', 'searchItems')) |
|
116 | + ->setConstructorArgs(array($context)) |
|
117 | 117 | ->getMock(); |
118 | 118 | |
119 | - \Aimeos\MShop\Service\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub ); |
|
120 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
119 | + \Aimeos\MShop\Service\Manager\Factory::injectManager('\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub); |
|
120 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub); |
|
121 | 121 | |
122 | 122 | |
123 | 123 | $serviceItem = $serviceManagerStub->createItem(); |
124 | 124 | $orderItem = $orderManagerStub->createItem(); |
125 | 125 | |
126 | - $serviceProviderStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard' ) |
|
127 | - ->setConstructorArgs( array( $context, $serviceItem ) ) |
|
126 | + $serviceProviderStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard') |
|
127 | + ->setConstructorArgs(array($context, $serviceItem)) |
|
128 | 128 | ->getMock(); |
129 | 129 | |
130 | 130 | |
131 | - $serviceManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
132 | - ->will( $this->onConsecutiveCalls( array( $serviceItem ), [] ) ); |
|
131 | + $serviceManagerStub->expects($this->once())->method('searchItems') |
|
132 | + ->will($this->onConsecutiveCalls(array($serviceItem), [])); |
|
133 | 133 | |
134 | - $serviceManagerStub->expects( $this->once() )->method( 'getProvider' ) |
|
135 | - ->will( $this->returnValue( $serviceProviderStub ) ); |
|
134 | + $serviceManagerStub->expects($this->once())->method('getProvider') |
|
135 | + ->will($this->returnValue($serviceProviderStub)); |
|
136 | 136 | |
137 | - $orderManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
138 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), [] ) ); |
|
137 | + $orderManagerStub->expects($this->once())->method('searchItems') |
|
138 | + ->will($this->onConsecutiveCalls(array($orderItem), [])); |
|
139 | 139 | |
140 | - $serviceProviderStub->expects( $this->once() )->method( 'processBatch' ) |
|
141 | - ->will( $this->throwException( new \Aimeos\MShop\Service\Exception( 'test order service delivery: process' ) ) ); |
|
140 | + $serviceProviderStub->expects($this->once())->method('processBatch') |
|
141 | + ->will($this->throwException(new \Aimeos\MShop\Service\Exception('test order service delivery: process'))); |
|
142 | 142 | |
143 | - $orderManagerStub->expects( $this->never() )->method( 'saveItems' ); |
|
143 | + $orderManagerStub->expects($this->never())->method('saveItems'); |
|
144 | 144 | |
145 | 145 | |
146 | - $object = new \Aimeos\Controller\Jobs\Order\Service\Delivery\Standard( $context, $aimeos ); |
|
146 | + $object = new \Aimeos\Controller\Jobs\Order\Service\Delivery\Standard($context, $aimeos); |
|
147 | 147 | $object->run(); |
148 | 148 | } |
149 | 149 | |
@@ -155,36 +155,36 @@ discard block |
||
155 | 155 | |
156 | 156 | |
157 | 157 | $name = 'ControllerJobsServiceDeliveryProcessDefaultRun'; |
158 | - $context->getConfig()->set( 'mshop/service/manager/name', $name ); |
|
159 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
158 | + $context->getConfig()->set('mshop/service/manager/name', $name); |
|
159 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
160 | 160 | |
161 | 161 | |
162 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
163 | - ->setMethods( array( 'saveItem', 'searchItems' ) ) |
|
164 | - ->setConstructorArgs( array( $context ) ) |
|
162 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
163 | + ->setMethods(array('saveItem', 'searchItems')) |
|
164 | + ->setConstructorArgs(array($context)) |
|
165 | 165 | ->getMock(); |
166 | 166 | |
167 | - $serviceManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' ) |
|
168 | - ->setMethods( array( 'getProvider', 'searchItems' ) ) |
|
169 | - ->setConstructorArgs( array( $context ) ) |
|
167 | + $serviceManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard') |
|
168 | + ->setMethods(array('getProvider', 'searchItems')) |
|
169 | + ->setConstructorArgs(array($context)) |
|
170 | 170 | ->getMock(); |
171 | 171 | |
172 | - \Aimeos\MShop\Service\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub ); |
|
173 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
172 | + \Aimeos\MShop\Service\Manager\Factory::injectManager('\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub); |
|
173 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub); |
|
174 | 174 | |
175 | 175 | |
176 | 176 | $serviceItem = $serviceManagerStub->createItem(); |
177 | 177 | |
178 | - $serviceManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
179 | - ->will( $this->onConsecutiveCalls( array( $serviceItem ), [] ) ); |
|
178 | + $serviceManagerStub->expects($this->once())->method('searchItems') |
|
179 | + ->will($this->onConsecutiveCalls(array($serviceItem), [])); |
|
180 | 180 | |
181 | - $serviceManagerStub->expects( $this->once() )->method( 'getProvider' ) |
|
182 | - ->will( $this->throwException( new \Aimeos\MShop\Service\Exception( 'test sorder service delivery: getProvider' ) ) ); |
|
181 | + $serviceManagerStub->expects($this->once())->method('getProvider') |
|
182 | + ->will($this->throwException(new \Aimeos\MShop\Service\Exception('test sorder service delivery: getProvider'))); |
|
183 | 183 | |
184 | - $orderManagerStub->expects( $this->never() )->method( 'searchItems' ); |
|
184 | + $orderManagerStub->expects($this->never())->method('searchItems'); |
|
185 | 185 | |
186 | 186 | |
187 | - $object = new \Aimeos\Controller\Jobs\Order\Service\Delivery\Standard( $context, $aimeos ); |
|
187 | + $object = new \Aimeos\Controller\Jobs\Order\Service\Delivery\Standard($context, $aimeos); |
|
188 | 188 | $object->run(); |
189 | 189 | } |
190 | 190 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $context = \TestHelperJobs::getContext(); |
21 | 21 | $aimeos = \TestHelperJobs::getAimeos(); |
22 | 22 | |
23 | - $this->object = new \Aimeos\Controller\Jobs\Order\Service\Async\Standard( $context, $aimeos ); |
|
23 | + $this->object = new \Aimeos\Controller\Jobs\Order\Service\Async\Standard($context, $aimeos); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | |
33 | 33 | public function testGetName() |
34 | 34 | { |
35 | - $this->assertEquals( 'Batch update of payment/delivery status', $this->object->getName() ); |
|
35 | + $this->assertEquals('Batch update of payment/delivery status', $this->object->getName()); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testGetDescription() |
40 | 40 | { |
41 | 41 | $text = 'Executes payment or delivery service providers that uses batch updates'; |
42 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
42 | + $this->assertEquals($text, $this->object->getDescription()); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -50,34 +50,34 @@ discard block |
||
50 | 50 | |
51 | 51 | |
52 | 52 | $name = 'ControllerJobsServiceAsyncProcessDefaultRun'; |
53 | - $context->getConfig()->set( 'mshop/service/manager/name', $name ); |
|
53 | + $context->getConfig()->set('mshop/service/manager/name', $name); |
|
54 | 54 | |
55 | 55 | |
56 | - $serviceManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' ) |
|
57 | - ->setMethods( array( 'getProvider', 'searchItems' ) ) |
|
58 | - ->setConstructorArgs( array( $context ) ) |
|
56 | + $serviceManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard') |
|
57 | + ->setMethods(array('getProvider', 'searchItems')) |
|
58 | + ->setConstructorArgs(array($context)) |
|
59 | 59 | ->getMock(); |
60 | 60 | |
61 | - \Aimeos\MShop\Service\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub ); |
|
61 | + \Aimeos\MShop\Service\Manager\Factory::injectManager('\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub); |
|
62 | 62 | |
63 | 63 | |
64 | 64 | $serviceItem = $serviceManagerStub->createItem(); |
65 | 65 | |
66 | - $serviceProviderStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard' ) |
|
67 | - ->setConstructorArgs( array( $context, $serviceItem ) ) |
|
66 | + $serviceProviderStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard') |
|
67 | + ->setConstructorArgs(array($context, $serviceItem)) |
|
68 | 68 | ->getMock(); |
69 | 69 | |
70 | 70 | |
71 | - $serviceManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
72 | - ->will( $this->onConsecutiveCalls( array( $serviceItem ), [] ) ); |
|
71 | + $serviceManagerStub->expects($this->once())->method('searchItems') |
|
72 | + ->will($this->onConsecutiveCalls(array($serviceItem), [])); |
|
73 | 73 | |
74 | - $serviceManagerStub->expects( $this->once() )->method( 'getProvider' ) |
|
75 | - ->will( $this->returnValue( $serviceProviderStub ) ); |
|
74 | + $serviceManagerStub->expects($this->once())->method('getProvider') |
|
75 | + ->will($this->returnValue($serviceProviderStub)); |
|
76 | 76 | |
77 | - $serviceProviderStub->expects( $this->once() )->method( 'updateAsync' ); |
|
77 | + $serviceProviderStub->expects($this->once())->method('updateAsync'); |
|
78 | 78 | |
79 | 79 | |
80 | - $object = new \Aimeos\Controller\Jobs\Order\Service\Async\Standard( $context, $aimeos ); |
|
80 | + $object = new \Aimeos\Controller\Jobs\Order\Service\Async\Standard($context, $aimeos); |
|
81 | 81 | $object->run(); |
82 | 82 | } |
83 | 83 | |
@@ -89,27 +89,27 @@ discard block |
||
89 | 89 | |
90 | 90 | |
91 | 91 | $name = 'ControllerJobsServiceAsyncProcessDefaultRun'; |
92 | - $context->getConfig()->set( 'mshop/service/manager/name', $name ); |
|
92 | + $context->getConfig()->set('mshop/service/manager/name', $name); |
|
93 | 93 | |
94 | 94 | |
95 | - $serviceManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' ) |
|
96 | - ->setMethods( array( 'getProvider', 'searchItems' ) ) |
|
97 | - ->setConstructorArgs( array( $context ) ) |
|
95 | + $serviceManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard') |
|
96 | + ->setMethods(array('getProvider', 'searchItems')) |
|
97 | + ->setConstructorArgs(array($context)) |
|
98 | 98 | ->getMock(); |
99 | 99 | |
100 | - \Aimeos\MShop\Service\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub ); |
|
100 | + \Aimeos\MShop\Service\Manager\Factory::injectManager('\\Aimeos\\MShop\\Service\\Manager\\' . $name, $serviceManagerStub); |
|
101 | 101 | |
102 | 102 | |
103 | 103 | $serviceItem = $serviceManagerStub->createItem(); |
104 | 104 | |
105 | - $serviceManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
106 | - ->will( $this->onConsecutiveCalls( array( $serviceItem ), [] ) ); |
|
105 | + $serviceManagerStub->expects($this->once())->method('searchItems') |
|
106 | + ->will($this->onConsecutiveCalls(array($serviceItem), [])); |
|
107 | 107 | |
108 | - $serviceManagerStub->expects( $this->once() )->method( 'getProvider' ) |
|
109 | - ->will( $this->throwException( new \Aimeos\MShop\Service\Exception() ) ); |
|
108 | + $serviceManagerStub->expects($this->once())->method('getProvider') |
|
109 | + ->will($this->throwException(new \Aimeos\MShop\Service\Exception())); |
|
110 | 110 | |
111 | 111 | |
112 | - $object = new \Aimeos\Controller\Jobs\Order\Service\Async\Standard( $context, $aimeos ); |
|
112 | + $object = new \Aimeos\Controller\Jobs\Order\Service\Async\Standard($context, $aimeos); |
|
113 | 113 | $object->run(); |
114 | 114 | } |
115 | 115 | } |
@@ -7,19 +7,19 @@ |
||
7 | 7 | |
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | -$detailTarget = $this->config( 'client/html/catalog/detail/url/target' ); |
|
11 | -$detailCntl = $this->config( 'client/html/catalog/detail/url/controller', 'catalog' ); |
|
12 | -$detailAction = $this->config( 'client/html/catalog/detail/url/action', 'detail' ); |
|
13 | -$detailConfig = $this->config( 'client/html/catalog/detail/url/config', [] ); |
|
10 | +$detailTarget = $this->config('client/html/catalog/detail/url/target'); |
|
11 | +$detailCntl = $this->config('client/html/catalog/detail/url/controller', 'catalog'); |
|
12 | +$detailAction = $this->config('client/html/catalog/detail/url/action', 'detail'); |
|
13 | +$detailConfig = $this->config('client/html/catalog/detail/url/config', []); |
|
14 | 14 | |
15 | -$freq = $enc->xml( $this->get( 'siteFreq', 'daily' ) ); |
|
15 | +$freq = $enc->xml($this->get('siteFreq', 'daily')); |
|
16 | 16 | |
17 | 17 | ?> |
18 | -<?php foreach( $this->get( 'siteItems', [] ) as $id => $item ) : ?> |
|
18 | +<?php foreach ($this->get('siteItems', []) as $id => $item) : ?> |
|
19 | 19 | <?php |
20 | - $date = str_replace( ' ', 'T', $item->getTimeModified() ) . date( 'P' ); |
|
21 | - $params = array( 'd_name' => $item->getName( 'url' ), 'd_prodid' => $id ); |
|
22 | - $url = $this->url( $detailTarget, $detailCntl, $detailAction, $params, [], $detailConfig ); |
|
20 | + $date = str_replace(' ', 'T', $item->getTimeModified()) . date('P'); |
|
21 | + $params = array('d_name' => $item->getName('url'), 'd_prodid' => $id); |
|
22 | + $url = $this->url($detailTarget, $detailCntl, $detailAction, $params, [], $detailConfig); |
|
23 | 23 | ?> |
24 | - <url><loc><?php echo $enc->xml( $url ); ?></loc><lastmod><?php echo $date; ?></lastmod><changefreq><?php echo $freq; ?></changefreq></url> |
|
24 | + <url><loc><?php echo $enc->xml($url); ?></loc><lastmod><?php echo $date; ?></lastmod><changefreq><?php echo $freq; ?></changefreq></url> |
|
25 | 25 | <?php endforeach; ?> |
@@ -6,16 +6,16 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | $enc = $this->encoder(); |
9 | -$date = date( 'c' ); |
|
9 | +$date = date('c'); |
|
10 | 10 | |
11 | 11 | ?> |
12 | 12 | <?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> |
13 | 13 | |
14 | 14 | |
15 | 15 | <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> |
16 | -<?php foreach( $this->get( 'siteFiles', [] ) as $name ) : ?> |
|
16 | +<?php foreach ($this->get('siteFiles', []) as $name) : ?> |
|
17 | 17 | <sitemap> |
18 | - <loc><?php echo $enc->xml( basename( $name ) ); ?></loc> |
|
18 | + <loc><?php echo $enc->xml(basename($name)); ?></loc> |
|
19 | 19 | <lastmod><?php echo $date; ?></lastmod> |
20 | 20 | </sitemap> |
21 | 21 | <?php endforeach; ?> |
@@ -27,14 +27,14 @@ discard block |
||
27 | 27 | * @param array $data Associative list of catalog codes and lists of CSV field indexes and their data |
28 | 28 | * @return array Associative list of CSV field indexes and their converted data |
29 | 29 | */ |
30 | - protected function convertData( array $convlist, array $data ) |
|
30 | + protected function convertData(array $convlist, array $data) |
|
31 | 31 | { |
32 | - foreach( $convlist as $idx => $converter ) |
|
32 | + foreach ($convlist as $idx => $converter) |
|
33 | 33 | { |
34 | - foreach( $data as $code => $list ) |
|
34 | + foreach ($data as $code => $list) |
|
35 | 35 | { |
36 | - if( isset( $list[$idx] ) ) { |
|
37 | - $data[$code][$idx] = $converter->translate( $list[$idx] ); |
|
36 | + if (isset($list[$idx])) { |
|
37 | + $data[$code][$idx] = $converter->translate($list[$idx]); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | } |
@@ -50,36 +50,36 @@ discard block |
||
50 | 50 | * @param string|null Name of the cache implementation |
51 | 51 | * @return \Aimeos\Controller\Common\Catalog\Import\Csv\Cache\Iface Cache object |
52 | 52 | */ |
53 | - protected function getCache( $type, $name = null ) |
|
53 | + protected function getCache($type, $name = null) |
|
54 | 54 | { |
55 | 55 | $context = $this->getContext(); |
56 | 56 | $config = $context->getConfig(); |
57 | 57 | |
58 | - if( ctype_alnum( $type ) === false ) |
|
58 | + if (ctype_alnum($type) === false) |
|
59 | 59 | { |
60 | 60 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Cache\\' . $type : '<not a string>'; |
61 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
61 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
62 | 62 | } |
63 | 63 | |
64 | - if( $name === null ) { |
|
65 | - $name = $config->get( 'controller/common/catalog/import/csv/cache/' . $type . '/name', 'Standard' ); |
|
64 | + if ($name === null) { |
|
65 | + $name = $config->get('controller/common/catalog/import/csv/cache/' . $type . '/name', 'Standard'); |
|
66 | 66 | } |
67 | 67 | |
68 | - if( ctype_alnum( $name ) === false ) |
|
68 | + if (ctype_alnum($name) === false) |
|
69 | 69 | { |
70 | 70 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Cache\\' . $type . '\\' . $name : '<not a string>'; |
71 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
71 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
72 | 72 | } |
73 | 73 | |
74 | - $classname = '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Cache\\' . ucfirst( $type ) . '\\' . $name; |
|
74 | + $classname = '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Cache\\' . ucfirst($type) . '\\' . $name; |
|
75 | 75 | |
76 | - if( class_exists( $classname ) === false ) { |
|
77 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Class "%1$s" not found', $classname ) ); |
|
76 | + if (class_exists($classname) === false) { |
|
77 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Class "%1$s" not found', $classname)); |
|
78 | 78 | } |
79 | 79 | |
80 | - $object = new $classname( $context ); |
|
80 | + $object = new $classname($context); |
|
81 | 81 | |
82 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Cache\\Iface', $object ); |
|
82 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Cache\\Iface', $object); |
|
83 | 83 | |
84 | 84 | return $object; |
85 | 85 | } |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | * @param array $convmap List of converter names for the values at the position in the CSV file |
92 | 92 | * @return array Associative list of positions and converter objects |
93 | 93 | */ |
94 | - protected function getConverterList( array $convmap ) |
|
94 | + protected function getConverterList(array $convmap) |
|
95 | 95 | { |
96 | 96 | $convlist = []; |
97 | 97 | |
98 | - foreach( $convmap as $idx => $name ) { |
|
99 | - $convlist[$idx] = \Aimeos\MW\Convert\Factory::createConverter( $name ); |
|
98 | + foreach ($convmap as $idx => $name) { |
|
99 | + $convlist[$idx] = \Aimeos\MW\Convert\Factory::createConverter($name); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | return $convlist; |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | * @param integer $codePos Column position which contains the unique catalog code (starting from 0) |
112 | 112 | * @return array List of arrays with catalog codes as keys and list of values from the CSV file |
113 | 113 | */ |
114 | - protected function getData( \Aimeos\MW\Container\Content\Iface $content, $maxcnt, $codePos ) |
|
114 | + protected function getData(\Aimeos\MW\Container\Content\Iface $content, $maxcnt, $codePos) |
|
115 | 115 | { |
116 | 116 | $count = 0; |
117 | 117 | $data = []; |
118 | 118 | |
119 | - while( $content->valid() && $count++ < $maxcnt ) |
|
119 | + while ($content->valid() && $count++ < $maxcnt) |
|
120 | 120 | { |
121 | 121 | $row = $content->current(); |
122 | - $data[ $row[$codePos] ] = $row; |
|
122 | + $data[$row[$codePos]] = $row; |
|
123 | 123 | $content->next(); |
124 | 124 | } |
125 | 125 | |
@@ -175,21 +175,21 @@ discard block |
||
175 | 175 | * @param array $mapping List of domain item keys with the CSV field position as key |
176 | 176 | * @return array List of associative arrays containing the chunked properties |
177 | 177 | */ |
178 | - protected function getMappedChunk( array &$data, array $mapping ) |
|
178 | + protected function getMappedChunk(array &$data, array $mapping) |
|
179 | 179 | { |
180 | 180 | $idx = 0; |
181 | 181 | $map = []; |
182 | 182 | |
183 | - foreach( $mapping as $pos => $key ) |
|
183 | + foreach ($mapping as $pos => $key) |
|
184 | 184 | { |
185 | - if( isset( $map[$idx][$key] ) ) { |
|
185 | + if (isset($map[$idx][$key])) { |
|
186 | 186 | $idx++; |
187 | 187 | } |
188 | 188 | |
189 | - if( isset( $data[$pos] ) ) |
|
189 | + if (isset($data[$pos])) |
|
190 | 190 | { |
191 | 191 | $map[$idx][$key] = $data[$pos]; |
192 | - unset( $data[$pos] ); |
|
192 | + unset($data[$pos]); |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
@@ -203,37 +203,37 @@ discard block |
||
203 | 203 | * @param array $mappings Associative list of processor types as keys and index/data mappings as values |
204 | 204 | * @return \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface Processor object |
205 | 205 | */ |
206 | - protected function getProcessors( array $mappings ) |
|
206 | + protected function getProcessors(array $mappings) |
|
207 | 207 | { |
208 | 208 | $context = $this->getContext(); |
209 | 209 | $config = $context->getConfig(); |
210 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done( $context, [] ); |
|
210 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done($context, []); |
|
211 | 211 | |
212 | - foreach( $mappings as $type => $mapping ) |
|
212 | + foreach ($mappings as $type => $mapping) |
|
213 | 213 | { |
214 | - if( ctype_alnum( $type ) === false ) |
|
214 | + if (ctype_alnum($type) === false) |
|
215 | 215 | { |
216 | 216 | $classname = is_string($type) ? '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\' . $type : '<not a string>'; |
217 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
217 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
218 | 218 | } |
219 | 219 | |
220 | - $name = $config->get( 'controller/common/catalog/import/csv/processor/' . $type . '/name', 'Standard' ); |
|
220 | + $name = $config->get('controller/common/catalog/import/csv/processor/' . $type . '/name', 'Standard'); |
|
221 | 221 | |
222 | - if( ctype_alnum( $name ) === false ) |
|
222 | + if (ctype_alnum($name) === false) |
|
223 | 223 | { |
224 | 224 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\' . $type . '\\' . $name : '<not a string>'; |
225 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
225 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
226 | 226 | } |
227 | 227 | |
228 | - $classname = '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\' . ucfirst( $type ) . '\\' . $name; |
|
228 | + $classname = '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\' . ucfirst($type) . '\\' . $name; |
|
229 | 229 | |
230 | - if( class_exists( $classname ) === false ) { |
|
231 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Class "%1$s" not found', $classname ) ); |
|
230 | + if (class_exists($classname) === false) { |
|
231 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Class "%1$s" not found', $classname)); |
|
232 | 232 | } |
233 | 233 | |
234 | - $object = new $classname( $context, $mapping, $object ); |
|
234 | + $object = new $classname($context, $mapping, $object); |
|
235 | 235 | |
236 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $object ); |
|
236 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $object); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | return $object; |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | * @param array $mapping Associative list of field position in CSV as key and domain item key as value |
33 | 33 | * @param \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $object Decorated processor |
34 | 34 | */ |
35 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
36 | - \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $object = null ) |
|
35 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
36 | + \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $object = null) |
|
37 | 37 | { |
38 | 38 | $this->context = $context; |
39 | 39 | $this->mapping = $mapping; |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | * @param integer $pos Computed position of the list item in the associated list of items |
49 | 49 | * @return array Given associative list enriched by default values if they were not already set |
50 | 50 | */ |
51 | - protected function addListItemDefaults( array $list, $pos ) |
|
51 | + protected function addListItemDefaults(array $list, $pos) |
|
52 | 52 | { |
53 | - if( !isset( $list['product.lists.position'] ) ) { |
|
53 | + if (!isset($list['product.lists.position'])) { |
|
54 | 54 | $list['product.lists.position'] = $pos; |
55 | 55 | } |
56 | 56 | |
57 | - if( !isset( $list['product.lists.status'] ) ) { |
|
57 | + if (!isset($list['product.lists.status'])) { |
|
58 | 58 | $list['product.lists.status'] = 1; |
59 | 59 | } |
60 | 60 | |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function getObject() |
94 | 94 | { |
95 | - if( $this->object === null ) { |
|
96 | - throw new \Aimeos\Controller\Jobs\Exception( 'No processor object available' ); |
|
95 | + if ($this->object === null) { |
|
96 | + throw new \Aimeos\Controller\Jobs\Exception('No processor object available'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $this->object; |