Completed
Push — master ( 475749...c0b163 )
by Aimeos
02:12
created
src/Controller/Common/Order/Export/Csv/Processor/Address/Standard.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,28 +40,28 @@
 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\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order )
43
+	public function process(\Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order)
44 44
 	{
45 45
 		$result = [];
46 46
 		$addresses = $order->getAddresses();
47 47
 
48
-		krsort( $addresses );
48
+		krsort($addresses);
49 49
 
50
-		foreach( $addresses as $item )
50
+		foreach ($addresses as $item)
51 51
 		{
52 52
 			$data = [];
53 53
 			$list = $item->toArray();
54 54
 
55
-			foreach( $this->getMapping() as $pos => $key )
55
+			foreach ($this->getMapping() as $pos => $key)
56 56
 			{
57
-				if( array_key_exists( $key, $list ) ) {
57
+				if (array_key_exists($key, $list)) {
58 58
 					$data[$pos] = $list[$key];
59 59
 				} else {
60 60
 					$data[$pos] = '';
61 61
 				}
62 62
 			}
63 63
 
64
-			ksort( $data );
64
+			ksort($data);
65 65
 			$result[] = $data;
66 66
 		}
67 67
 
Please login to merge, or discard this patch.
src/Controller/Common/Order/Export/Csv/Processor/Invoice/Standard.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,21 +40,21 @@
 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\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order )
43
+	public function process(\Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order)
44 44
 	{
45 45
 		$result = [];
46 46
 		$list = $invoice->toArray() + $order->toArray();
47 47
 
48
-		foreach( $this->getMapping() as $pos => $key )
48
+		foreach ($this->getMapping() as $pos => $key)
49 49
 		{
50
-			if( array_key_exists( $key, $list ) ) {
50
+			if (array_key_exists($key, $list)) {
51 51
 				$result[$pos] = $list[$key];
52 52
 			} else {
53 53
 				$result[$pos] = '';
54 54
 			}
55 55
 		}
56 56
 
57
-		ksort( $result );
57
+		ksort($result);
58 58
 
59 59
 		return [$result];
60 60
 	}
Please login to merge, or discard this patch.
common/src/Controller/Common/Order/Export/Csv/Processor/Iface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
26 26
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
27 27
 	 */
28
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping );
28
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping);
29 29
 
30 30
 
31 31
 	/**
@@ -35,5 +35,5 @@  discard block
 block discarded – undo
35 35
 	 * @param \Aimeos\MShop\Order\Item\Base\Iface $order Full order with associated items
36 36
 	 * @return array Two dimensional associative list of order data representing the lines in CSV
37 37
 	 */
38
-	public function process( \Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order );
38
+	public function process(\Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order);
39 39
 }
40 40
\ No newline at end of file
Please login to merge, or discard this patch.
common/src/Controller/Common/Coupon/Import/Csv/Processor/Base.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
33 33
 	 * @param \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $object Decorated processor
34 34
 	 */
35
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
36
-		\Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $object = null )
35
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
36
+		\Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $object = null)
37 37
 	{
38 38
 		$this->context = $context;
39 39
 		$this->mapping = $mapping;
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	protected function getObject()
73 73
 	{
74
-		if( $this->object === null ) {
75
-			throw new \Aimeos\Controller\Jobs\Exception( 'No processor object available' );
74
+		if ($this->object === null) {
75
+			throw new \Aimeos\Controller\Jobs\Exception('No processor object available');
76 76
 		}
77 77
 
78 78
 		return $this->object;
Please login to merge, or discard this patch.
common/src/Controller/Common/Coupon/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\Coupon\Import\Csv\Processor\Iface $object Decorated processor
29 29
 	 */
30
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
31
-		\Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $object = null )
30
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
31
+		\Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $object = 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\Coupon\Item\Code\Iface $item, array $data )
43
+	public function process(\Aimeos\MShop\Coupon\Item\Code\Iface $item, array $data)
44 44
 	{
45 45
 		return $data;
46 46
 	}
Please login to merge, or discard this patch.
common/src/Controller/Common/Coupon/Import/Csv/Processor/Iface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
27 27
 	 * @param \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $object Decorated processor
28 28
 	 */
29
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
30
-		\Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $object = null );
29
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
30
+		\Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $object = null);
31 31
 
32 32
 
33 33
 	/**
@@ -37,5 +37,5 @@  discard block
 block discarded – undo
37 37
 	 * @param array $data List of CSV fields with position as key and data as value
38 38
 	 * @return array List of data which hasn't been imported
39 39
 	 */
