Completed
Push — master ( cbc921...0b1729 )
by Aimeos
02:05
created
jobs/tests/Controller/Jobs/Subscription/Process/Renew/FactoryTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Subscription/Process/Renew/Factory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
common/src/Controller/Common/Subscription/Process/Processor/Iface.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
common/src/Controller/Common/Subscription/Process/Processor/Base.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Base.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -104,37 +104,37 @@
 block discarded – undo
104 104
 	 * @param array $mappings Associative list of processor types as keys and index/data mappings as values
105 105
 	 * @return \Aimeos\Controller\Common\Subscription\Export\Csv\Processor\Iface Processor object
106 106
 	 */
107
-	protected function getProcessors( array $mappings )
107
+	protected function getProcessors(array $mappings)
108 108
 	{
109 109
 		$list = [];
110 110
 		$context = $this->getContext();
111 111
 		$config = $context->getConfig();
112 112
 
113
-		foreach( $mappings as $type => $mapping )
113
+		foreach ($mappings as $type => $mapping)
114 114
 		{
115
-			if( ctype_alnum( $type ) === false )
115
+			if (ctype_alnum($type) === false)
116 116
 			{
117 117
 				$classname = is_string($type) ? '\\Aimeos\\Controller\\Common\\Subscription\\Export\\Csv\\Processor\\' . $type : '<not a string>';
118
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
118
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
119 119
 			}
120 120
 
121
-			$name = $config->get( 'controller/common/subscription/export/csv/processor/' . $type . '/name', 'Standard' );
121
+			$name = $config->get('controller/common/subscription/export/csv/processor/' . $type . '/name', 'Standard');
122 122
 
123
-			if( ctype_alnum( $name ) === false )
123
+			if (ctype_alnum($name) === false)
124 124
 			{
125 125
 				$classname = is_string($name) ? '\\Aimeos\\Controller\\Common\\Subscription\\Export\\Csv\\Processor\\' . $type . '\\' . $name : '<not a string>';
126
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
126
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
127 127
 			}
128 128
 
129
-			$classname = '\\Aimeos\\Controller\\Common\\Subscription\\Export\\Csv\\Processor\\' . ucfirst( $type ) . '\\' . $name;
129
+			$classname = '\\Aimeos\\Controller\\Common\\Subscription\\Export\\Csv\\Processor\\' . ucfirst($type) . '\\' . $name;
130 130
 
131
-			if( class_exists( $classname ) === false ) {
132
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Class "%1$s" not found', $classname ) );
131
+			if (class_exists($classname) === false) {
132
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Class "%1$s" not found', $classname));
133 133
 			}
134 134
 
135
-			$object = new $classname( $context, $mapping );
135
+			$object = new $classname($context, $mapping);
136 136
 
137
-			\Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Common\\Subscription\\Export\\Csv\\Processor\\Iface', $object );
137
+			\Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Common\\Subscription\\Export\\Csv\\Processor\\Iface', $object);
138 138
 
139 139
 			$list[$type] = $object;
140 140
 		}
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Subscription/Process/Base.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,37 +27,37 @@
 block discarded – undo
27 27
 	 * @param array $pnames List of processor names
28 28
 	 * @return \Aimeos\Controller\Common\Subscription\Export\Csv\Processor\Iface Processor object
29 29
 	 */
30
-	protected function getProcessors( array $pnames )
30
+	protected function getProcessors(array $pnames)
31 31
 	{
32 32
 		$list = [];
33 33
 		$context = $this->getContext();
34 34
 		$config = $context->getConfig();
35 35
 
36
-		foreach( $pnames as $pname )
36
+		foreach ($pnames as $pname)
37 37
 		{
38
-			if( ctype_alnum( $pname ) === false )
38
+			if (ctype_alnum($pname) === false)
39 39
 			{
40 40
 				$classname = is_string($pname) ? '\\Aimeos\\Controller\\Common\\Subscription\\Process\\Processor\\' . $pname : '<not a string>';
41
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
41
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
42 42
 			}
43 43
 
44
-			$name = $config->get( 'controller/common/subscription/process/processor/' . $pname . '/name', 'Standard' );
44
+			$name = $config->get('controller/common/subscription/process/processor/' . $pname . '/name', 'Standard');
45 45
 
46
-			if( ctype_alnum( $name ) === false )
46
+			if (ctype_alnum($name) === false)
47 47
 			{
48 48
 				$classname = is_string($name) ? '\\Aimeos\\Controller\\Common\\Subscription\\Process\\Processor\\' . $pname . '\\' . $name : '<not a string>';
49
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
49
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
50 50
 			}
51 51
 
52
-			$classname = '\\Aimeos\\Controller\\Common\\Subscription\\Process\\Processor\\' . ucfirst( $pname ) . '\\' . $name;
52
+			$classname = '\\Aimeos\\Controller\\Common\\Subscription\\Process\\Processor\\' . ucfirst($pname) . '\\' . $name;
53 53
 
54
-			if( class_exists( $classname ) === false ) {
55
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Class "%1$s" not found', $classname ) );
54
+			if (class_exists($classname) === false) {
55
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Class "%1$s" not found', $classname));
56 56
 			}
57 57
 
58
-			$object = new $classname( $context );
58
+			$object = new $classname($context);
59 59
 
60
-			\Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Common\\Subscription\\Process\\Processor\\Iface', $object );
60
+			\Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Common\\Subscription\\Process\\Processor\\Iface', $object);
61 61
 
62 62
 			$list[$pname] = $object;
63 63
 		}
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Order/Export/Csv/Base.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -142,37 +142,37 @@
 block discarded – undo
142 142
 	 * @param array $mappings Associative list of processor types as keys and index/data mappings as values
143 143
 	 * @return \Aimeos\Controller\Common\Order\Export\Csv\Processor\Iface Processor object
144 144
 	 */
145
-	protected function getProcessors( array $mappings )
145
+	protected function getProcessors(array $mappings)
146 146
 	{
147 147
 		$list = [];
148 148
 		$context = $this->getContext();
149 149
 		$config = $context->getConfig();
150 150
 
151
-		foreach( $mappings as $type => $mapping )
151
+		foreach ($mappings as $type => $mapping)
152 152
 		{
153
-			if( ctype_alnum( $type ) === false )
153
+			if (ctype_alnum($type) === false)
154 154
 			{
155 155
 				$classname = is_string($type) ? '\\Aimeos\\Controller\\Common\\Order\\Export\\Csv\\Processor\\' . $type : '<not a string>';
156
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
156
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
157 157
 			}
158 158
 
159
-			$name = $config->get( 'controller/common/order/export/csv/processor/' . $type . '/name', 'Standard' );
159
+			$name = $config->get('controller/common/order/export/csv/processor/' . $type . '/name', 'Standard');
160 160
 
161
-			if( ctype_alnum( $name ) === false )
161
+			if (ctype_alnum($name) === false)
162 162
 			{
163 163
 				$classname = is_string($name) ? '\\Aimeos\\Controller\\Common\\Order\\Export\\Csv\\Processor\\' . $type . '\\' . $name : '<not a string>';
164
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
164
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
165 165
 			}
166 166
 
167
-			$classname = '\\Aimeos\\Controller\\Common\\Order\\Export\\Csv\\Processor\\' . ucfirst( $type ) . '\\' . $name;
167
+			$classname = '\\Aimeos\\Controller\\Common\\Order\\Export\\Csv\\Processor\\' . ucfirst($type) . '\\' . $name;
168 168
 
169
-			if( class_exists( $classname ) === false ) {
170
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Class "%1$s" not found', $classname ) );
169
+			if (class_exists($classname) === false) {
170
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Class "%1$s" not found', $classname));
171 171
 			}
172 172
 
173
-			$object = new $classname( $context, $mapping );
173
+			$object = new $classname($context, $mapping);
174 174
 
175
-			\Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Common\\Order\\Export\\Csv\\Processor\\Iface', $object );
175
+			\Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Common\\Order\\Export\\Csv\\Processor\\Iface', $object);
176 176
 
177 177
 			$list[$type] = $object;
178 178
 		}
Please login to merge, or discard this patch.
common/src/Controller/Common/Product/Import/Csv/Processor/Done.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
28 28
 	 * @param \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor Decorated processor
29 29
 	 */
30
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
31
-		\Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null )
30
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
31
+		\Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null)
32 32
 	{
33 33
 	}
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @param array $data List of CSV fields with position as key and data as value
41 41
 	 * @return array List of data which hasn't been imported
42 42
 	 */
43
-	public function process( \Aimeos\MShop\Product\Item\Iface $item, array $data )
43
+	public function process(\Aimeos\MShop\Product\Item\Iface $item, array $data)
44 44
 	{
45 45
 		return $data;
46 46
 	}
Please login to merge, or discard this patch.
Controller/Common/Subscription/Export/Csv/Processor/Product/Standard.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,24 +40,24 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.