@@ -27,8 +27,8 @@ discard block |
||
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\Catalog\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\Catalog\Import\Csv\Processor\Iface $processor = null ) |
|
30 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
31 | + \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor = null) |
|
32 | 32 | { |
33 | 33 | } |
34 | 34 | |
@@ -40,7 +40,7 @@ discard block |
||
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\Catalog\Item\Iface $catalog, array $data ) |
|
43 | + public function process(\Aimeos\MShop\Catalog\Item\Iface $catalog, array $data) |
|
44 | 44 | { |
45 | 45 | return $data; |
46 | 46 | } |
@@ -26,8 +26,8 @@ discard block |
||
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\Catalog\Import\Csv\Processor\Iface $processor Decorated processor |
28 | 28 | */ |
29 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
30 | - \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor = null ); |
|
29 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
30 | + \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor = null); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | /** |
@@ -37,5 +37,5 @@ discard block |
||
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\Catalog\Item\Iface $catalog, array $data ); |
|
40 | + public function process(\Aimeos\MShop\Catalog\Item\Iface $catalog, array $data); |
|
41 | 41 | } |
42 | 42 | \ 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 | * Returns the item or ID for the given code |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | * @param string|null $type Item type if used and required |
34 | 34 | * @return \Aimeos\MShop\Common\Item\Iface|string|null Item object, unique ID or null if not found |
35 | 35 | */ |
36 | - public function get( $code, $type = null ); |
|
36 | + public function get($code, $type = null); |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Adds the item or ID to the cache |
40 | 40 | * |
41 | 41 | * @param \Aimeos\MShop\Common\Item\Iface $item Item object |
42 | 42 | */ |
43 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ); |
|
43 | + public function set(\Aimeos\MShop\Common\Item\Iface $item); |
|
44 | 44 | } |
@@ -27,7 +27,7 @@ |
||
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 | } |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | $context = \TestHelperJobs::getContext(); |
17 | 17 | $aimeos = \TestHelperJobs::getAimeos(); |
18 | 18 | |
19 | - $obj = \Aimeos\Controller\Jobs\Catalog\Import\Csv\Factory::createController( $context, $aimeos ); |
|
20 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
19 | + $obj = \Aimeos\Controller\Jobs\Catalog\Import\Csv\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\Catalog\Import\Csv\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
29 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
30 | + \Aimeos\Controller\Jobs\Catalog\Import\Csv\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\Catalog\Import\Csv\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
39 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
40 | + \Aimeos\Controller\Jobs\Catalog\Import\Csv\Factory::createController($context, $aimeos, 'WrongClass'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -46,7 +46,7 @@ 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\Catalog\Import\Csv\Factory::createController( $context, $aimeos, 'Factory' ); |
|
49 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
50 | + \Aimeos\Controller\Jobs\Catalog\Import\Csv\Factory::createController($context, $aimeos, 'Factory'); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | \ No newline at end of file |
@@ -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/catalog/import/csv/name |
35 | 35 | * Class name of the used catalog 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/catalog/import/csv/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\\Catalog\\Import\\Csv\\' . $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\\Catalog\\Import\\Csv\\' . $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/catalog/import/csv/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the catalog import CSV job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/catalog/import/csv/decorators/excludes |
155 | 155 | * @see controller/jobs/catalog/import/csv/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'catalog/import/csv' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'catalog/import/csv'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -40,28 +40,28 @@ |
||
40 | 40 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Full subscription with associated items |
41 | 41 | * @return array Two dimensional associative list of subscription 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 | $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 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
30 | 30 | * @param array $mapping Associative list of field position in CSV as key and domain item key as value |
31 | 31 | */ |
32 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping ) |
|
32 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping) |
|
33 | 33 | { |
34 | 34 | $this->context = $context; |
35 | 35 | $this->mapping = $mapping; |
@@ -25,7 +25,7 @@ discard block |
||
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 |
||
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\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Base\Iface $order ); |
|
38 | + public function process(\Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Base\Iface $order); |
|
39 | 39 | } |
40 | 40 | \ No newline at end of file |