40
-	public function process( \Aimeos\MShop\Coupon\Item\Code\Iface $item, array $data );
40
+	public function process(\Aimeos\MShop\Coupon\Item\Code\Iface $item, array $data);
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
tests/Controller/Common/Coupon/Import/Csv/Processor/Code/StandardTest.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(true);
21 21
 
22 22
 		$this->context = \TestHelperCntl::getContext();
23
-		$this->endpoint = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Done( $this->context, [] );
23
+		$this->endpoint = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Done($this->context, []);
24 24
 	}
25 25
 
26 26
 
27 27
 	protected function tearDown()
28 28
 	{
29
-		\Aimeos\MShop\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 	}
32 32
 
@@ -47,24 +47,24 @@  discard block
 block discarded – undo
47 47
 			3 => '',
48 48
 		);
49 49
 
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon' );
51
-		$codeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon/code' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon');
51
+		$codeManager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon/code');
52 52
 
53
-		$coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) );
53
+		$coupon = $manager->saveItem($manager->createItem()->setProvider('test'));
54 54
 		$couponCode = $codeManager->createItem();
55
-		$couponCode->setParentId( $coupon->getId() );
55
+		$couponCode->setParentId($coupon->getId());
56 56
 
57
-		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint );
58
-		$object->process( $couponCode, $data );
57
+		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint);
58
+		$object->process($couponCode, $data);
59 59
 
60
-		$codeManager->deleteItem( $couponCode->getId() );
61
-		$manager->deleteItem( $coupon->getId() );
60
+		$codeManager->deleteItem($couponCode->getId());
61
+		$manager->deleteItem($coupon->getId());
62 62
 
63 63
 
64
-		$this->assertEquals( 10, $couponCode->getCount() );
65
-		$this->assertEquals( 'jobimporttest', $couponCode->getCode() );
66
-		$this->assertEquals( '2000-01-01 00:00:00', $couponCode->getDateStart() );
67
-		$this->assertEquals( null, $couponCode->getDateEnd() );
64
+		$this->assertEquals(10, $couponCode->getCount());
65
+		$this->assertEquals('jobimporttest', $couponCode->getCode());
66
+		$this->assertEquals('2000-01-01 00:00:00', $couponCode->getDateStart());
67
+		$this->assertEquals(null, $couponCode->getDateEnd());
68 68
 	}
69 69
 
70 70
 
@@ -86,23 +86,23 @@  discard block
 block discarded – undo
86 86
 		);
87 87
 
88 88
 
89
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon' );
90
-		$codeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon/code' );
89
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon');
90
+		$codeManager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon/code');
91 91
 
92
-		$coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) );
92
+		$coupon = $manager->saveItem($manager->createItem()->setProvider('test'));
93 93
 		$couponCode = $codeManager->createItem();
94
-		$couponCode->setParentId( $coupon->getId() );
94
+		$couponCode->setParentId($coupon->getId());
95 95
 
96
-		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint );
97
-		$object->process( $couponCode, $data );
98
-		$object->process( $couponCode, $dataUpdate );
96
+		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint);
97
+		$object->process($couponCode, $data);
98
+		$object->process($couponCode, $dataUpdate);
99 99
 
100
-		$codeManager->deleteItem( $couponCode->getId() );
101
-		$manager->deleteItem( $coupon->getId() );
100
+		$codeManager->deleteItem($couponCode->getId());
101
+		$manager->deleteItem($coupon->getId());
102 102
 
103 103
 
104
-		$this->assertEquals( 5, $couponCode->getCount() );
105
-		$this->assertEquals( 'jobimporttest', $couponCode->getCode() );
104
+		$this->assertEquals(5, $couponCode->getCount());
105
+		$this->assertEquals('jobimporttest', $couponCode->getCode());
106 106
 	}
107 107
 
108 108
 
@@ -119,20 +119,20 @@  discard block
 block discarded – undo
119 119
 		);
120 120
 
121 121
 
122
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon' );
123
-		$codeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon/code' );
122
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon');
123
+		$codeManager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon/code');
124 124
 
125
-		$coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) );
125
+		$coupon = $manager->saveItem($manager->createItem()->setProvider('test'));
126 126
 		$couponCode = $codeManager->createItem();
127
-		$couponCode->setParentId( $coupon->getId() );
127
+		$couponCode->setParentId($coupon->getId());
128 128
 
