@@ -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\\Manual' ) |
|
| 75 | - ->setConstructorArgs( array( $context, $serviceItem ) ) |
|
| 74 | + $serviceProviderStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Manual') |
|
| 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\\Manual' ) |
|
| 127 | - ->setConstructorArgs( array( $context, $serviceItem ) ) |
|
| 126 | + $serviceProviderStub = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Manual') |
|
| 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 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function getName() |
| 31 | 31 | { |
| 32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Process order delivery services' ); |
|
| 32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Process order delivery services'); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function getDescription() |
| 42 | 42 | { |
| 43 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Sends paid orders to the ERP system or logistic partner' ); |
|
| 43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Sends paid orders to the ERP system or logistic partner'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | * @see controller/jobs/order/email/delivery/standard/limit-days |
| 70 | 70 | * @see controller/jobs/order/service/delivery/batch-max |
| 71 | 71 | */ |
| 72 | - $days = $context->getConfig()->get( 'controller/jobs/order/service/delivery/limit-days', 90 ); |
|
| 73 | - $date = date( 'Y-m-d 00:00:00', time() - 86400 * $days ); |
|
| 72 | + $days = $context->getConfig()->get('controller/jobs/order/service/delivery/limit-days', 90); |
|
| 73 | + $date = date('Y-m-d 00:00:00', time() - 86400 * $days); |
|
| 74 | 74 | |
| 75 | 75 | /** controller/jobs/order/service/delivery/batch-max |
| 76 | 76 | * Maximum number of orders processed at once by the delivery service provider |
@@ -85,71 +85,71 @@ discard block |
||
| 85 | 85 | * @category Developer |
| 86 | 86 | * @see controller/jobs/order/service/delivery/limit-days |
| 87 | 87 | */ |
| 88 | - $maxItems = $context->getConfig()->get( 'controller/jobs/order/service/delivery/batch-max', 100 ); |
|
| 88 | + $maxItems = $context->getConfig()->get('controller/jobs/order/service/delivery/batch-max', 100); |
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | - $serviceManager = \Aimeos\MShop\Service\Manager\Factory::createManager( $context ); |
|
| 91 | + $serviceManager = \Aimeos\MShop\Service\Manager\Factory::createManager($context); |
|
| 92 | 92 | $serviceSearch = $serviceManager->createSearch(); |
| 93 | - $serviceSearch->setConditions( $serviceSearch->compare( '==', 'service.type.code', 'delivery' ) ); |
|
| 93 | + $serviceSearch->setConditions($serviceSearch->compare('==', 'service.type.code', 'delivery')); |
|
| 94 | 94 | |
| 95 | - $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ); |
|
| 95 | + $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager($context); |
|
| 96 | 96 | $orderSearch = $orderManager->createSearch(); |
| 97 | 97 | |
| 98 | 98 | $start = 0; |
| 99 | 99 | |
| 100 | 100 | do |
| 101 | 101 | { |
| 102 | - $serviceItems = $serviceManager->searchItems( $serviceSearch ); |
|
| 102 | + $serviceItems = $serviceManager->searchItems($serviceSearch); |
|
| 103 | 103 | |
| 104 | - foreach( $serviceItems as $serviceItem ) |
|
| 104 | + foreach ($serviceItems as $serviceItem) |
|
| 105 | 105 | { |
| 106 | 106 | try |
| 107 | 107 | { |
| 108 | - $serviceProvider = $serviceManager->getProvider( $serviceItem, $serviceItem->getType() ); |
|
| 108 | + $serviceProvider = $serviceManager->getProvider($serviceItem, $serviceItem->getType()); |
|
| 109 | 109 | |
| 110 | 110 | $expr = array( |
| 111 | - $orderSearch->compare( '>', 'order.datepayment', $date ), |
|
| 112 | - $orderSearch->compare( '>', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_PENDING ), |
|
| 113 | - $orderSearch->compare( '==', 'order.statusdelivery', \Aimeos\MShop\Order\Item\Base::STAT_UNFINISHED ), |
|
| 114 | - $orderSearch->compare( '==', 'order.base.service.code', $serviceItem->getCode() ), |
|
| 115 | - $orderSearch->compare( '==', 'order.base.service.type', 'delivery' ), |
|
| 111 | + $orderSearch->compare('>', 'order.datepayment', $date), |
|
| 112 | + $orderSearch->compare('>', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_PENDING), |
|
| 113 | + $orderSearch->compare('==', 'order.statusdelivery', \Aimeos\MShop\Order\Item\Base::STAT_UNFINISHED), |
|
| 114 | + $orderSearch->compare('==', 'order.base.service.code', $serviceItem->getCode()), |
|
| 115 | + $orderSearch->compare('==', 'order.base.service.type', 'delivery'), |
|
| 116 | 116 | ); |
| 117 | - $orderSearch->setConditions( $orderSearch->combine( '&&', $expr ) ); |
|
| 117 | + $orderSearch->setConditions($orderSearch->combine('&&', $expr)); |
|
| 118 | 118 | |
| 119 | 119 | $orderStart = 0; |
| 120 | 120 | |
| 121 | 121 | do |
| 122 | 122 | { |
| 123 | - $orderSearch->setSlice( $orderStart, $maxItems ); |
|
| 124 | - $orderItems = $orderManager->searchItems( $orderSearch ); |
|
| 123 | + $orderSearch->setSlice($orderStart, $maxItems); |
|
| 124 | + $orderItems = $orderManager->searchItems($orderSearch); |
|
| 125 | 125 | |
| 126 | 126 | try |
| 127 | 127 | { |
| 128 | - $serviceProvider->processBatch( $orderItems ); |
|
| 129 | - $orderManager->saveItems( $orderItems ); |
|
| 128 | + $serviceProvider->processBatch($orderItems); |
|
| 129 | + $orderManager->saveItems($orderItems); |
|
| 130 | 130 | } |
| 131 | - catch( \Exception $e ) |
|
| 131 | + catch (\Exception $e) |
|
| 132 | 132 | { |
| 133 | 133 | $str = 'Error while processing order with ID "%1$s": %2$s'; |
| 134 | - $context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) ); |
|
| 134 | + $context->getLogger()->log(sprintf($str, $orderItem->getId(), $e->getMessage())); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $orderCount = count( $orderItems ); |
|
| 137 | + $orderCount = count($orderItems); |
|
| 138 | 138 | $orderStart += $orderCount; |
| 139 | 139 | } |
| 140 | - while( $orderCount >= $orderSearch->getSliceSize() ); |
|
| 140 | + while ($orderCount >= $orderSearch->getSliceSize()); |
|
| 141 | 141 | } |
| 142 | - catch( \Exception $e ) |
|
| 142 | + catch (\Exception $e) |
|
| 143 | 143 | { |
| 144 | 144 | $str = 'Error while processing service with ID "%1$s": %2$s'; |
| 145 | - $context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) ); |
|
| 145 | + $context->getLogger()->log(sprintf($str, $serviceItem->getId(), $e->getMessage())); |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - $count = count( $serviceItems ); |
|
| 149 | + $count = count($serviceItems); |
|
| 150 | 150 | $start += $count; |
| 151 | - $serviceSearch->setSlice( $start ); |
|
| 151 | + $serviceSearch->setSlice($start); |
|
| 152 | 152 | } |
| 153 | - while( $count >= $serviceSearch->getSliceSize() ); |
|
| 153 | + while ($count >= $serviceSearch->getSliceSize()); |
|
| 154 | 154 | } |
| 155 | 155 | } |
@@ -127,8 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $serviceProvider->processBatch( $orderItems ); |
| 129 | 129 | $orderManager->saveItems( $orderItems ); |
| 130 | - } |
|
| 131 | - catch( \Exception $e ) |
|
| 130 | + } catch( \Exception $e ) |
|
| 132 | 131 | { |
| 133 | 132 | $str = 'Error while processing order with ID "%1$s": %2$s'; |
| 134 | 133 | $context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) ); |
@@ -138,8 +137,7 @@ discard block |
||
| 138 | 137 | $orderStart += $orderCount; |
| 139 | 138 | } |
| 140 | 139 | while( $orderCount >= $orderSearch->getSliceSize() ); |
| 141 | - } |
|
| 142 | - catch( \Exception $e ) |
|
| 140 | + } catch( \Exception $e ) |
|
| 143 | 141 | { |
| 144 | 142 | $str = 'Error while processing service with ID "%1$s": %2$s'; |
| 145 | 143 | $context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) ); |