@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/subscription/process/begin/name |
35 | 35 | * Class name of the used subscription suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2018.04 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/subscription/process/begin/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Begin\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Begin\\' . $name; |
79 | 79 | |
80 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/subscription/process/begin/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the subscription process CSV job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/subscription/process/begin/decorators/excludes |
155 | 155 | * @see controller/jobs/subscription/process/begin/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'subscription/process/begin' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'subscription/process/begin'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | { |
13 | 13 | protected function setUp() |
14 | 14 | { |
15 | - \Aimeos\MShop\Factory::setCache( true ); |
|
15 | + \Aimeos\MShop\Factory::setCache(true); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | 19 | protected function tearDown() |
20 | 20 | { |
21 | - \Aimeos\MShop\Factory::setCache( false ); |
|
21 | + \Aimeos\MShop\Factory::setCache(false); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -26,29 +26,29 @@ discard block |
||
26 | 26 | { |
27 | 27 | $context = \TestHelperCntl::getContext(); |
28 | 28 | |
29 | - $context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] ); |
|
29 | + $context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']); |
|
30 | 30 | |
31 | - $fcn = function( $subject ){ |
|
31 | + $fcn = function($subject) { |
|
32 | 32 | return $subject->getGroups() === ['1', '2']; |
33 | 33 | }; |
34 | 34 | |
35 | - $customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
36 | - ->setConstructorArgs( [$context] ) |
|
37 | - ->setMethods( ['getItem', 'saveItem'] ) |
|
35 | + $customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
36 | + ->setConstructorArgs([$context]) |
|
37 | + ->setMethods(['getItem', 'saveItem']) |
|
38 | 38 | ->getMock(); |
39 | 39 | |
40 | - \Aimeos\MShop\Factory::injectManager( $context, 'customer', $customerStub ); |
|
40 | + \Aimeos\MShop\Factory::injectManager($context, 'customer', $customerStub); |
|
41 | 41 | |
42 | 42 | $customerItem = $customerStub->createItem(); |
43 | 43 | |
44 | - $customerStub->expects( $this->once() )->method( 'getItem' ) |
|
45 | - ->will( $this->returnValue( $customerItem ) ); |
|
44 | + $customerStub->expects($this->once())->method('getItem') |
|
45 | + ->will($this->returnValue($customerItem)); |
|
46 | 46 | |
47 | - $customerStub->expects( $this->once() )->method( 'saveItem' ) |
|
48 | - ->with( $this->callback( $fcn ) ); |
|
47 | + $customerStub->expects($this->once())->method('saveItem') |
|
48 | + ->with($this->callback($fcn)); |
|
49 | 49 | |
50 | - $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context ); |
|
51 | - $object->begin( $this->getSubscription( $context ) ); |
|
50 | + $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context); |
|
51 | + $object->begin($this->getSubscription($context)); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -56,45 +56,45 @@ discard block |
||
56 | 56 | { |
57 | 57 | $context = \TestHelperCntl::getContext(); |
58 | 58 | |
59 | - $context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] ); |
|
59 | + $context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']); |
|
60 | 60 | |
61 | - $fcn = function( $subject ){ |
|
61 | + $fcn = function($subject) { |
|
62 | 62 | return $subject->getGroups() === []; |
63 | 63 | }; |
64 | 64 | |
65 | - $customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
66 | - ->setConstructorArgs( [$context] ) |
|
67 | - ->setMethods( ['getItem', 'saveItem'] ) |
|
65 | + $customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
66 | + ->setConstructorArgs([$context]) |
|
67 | + ->setMethods(['getItem', 'saveItem']) |
|
68 | 68 | ->getMock(); |
69 | 69 | |
70 | - \Aimeos\MShop\Factory::injectManager( $context, 'customer', $customerStub ); |
|
70 | + \Aimeos\MShop\Factory::injectManager($context, 'customer', $customerStub); |
|
71 | 71 | |
72 | - $customerItem = $customerStub->createItem()->setGroups( ['1', '2'] ); |
|
72 | + $customerItem = $customerStub->createItem()->setGroups(['1', '2']); |
|
73 | 73 | |
74 | - $customerStub->expects( $this->once() )->method( 'getItem' ) |
|
75 | - ->will( $this->returnValue( $customerItem ) ); |
|
74 | + $customerStub->expects($this->once())->method('getItem') |
|
75 | + ->will($this->returnValue($customerItem)); |
|
76 | 76 | |
77 | - $customerStub->expects( $this->once() )->method( 'saveItem' ) |
|
78 | - ->with( $this->callback( $fcn ) ); |
|
77 | + $customerStub->expects($this->once())->method('saveItem') |
|
78 | + ->with($this->callback($fcn)); |
|
79 | 79 | |
80 | - $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context ); |
|
81 | - $object->end( $this->getSubscription( $context ) ); |
|
80 | + $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context); |
|
81 | + $object->end($this->getSubscription($context)); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | - protected function getSubscription( $context ) |
|
85 | + protected function getSubscription($context) |
|
86 | 86 | { |
87 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'subscription' ); |
|
87 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'subscription'); |
|
88 | 88 | |
89 | 89 | $search = $manager->createSearch(); |
90 | - $search->setConditions( $search->compare( '==', 'subscription.dateend', '2010-01-01' ) ); |
|
90 | + $search->setConditions($search->compare('==', 'subscription.dateend', '2010-01-01')); |
|
91 | 91 | |
92 | - $items = $manager->searchItems( $search ); |
|
92 | + $items = $manager->searchItems($search); |
|
93 | 93 | |
94 | - if( ( $item = reset( $items ) ) !== false ) { |
|
94 | + if (($item = reset($items)) !== false) { |
|
95 | 95 | return $item; |
96 | 96 | } |
97 | 97 | |
98 | - throw new \Exception( 'No subscription item found' ); |
|
98 | + throw new \Exception('No subscription item found'); |
|
99 | 99 | } |
100 | 100 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/subscription/process/end/name |
35 | 35 | * Class name of the used subscription suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2018.04 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/subscription/process/end/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\End\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\End\\' . $name; |
79 | 79 | |
80 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/subscription/process/end/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the subscription process CSV job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/subscription/process/end/decorators/excludes |
155 | 155 | * @see controller/jobs/subscription/process/end/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'subscription/process/end' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'subscription/process/end'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | $context = \TestHelperJobs::getContext(); |
17 | 17 | $aimeos = \TestHelperJobs::getAimeos(); |
18 | 18 | |
19 | - $obj = \Aimeos\Controller\Jobs\Subscription\Process\End\Factory::createController( $context, $aimeos ); |
|
20 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
19 | + $obj = \Aimeos\Controller\Jobs\Subscription\Process\End\Factory::createController($context, $aimeos); |
|
20 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | $context = \TestHelperJobs::getContext(); |
27 | 27 | $aimeos = \TestHelperJobs::getAimeos(); |
28 | 28 | |
29 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
30 | - \Aimeos\Controller\Jobs\Subscription\Process\End\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
29 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
30 | + \Aimeos\Controller\Jobs\Subscription\Process\End\Factory::createController($context, $aimeos, 'Wrong$$$Name'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | $context = \TestHelperJobs::getContext(); |
37 | 37 | $aimeos = \TestHelperJobs::getAimeos(); |
38 | 38 | |
39 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
40 | - \Aimeos\Controller\Jobs\Subscription\Process\End\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
39 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
40 | + \Aimeos\Controller\Jobs\Subscription\Process\End\Factory::createController($context, $aimeos, 'WrongClass'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $context = \TestHelperJobs::getContext(); |
47 | 47 | $aimeos = \TestHelperJobs::getAimeos(); |
48 | 48 | |
49 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
50 | - \Aimeos\Controller\Jobs\Subscription\Process\End\Factory::createController( $context, $aimeos, 'Factory' ); |
|
49 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
50 | + \Aimeos\Controller\Jobs\Subscription\Process\End\Factory::createController($context, $aimeos, 'Factory'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
@@ -20,49 +20,49 @@ discard block |
||
20 | 20 | $aimeos = \TestHelperJobs::getAimeos(); |
21 | 21 | $this->context = \TestHelperJobs::getContext(); |
22 | 22 | |
23 | - $this->object = new \Aimeos\Controller\Jobs\Subscription\Process\End\Standard( $this->context, $aimeos ); |
|
23 | + $this->object = new \Aimeos\Controller\Jobs\Subscription\Process\End\Standard($this->context, $aimeos); |
|
24 | 24 | |
25 | - \Aimeos\MShop\Factory::setCache( true ); |
|
25 | + \Aimeos\MShop\Factory::setCache(true); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | 29 | protected function tearDown() |
30 | 30 | { |
31 | - \Aimeos\MShop\Factory::setCache( false ); |
|
31 | + \Aimeos\MShop\Factory::setCache(false); |
|
32 | 32 | \Aimeos\MShop\Factory::clear(); |
33 | 33 | |
34 | - unset( $this->object, $this->context ); |
|
34 | + unset($this->object, $this->context); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testGetName() |
39 | 39 | { |
40 | - $this->assertEquals( 'Subscription process end', $this->object->getName() ); |
|
40 | + $this->assertEquals('Subscription process end', $this->object->getName()); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | 44 | public function testGetDescription() |
45 | 45 | { |
46 | - $this->assertEquals( 'Terminates expired subscriptions', $this->object->getDescription() ); |
|
46 | + $this->assertEquals('Terminates expired subscriptions', $this->object->getDescription()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | 50 | public function testRun() |
51 | 51 | { |
52 | - $this->context->getConfig()->set( 'controller/common/subscription/process/processors', ['cgroup'] ); |
|
52 | + $this->context->getConfig()->set('controller/common/subscription/process/processors', ['cgroup']); |
|
53 | 53 | $item = $this->getSubscription(); |
54 | 54 | |
55 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Subscription\\Manager\\Standard' ) |
|
56 | - ->setConstructorArgs( [$this->context] ) |
|
57 | - ->setMethods( ['searchItems', 'saveItem'] ) |
|
55 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Subscription\\Manager\\Standard') |
|
56 | + ->setConstructorArgs([$this->context]) |
|
57 | + ->setMethods(['searchItems', 'saveItem']) |
|
58 | 58 | ->getMock(); |
59 | 59 | |
60 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'subscription', $managerStub ); |
|
60 | + \Aimeos\MShop\Factory::injectManager($this->context, 'subscription', $managerStub); |
|
61 | 61 | |
62 | - $managerStub->expects( $this->once() )->method( 'searchItems' ) |
|
63 | - ->will( $this->returnValue( [$item] ) ); |
|
62 | + $managerStub->expects($this->once())->method('searchItems') |
|
63 | + ->will($this->returnValue([$item])); |
|
64 | 64 | |
65 | - $managerStub->expects( $this->once() )->method( 'saveItem' ); |
|
65 | + $managerStub->expects($this->once())->method('saveItem'); |
|
66 | 66 | |
67 | 67 | $this->object->run(); |
68 | 68 | } |
@@ -70,20 +70,20 @@ discard block |
||
70 | 70 | |
71 | 71 | public function testRunException() |
72 | 72 | { |
73 | - $this->context->getConfig()->set( 'controller/common/subscription/process/processors', ['cgroup'] ); |
|
74 | - $this->context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1'] ); |
|
73 | + $this->context->getConfig()->set('controller/common/subscription/process/processors', ['cgroup']); |
|
74 | + $this->context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1']); |
|
75 | 75 | |
76 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Subscription\\Manager\\Standard' ) |
|
77 | - ->setConstructorArgs( [$this->context] ) |
|
78 | - ->setMethods( ['searchItems', 'saveItem'] ) |
|
76 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Subscription\\Manager\\Standard') |
|
77 | + ->setConstructorArgs([$this->context]) |
|
78 | + ->setMethods(['searchItems', 'saveItem']) |
|
79 | 79 | ->getMock(); |
80 | 80 | |
81 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'subscription', $managerStub ); |
|
81 | + \Aimeos\MShop\Factory::injectManager($this->context, 'subscription', $managerStub); |
|
82 | 82 | |
83 | - $managerStub->expects( $this->once() )->method( 'searchItems' ) |
|
84 | - ->will( $this->returnValue( [$managerStub->createItem()] ) ); |
|
83 | + $managerStub->expects($this->once())->method('searchItems') |
|
84 | + ->will($this->returnValue([$managerStub->createItem()])); |
|
85 | 85 | |
86 | - $managerStub->expects( $this->never() )->method( 'saveItem' ); |
|
86 | + $managerStub->expects($this->never())->method('saveItem'); |
|
87 | 87 | |
88 | 88 | $this->object->run(); |
89 | 89 | } |
@@ -91,17 +91,17 @@ discard block |
||
91 | 91 | |
92 | 92 | protected function getSubscription() |
93 | 93 | { |
94 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' ); |
|
94 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'subscription'); |
|
95 | 95 | |
96 | 96 | $search = $manager->createSearch(); |
97 | - $search->setConditions( $search->compare( '==', 'subscription.dateend', '2010-01-01' ) ); |
|
97 | + $search->setConditions($search->compare('==', 'subscription.dateend', '2010-01-01')); |
|
98 | 98 | |
99 | - $items = $manager->searchItems( $search ); |
|
99 | + $items = $manager->searchItems($search); |
|
100 | 100 | |
101 | - if( ( $item = reset( $items ) ) !== false ) { |
|
101 | + if (($item = reset($items)) !== false) { |
|
102 | 102 | return $item; |
103 | 103 | } |
104 | 104 | |
105 | - throw new \Exception( 'No subscription item found' ); |
|
105 | + throw new \Exception('No subscription item found'); |
|
106 | 106 | } |
107 | 107 | } |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | $context = \TestHelperJobs::getContext(); |
17 | 17 | $aimeos = \TestHelperJobs::getAimeos(); |
18 | 18 | |
19 | - $obj = \Aimeos\Controller\Jobs\Subscription\Process\Renew\Factory::createController( $context, $aimeos ); |
|
20 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
19 | + $obj = \Aimeos\Controller\Jobs\Subscription\Process\Renew\Factory::createController($context, $aimeos); |
|
20 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | $context = \TestHelperJobs::getContext(); |
27 | 27 | $aimeos = \TestHelperJobs::getAimeos(); |
28 | 28 | |
29 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
30 | - \Aimeos\Controller\Jobs\Subscription\Process\Renew\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
29 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
30 | + \Aimeos\Controller\Jobs\Subscription\Process\Renew\Factory::createController($context, $aimeos, 'Wrong$$$Name'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | $context = \TestHelperJobs::getContext(); |
37 | 37 | $aimeos = \TestHelperJobs::getAimeos(); |
38 | 38 | |
39 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
40 | - \Aimeos\Controller\Jobs\Subscription\Process\Renew\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
39 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
40 | + \Aimeos\Controller\Jobs\Subscription\Process\Renew\Factory::createController($context, $aimeos, 'WrongClass'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $context = \TestHelperJobs::getContext(); |
47 | 47 | $aimeos = \TestHelperJobs::getAimeos(); |
48 | 48 | |
49 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
50 | - \Aimeos\Controller\Jobs\Subscription\Process\Renew\Factory::createController( $context, $aimeos, 'Factory' ); |
|
49 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
50 | + \Aimeos\Controller\Jobs\Subscription\Process\Renew\Factory::createController($context, $aimeos, 'Factory'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/subscription/process/renew/name |
35 | 35 | * Class name of the used subscription suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2018.04 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/subscription/process/renew/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Renew\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Renew\\' . $name; |
79 | 79 | |
80 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/subscription/process/renew/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the subscription process CSV job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/subscription/process/renew/decorators/excludes |
155 | 155 | * @see controller/jobs/subscription/process/renew/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'subscription/process/renew' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'subscription/process/renew'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
26 | 26 | */ |
27 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ); |
|
27 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context); |
|
28 | 28 | |
29 | 29 | |
30 | 30 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item |
34 | 34 | */ |
35 | - public function begin( \Aimeos\MShop\Subscription\Item\Iface $subscription ); |
|
35 | + public function begin(\Aimeos\MShop\Subscription\Item\Iface $subscription); |
|
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item |
42 | 42 | * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice item |
43 | 43 | */ |
44 | - public function renew( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Iface $order ); |
|
44 | + public function renew(\Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Iface $order); |
|
45 | 45 | |
46 | 46 | |
47 | 47 | /** |
@@ -49,5 +49,5 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item |
51 | 51 | */ |
52 | - public function end( \Aimeos\MShop\Subscription\Item\Iface $subscription ); |
|
52 | + public function end(\Aimeos\MShop\Subscription\Item\Iface $subscription); |
|
53 | 53 | } |
54 | 54 | \ No newline at end of file |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
29 | 29 | */ |
30 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
|
30 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) |
|
31 | 31 | { |
32 | 32 | $this->context = $context; |
33 | 33 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item |
51 | 51 | */ |
52 | - public function begin( \Aimeos\MShop\Subscription\Item\Iface $subscription ) |
|
52 | + public function begin(\Aimeos\MShop\Subscription\Item\Iface $subscription) |
|
53 | 53 | { |
54 | 54 | } |
55 | 55 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item |
61 | 61 | * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice item |
62 | 62 | */ |
63 | - public function renew( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Iface $order ) |
|
63 | + public function renew(\Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Iface $order) |
|
64 | 64 | { |
65 | 65 | } |
66 | 66 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item |
72 | 72 | */ |
73 | - public function end( \Aimeos\MShop\Subscription\Item\Iface $subscription ) |
|
73 | + public function end(\Aimeos\MShop\Subscription\Item\Iface $subscription) |
|
74 | 74 | { |
75 | 75 | } |
76 | 76 | } |