129
-		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint );
130
-		$object->process( $couponCode, $data );
129
+		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint);
130
+		$object->process($couponCode, $data);
131 131
 
132
-		$codeManager->deleteItem( $couponCode->getId() );
133
-		$manager->deleteItem( $coupon->getId() );
132
+		$codeManager->deleteItem($couponCode->getId());
133
+		$manager->deleteItem($coupon->getId());
134 134
 
135 135
 
136
-		$this->assertEquals( 0, $couponCode->getCount() );
136
+		$this->assertEquals(0, $couponCode->getCount());
137 137
 	}
138 138
 }
139 139
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Coupon/Import/Csv/Code/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/coupon/import/csv/code/name
35 35
 		 * Class name of the used coupon code import job controller implementation
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
 		 * @since 2017.10
65 65
 		 * @category Developer
66 66
 		 */
67
-		if ( $name === null ) {
67
+		if ($name === null) {
68 68
 			$name = $context->getConfig()->get('controller/jobs/coupon/import/csv/code/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\\Coupon\\Import\\Csv\\Code\\' . $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\\Coupon\\Import\\Csv\\Code\\' . $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/coupon/import/csv/code/decorators/excludes
83 83
 		 * Excludes decorators added by the "common" option from the coupon code import CSV job controller
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/coupon/import/csv/code/decorators/excludes
155 155
 		 * @see controller/jobs/coupon/import/csv/code/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'coupon/import/csv/code' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'coupon/import/csv/code');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/tests/Controller/Jobs/Product/Bought/StandardTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,18 +19,18 @@  discard block
 block discarded – undo
19 19
 
20 20
 	protected function setUp()
21 21
 	{
22
-		\Aimeos\MShop\Factory::setCache( true );
22
+		\Aimeos\MShop\Factory::setCache(true);
23 23
 
24 24
 		$this->context = \TestHelperJobs::getContext();
25 25
 		$this->aimeos = \TestHelperJobs::getAimeos();
26 26
 
27
-		$this->object = new \Aimeos\Controller\Jobs\Product\Bought\Standard( $this->context, $this->aimeos );
27
+		$this->object = new \Aimeos\Controller\Jobs\Product\Bought\Standard($this->context, $this->aimeos);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		\Aimeos\MShop\Factory::setCache( false );
33
+		\Aimeos\MShop\Factory::setCache(false);
34 34
 		\Aimeos\MShop\Factory::clear();
35 35
 
36 36
 		$this->object = null;
@@ -39,28 +39,28 @@  discard block
 block discarded – undo
39 39
 
40 40
 	public function testGetName()
41 41
 	{
42
-		$this->assertEquals( 'Products bought together', $this->object->getName() );
42
+		$this->assertEquals('Products bought together', $this->object->getName());
43 43
 	}
44 44
 
45 45
 
46 46
 	public function testGetDescription()
47 47
 	{
48 48
 		$text = 'Creates bought together product suggestions';
49
-		$this->assertEquals( $text, $this->object->getDescription() );
49
+		$this->assertEquals($text, $this->object->getDescription());
50 50
 	}
51 51
 
52 52
 
53 53
 	public function testRun()
54 54
 	{
55
-		$stub = $this->getMockBuilder( '\\Aimeos\\MShop\\Product\\Manager\\Lists\\Standard' )
56
-			->setConstructorArgs( array( $this->context ) )
57
-			->setMethods( array( 'deleteItems', 'saveItem' ) )
55
+		$stub = $this->getMockBuilder('\\Aimeos\\MShop\\Product\\Manager\\Lists\\Standard')
56
+			->setConstructorArgs(array($this->context))
57
+			->setMethods(array('deleteItems', 'saveItem'))
58 58
 			->getMock();
59 59
 
60
-		\Aimeos\MShop\Factory::injectManager( $this->context, 'product/lists', $stub );
60
+		\Aimeos\MShop\Factory::injectManager($this->context, 'product/lists', $stub);
61 61
 
62
-		$stub->expects( $this->atLeastOnce() )->method( 'deleteItems' );
63
-		$stub->expects( $this->atLeastOnce() )->method( 'saveItem' );
62
+		$stub->expects($this->atLeastOnce())->method('deleteItems');
63
+		$stub->expects($this->atLeastOnce())->method('saveItem');
64 64
 
65 65
 		$this->object->run();
66 66
 	}
Please login to merge, or discard this patch.