@@ -14,44 +14,44 @@ |
||
14 | 14 | |
15 | 15 | protected function setUp() |
16 | 16 | { |
17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
17 | + \Aimeos\MShop\Factory::setCache(true); |
|
18 | 18 | |
19 | 19 | $context = \TestHelperCntl::getContext(); |
20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard( $context ); |
|
20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard($context); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | protected function tearDown() |
25 | 25 | { |
26 | - \Aimeos\MShop\Factory::setCache( false ); |
|
26 | + \Aimeos\MShop\Factory::setCache(false); |
|
27 | 27 | \Aimeos\MShop\Factory::clear(); |
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testGet() |
32 | 32 | { |
33 | - $result = $this->object->get( 'root' ); |
|
33 | + $result = $this->object->get('root'); |
|
34 | 34 | |
35 | - $this->assertNotEquals( null, $result ); |
|
36 | - $this->assertInternalType( 'integer', $result ); |
|
35 | + $this->assertNotEquals(null, $result); |
|
36 | + $this->assertInternalType('integer', $result); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testGetUnknown() |
41 | 41 | { |
42 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
42 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
46 | 46 | public function testSet() |
47 | 47 | { |
48 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'catalog' )->createItem(); |
|
49 | - $item->setCode( 'cache-test' ); |
|
50 | - $item->setId( 1 ); |
|
48 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'catalog')->createItem(); |
|
49 | + $item->setCode('cache-test'); |
|
50 | + $item->setId(1); |
|
51 | 51 | |
52 | - $this->object->set( $item ); |
|
53 | - $id = $this->object->get( 'cache-test' ); |
|
52 | + $this->object->set($item); |
|
53 | + $id = $this->object->get('cache-test'); |
|
54 | 54 | |
55 | - $this->assertEquals( $item->getId(), $id ); |
|
55 | + $this->assertEquals($item->getId(), $id); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -14,43 +14,43 @@ |
||
14 | 14 | |
15 | 15 | protected function setUp() |
16 | 16 | { |
17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
17 | + \Aimeos\MShop\Factory::setCache(true); |
|
18 | 18 | |
19 | 19 | $context = \TestHelperCntl::getContext(); |
20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Warehouse\Standard( $context ); |
|
20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Warehouse\Standard($context); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | protected function tearDown() |
25 | 25 | { |
26 | - \Aimeos\MShop\Factory::setCache( false ); |
|
26 | + \Aimeos\MShop\Factory::setCache(false); |
|
27 | 27 | \Aimeos\MShop\Factory::clear(); |
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testGet() |
32 | 32 | { |
33 | - $result = $this->object->get( 'default' ); |
|
33 | + $result = $this->object->get('default'); |
|
34 | 34 | |
35 | - $this->assertNotEquals( null, $result ); |
|
35 | + $this->assertNotEquals(null, $result); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testGetUnknown() |
40 | 40 | { |
41 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
41 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testSet() |
46 | 46 | { |
47 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'product/stock/warehouse' )->createItem(); |
|
48 | - $item->setCode( 'cache-test' ); |
|
49 | - $item->setId( 1 ); |
|
47 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'product/stock/warehouse')->createItem(); |
|
48 | + $item->setCode('cache-test'); |
|
49 | + $item->setId(1); |
|
50 | 50 | |
51 | - $this->object->set( $item ); |
|
52 | - $id = $this->object->get( 'cache-test' ); |
|
51 | + $this->object->set($item); |
|
52 | + $id = $this->object->get('cache-test'); |
|
53 | 53 | |
54 | - $this->assertEquals( $item->getId(), $id ); |
|
54 | + $this->assertEquals($item->getId(), $id); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | \ No newline at end of file |
@@ -14,41 +14,41 @@ |
||
14 | 14 | |
15 | 15 | protected function setUp() |
16 | 16 | { |
17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
17 | + \Aimeos\MShop\Factory::setCache(true); |
|
18 | 18 | |
19 | 19 | $context = \TestHelperCntl::getContext(); |
20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard( $context ); |
|
20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard($context); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | protected function tearDown() |
25 | 25 | { |
26 | - \Aimeos\MShop\Factory::setCache( false ); |
|
26 | + \Aimeos\MShop\Factory::setCache(false); |
|
27 | 27 | \Aimeos\MShop\Factory::clear(); |
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testGet() |
32 | 32 | { |
33 | - $this->assertNotEquals( null, $this->object->get( 'CNC' ) ); |
|
33 | + $this->assertNotEquals(null, $this->object->get('CNC')); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testGetUnknown() |
38 | 38 | { |
39 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
39 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | public function testSet() |
44 | 44 | { |
45 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'product' )->createItem(); |
|
46 | - $item->setCode( 'cache-test' ); |
|
47 | - $item->setId( 1 ); |
|
45 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'product')->createItem(); |
|
46 | + $item->setCode('cache-test'); |
|
47 | + $item->setId(1); |
|
48 | 48 | |
49 | - $this->object->set( $item ); |
|
50 | - $id = $this->object->get( 'cache-test' ); |
|
49 | + $this->object->set($item); |
|
50 | + $id = $this->object->get('cache-test'); |
|
51 | 51 | |
52 | - $this->assertEquals( $item->getId(), $id ); |
|
52 | + $this->assertEquals($item->getId(), $id); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | \ No newline at end of file |
@@ -14,92 +14,92 @@ discard block |
||
14 | 14 | |
15 | 15 | protected function setUp() |
16 | 16 | { |
17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
17 | + \Aimeos\MShop\Factory::setCache(true); |
|
18 | 18 | |
19 | 19 | $context = \TestHelperCntl::getContext(); |
20 | 20 | $aimeos = \TestHelperCntl::getAimeos(); |
21 | 21 | |
22 | - $this->object = new TestAbstract( $context, $aimeos ); |
|
22 | + $this->object = new TestAbstract($context, $aimeos); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | protected function tearDown() |
27 | 27 | { |
28 | - \Aimeos\MShop\Factory::setCache( false ); |
|
28 | + \Aimeos\MShop\Factory::setCache(false); |
|
29 | 29 | \Aimeos\MShop\Factory::clear(); |
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testGetCache() |
34 | 34 | { |
35 | - $cache = $this->object->getCachePublic( 'attribute' ); |
|
35 | + $cache = $this->object->getCachePublic('attribute'); |
|
36 | 36 | |
37 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\Iface', $cache ); |
|
37 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\Iface', $cache); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | public function testGetCacheInvalidType() |
42 | 42 | { |
43 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
44 | - $this->object->getCachePublic( '$' ); |
|
43 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
44 | + $this->object->getCachePublic('$'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testGetCacheInvalidClass() |
49 | 49 | { |
50 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
51 | - $this->object->getCachePublic( 'unknown' ); |
|
50 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
51 | + $this->object->getCachePublic('unknown'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | 55 | public function testGetCacheInvalidInterface() |
56 | 56 | { |
57 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
58 | - $this->object->getCachePublic( 'attribute', 'unknown' ); |
|
57 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
58 | + $this->object->getCachePublic('attribute', 'unknown'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | 62 | public function testGetProcessors() |
63 | 63 | { |
64 | - $processor = $this->object->getProcessorsPublic( array( 'attribute' => array() ) ); |
|
64 | + $processor = $this->object->getProcessorsPublic(array('attribute' => array())); |
|
65 | 65 | |
66 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Processor\\Iface', $processor ); |
|
66 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Processor\\Iface', $processor); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
70 | 70 | public function testGetProcessorsInvalidType() |
71 | 71 | { |
72 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
73 | - $this->object->getProcessorsPublic( array( '$' => array() ) ); |
|
72 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
73 | + $this->object->getProcessorsPublic(array('$' => array())); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
77 | 77 | public function testGetProcessorsInvalidClass() |
78 | 78 | { |
79 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
80 | - $this->object->getProcessorsPublic( array( 'unknown' => array() ) ); |
|
79 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
80 | + $this->object->getProcessorsPublic(array('unknown' => array())); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | 84 | public function testGetProcessorsInvalidInterface() |
85 | 85 | { |
86 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
87 | - $this->object->getProcessorsPublic( array( 'unknown' => array() ) ); |
|
86 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
87 | + $this->object->getProcessorsPublic(array('unknown' => array())); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | |
91 | 91 | public function testGetTypeId() |
92 | 92 | { |
93 | - $typeid = $this->object->getTypeIdPublic( 'attribute/type', 'product', 'color' ); |
|
93 | + $typeid = $this->object->getTypeIdPublic('attribute/type', 'product', 'color'); |
|
94 | 94 | |
95 | - $this->assertNotEquals( null, $typeid ); |
|
95 | + $this->assertNotEquals(null, $typeid); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
99 | 99 | public function testGetTypeIdUnknown() |
100 | 100 | { |
101 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
102 | - $this->object->getTypeIdPublic( 'attribute/type', 'product', 'unknown' ); |
|
101 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
102 | + $this->object->getTypeIdPublic('attribute/type', 'product', 'unknown'); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
@@ -107,21 +107,21 @@ discard block |
||
107 | 107 | class TestAbstract |
108 | 108 | extends \Aimeos\Controller\Common\Product\Import\Csv\Base |
109 | 109 | { |
110 | - public function getCachePublic( $type, $name = null ) |
|
110 | + public function getCachePublic($type, $name = null) |
|
111 | 111 | { |
112 | - return $this->getCache( $type, $name ); |
|
112 | + return $this->getCache($type, $name); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
116 | - public function getProcessorsPublic( array $mappings ) |
|
116 | + public function getProcessorsPublic(array $mappings) |
|
117 | 117 | { |
118 | - return $this->getProcessors( $mappings ); |
|
118 | + return $this->getProcessors($mappings); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
122 | - public function getTypeIdPublic( $path, $domain, $code ) |
|
122 | + public function getTypeIdPublic($path, $domain, $code) |
|
123 | 123 | { |
124 | - return $this->getTypeId( $path, $domain, $code ); |
|
124 | + return $this->getTypeId($path, $domain, $code); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/order/cleanup/unpaid/name |
36 | 36 | * Class name of the used order cleanup unpaid scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.07 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/order/cleanup/unpaid/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/order/cleanup/unpaid/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name; |
80 | 80 | |
81 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/order/cleanup/unpaid/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the order cleanup unpaid controllers |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/order/cleanup/unpaid/decorators/excludes |
155 | 155 | * @see controller/jobs/order/cleanup/unpaid/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'order/cleanup/unpaid' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'order/cleanup/unpaid'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getName() |
31 | 31 | { |
32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Removes unpaid orders' ); |
|
32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Removes unpaid orders'); |
|
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', 'Deletes unpaid orders to keep the database clean' ); |
|
43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Deletes unpaid orders to keep the database clean'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | public function run() |
53 | 53 | { |
54 | 54 | $context = $this->getContext(); |
55 | - $controller = \Aimeos\Controller\Common\Order\Factory::createController( $context ); |
|
56 | - $baseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
57 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
55 | + $controller = \Aimeos\Controller\Common\Order\Factory::createController($context); |
|
56 | + $baseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
57 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
58 | 58 | |
59 | 59 | /** controller/jobs/order/cleanup/unpaid/keep-days |
60 | 60 | * Removes all orders from the database that are unpaid |
@@ -71,35 +71,35 @@ discard block |
||
71 | 71 | * @since 2014.07 |
72 | 72 | * @category User |
73 | 73 | */ |
74 | - $days = $context->getConfig()->get( 'controller/jobs/order/cleanup/unpaid/keep-days', 3 ); |
|
75 | - $limit = date( 'Y-m-d H:i:s', time() - 86400 * $days ); |
|
74 | + $days = $context->getConfig()->get('controller/jobs/order/cleanup/unpaid/keep-days', 3); |
|
75 | + $limit = date('Y-m-d H:i:s', time() - 86400 * $days); |
|
76 | 76 | |
77 | 77 | $search = $manager->createSearch(); |
78 | 78 | $expr = array( |
79 | - $search->compare( '<', 'order.mtime', $limit ), |
|
80 | - $search->compare( '<', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_REFUND ), |
|
79 | + $search->compare('<', 'order.mtime', $limit), |
|
80 | + $search->compare('<', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_REFUND), |
|
81 | 81 | ); |
82 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
82 | + $search->setConditions($search->combine('&&', $expr)); |
|
83 | 83 | |
84 | 84 | $start = 0; |
85 | 85 | |
86 | 86 | do |
87 | 87 | { |
88 | 88 | $baseIds = array(); |
89 | - $items = $manager->searchItems( $search ); |
|
89 | + $items = $manager->searchItems($search); |
|
90 | 90 | |
91 | - foreach( $items as $item ) |
|
91 | + foreach ($items as $item) |
|
92 | 92 | { |
93 | - $controller->unblock( $item ); |
|
93 | + $controller->unblock($item); |
|
94 | 94 | $baseIds[] = $item->getBaseId(); |
95 | 95 | } |
96 | 96 | |
97 | - $baseManager->deleteItems( $baseIds ); |
|
97 | + $baseManager->deleteItems($baseIds); |
|
98 | 98 | |
99 | - $count = count( $items ); |
|
99 | + $count = count($items); |
|
100 | 100 | $start += $count; |
101 | - $search->setSlice( $start ); |
|
101 | + $search->setSlice($start); |
|
102 | 102 | } |
103 | - while( $count >= $search->getSliceSize() ); |
|
103 | + while ($count >= $search->getSliceSize()); |
|
104 | 104 | } |
105 | 105 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/order/cleanup/unfinished/name |
36 | 36 | * Class name of the used order cleanup unfinished scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.03 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/order/cleanup/unfinished/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/order/cleanup/unfinished/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name; |
80 | 80 | |
81 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/order/cleanup/unfinished/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the order cleanup unfinished controllers |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/order/cleanup/unfinished/decorators/excludes |
155 | 155 | * @see controller/jobs/order/cleanup/unfinished/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'order/cleanup/unfinished' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'order/cleanup/unfinished'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getName() |
31 | 31 | { |
32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Removes unfinished orders' ); |
|
32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Removes unfinished orders'); |
|
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', 'Deletes unfinished orders an makes their products and coupon codes available again' ); |
|
43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Deletes unfinished orders an makes their products and coupon codes available again'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | public function run() |
53 | 53 | { |
54 | 54 | $context = $this->getContext(); |
55 | - $controller = \Aimeos\Controller\Common\Order\Factory::createController( $context ); |
|
56 | - $baseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
57 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
55 | + $controller = \Aimeos\Controller\Common\Order\Factory::createController($context); |
|
56 | + $baseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
57 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
58 | 58 | |
59 | 59 | /** controller/jobs/order/cleanup/unfinished/keep-hours |
60 | 60 | * Release the ordered products after the configured time if no payment was confirmed |
@@ -74,35 +74,35 @@ discard block |
||
74 | 74 | * @since 2014.07 |
75 | 75 | * @category User |
76 | 76 | */ |
77 | - $hours = $context->getConfig()->get( 'controller/jobs/order/cleanup/unfinished/keep-hours', 24 ); |
|
78 | - $limit = date( 'Y-m-d H:i:s', time() - 3600 * $hours ); |
|
77 | + $hours = $context->getConfig()->get('controller/jobs/order/cleanup/unfinished/keep-hours', 24); |
|
78 | + $limit = date('Y-m-d H:i:s', time() - 3600 * $hours); |
|
79 | 79 | |
80 | 80 | $search = $manager->createSearch(); |
81 | 81 | $expr = array( |
82 | - $search->compare( '<', 'order.mtime', $limit ), |
|
83 | - $search->compare( '==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED ), |
|
82 | + $search->compare('<', 'order.mtime', $limit), |
|
83 | + $search->compare('==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED), |
|
84 | 84 | ); |
85 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
85 | + $search->setConditions($search->combine('&&', $expr)); |
|
86 | 86 | |
87 | 87 | $start = 0; |
88 | 88 | |
89 | 89 | do |
90 | 90 | { |
91 | 91 | $baseIds = array(); |
92 | - $items = $manager->searchItems( $search ); |
|
92 | + $items = $manager->searchItems($search); |
|
93 | 93 | |
94 | - foreach( $items as $item ) |
|
94 | + foreach ($items as $item) |
|
95 | 95 | { |
96 | - $controller->unblock( $item ); |
|
96 | + $controller->unblock($item); |
|
97 | 97 | $baseIds[] = $item->getBaseId(); |
98 | 98 | } |
99 | 99 | |
100 | - $baseManager->deleteItems( $baseIds ); |
|
100 | + $baseManager->deleteItems($baseIds); |
|
101 | 101 | |
102 | - $count = count( $items ); |
|
102 | + $count = count($items); |
|
103 | 103 | $start += $count; |
104 | - $search->setSlice( $start ); |
|
104 | + $search->setSlice($start); |
|
105 | 105 | } |
106 | - while( $count >= $search->getSliceSize() ); |
|
106 | + while ($count >= $search->getSliceSize()); |
|
107 | 107 | } |
108 | 108 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/order/service/async/name |
36 | 36 | * Class name of the used order service async scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.07 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/order/service/async/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/order/service/async/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Async\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Async\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Async\\' . $name; |
80 | 80 | |
81 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/order/service/async/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the order service async controllers |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/order/service/async/decorators/excludes |
155 | 155 | * @see controller/jobs/order/service/async/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'order/service/async' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'order/service/async'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |