Completed
Push — master ( cbc921...0b1729 )
by Aimeos
02:05
created
src/Controller/Common/Catalog/Import/Csv/Processor/Media/Standard.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
44 44
 	 * @param \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object Decorated processor
45 45
 	 */
46
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
47
-			\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object = null )
46
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
47
+			\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object = null)
48 48
 	{
49
-		parent::__construct( $context, $mapping, $object );
49
+		parent::__construct($context, $mapping, $object);
50 50
 
51 51
 		/** controller/common/catalog/import/csv/processor/media/listtypes
52 52
 		 * Names of the catalog list types for media that are updated or removed
@@ -68,32 +68,32 @@  discard block
 block discarded – undo
68 68
 		 * @see controller/common/catalog/import/csv/processor/text/listtypes
69 69
 		 */
70 70
 		$key = 'controller/common/catalog/import/csv/processor/media/listtypes';
71
-		$this->listTypes = $context->getConfig()->get( $key );
71
+		$this->listTypes = $context->getConfig()->get($key);
72 72
 
73
-		if( $this->listTypes === null )
73
+		if ($this->listTypes === null)
74 74
 		{
75 75
 			$this->listTypes = [];
76
-			$manager = \Aimeos\MShop::create( $context, 'catalog/lists/type' );
76
+			$manager = \Aimeos\MShop::create($context, 'catalog/lists/type');
77 77
 
78
-			$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
79
-			$search->setConditions( $search->compare( '==', 'catalog.lists.type.domain', 'media' ) );
78
+			$search = $manager->createSearch()->setSlice(0, 0x7fffffff);
79
+			$search->setConditions($search->compare('==', 'catalog.lists.type.domain', 'media'));
80 80
 
81
-			foreach( $manager->searchItems( $search ) as $item ) {
81
+			foreach ($manager->searchItems($search) as $item) {
82 82
 				$this->listTypes[$item->getCode()] = $item->getCode();
83 83
 			}
84 84
 		}
85 85
 		else
86 86
 		{
87
-			$this->listTypes = array_flip( $this->listTypes );
87
+			$this->listTypes = array_flip($this->listTypes);
88 88
 		}
89 89
 
90 90
 
91
-		$manager = \Aimeos\MShop::create( $context, 'media/type' );
91
+		$manager = \Aimeos\MShop::create($context, 'media/type');
92 92
 
93
-		$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
94
-		$search->setConditions( $search->compare( '==', 'media.type.domain', 'catalog' ) );
93
+		$search = $manager->createSearch()->setSlice(0, 0x7fffffff);
94
+		$search->setConditions($search->compare('==', 'media.type.domain', 'catalog'));
95 95
 
96
-		foreach( $manager->searchItems( $search ) as $item ) {
96
+		foreach ($manager->searchItems($search) as $item) {
97 97
 			$this->types[$item->getCode()] = $item->getCode();
98 98
 		}
99 99
 	}
@@ -106,58 +106,58 @@  discard block
 block discarded – undo
106 106
 	 * @param array $data List of CSV fields with position as key and data as value
107 107
 	 * @return array List of data which hasn't been imported
108 108
 	 */
109
-	public function process( \Aimeos\MShop\Catalog\Item\Iface $catalog, array $data )
109
+	public function process(\Aimeos\MShop\Catalog\Item\Iface $catalog, array $data)
110 110
 	{
111 111
 		$context = $this->getContext();
112
-		$manager = \Aimeos\MShop::create( $context, 'media' );
113
-		$listManager = \Aimeos\MShop::create( $context, 'catalog/lists' );
114
-		$separator = $context->getConfig()->get( 'controller/common/catalog/import/csv/separator', "\n" );
112
+		$manager = \Aimeos\MShop::create($context, 'media');
113
+		$listManager = \Aimeos\MShop::create($context, 'catalog/lists');
114
+		$separator = $context->getConfig()->get('controller/common/catalog/import/csv/separator', "\n");
115 115
 
116 116
 		$listMap = [];
117
-		$map = $this->getMappedChunk( $data, $this->getMapping() );
118
-		$listItems = $catalog->getListItems( 'media', $this->listTypes );
117
+		$map = $this->getMappedChunk($data, $this->getMapping());
118
+		$listItems = $catalog->getListItems('media', $this->listTypes);
119 119
 
120
-		foreach( $listItems as $listItem )
120
+		foreach ($listItems as $listItem)
121 121
 		{
122
-			if( ( $refItem = $listItem->getRefItem() ) !== null ) {
123
-				$listMap[ $refItem->getUrl() ][ $refItem->getType() ][ $listItem->getType() ] = $listItem;
122
+			if (($refItem = $listItem->getRefItem()) !== null) {
123
+				$listMap[$refItem->getUrl()][$refItem->getType()][$listItem->getType()] = $listItem;
124 124
 			}
125 125
 		}
126 126
 
127
-		foreach( $map as $pos => $list )
127
+		foreach ($map as $pos => $list)
128 128
 		{
129
-			if( $this->checkEntry( $list ) === false ) {
129
+			if ($this->checkEntry($list) === false) {
130 130
 				continue;
131 131
 			}
132 132
 
133
-			$type = $this->getValue( $list, 'media.type', 'default' );
134
-			$listtype = $this->getValue( $list, 'catalog.lists.type', 'default' );
135
-			$urls = explode( $separator, $this->getValue( $list, 'media.url', '' ) );
133
+			$type = $this->getValue($list, 'media.type', 'default');
134
+			$listtype = $this->getValue($list, 'catalog.lists.type', 'default');
135
+			$urls = explode($separator, $this->getValue($list, 'media.url', ''));
136 136
 
137
-			foreach( $urls as $url )
137
+			foreach ($urls as $url)
138 138
 			{
139
-				if( isset( $listMap[$url][$type][$listtype] ) )
139
+				if (isset($listMap[$url][$type][$listtype]))
140 140
 				{
141 141
 					$listItem = $listMap[$url][$type][$listtype];
142 142
 					$refItem = $listItem->getRefItem();
143
-					unset( $listItems[ $listItem->getId() ] );
143
+					unset($listItems[$listItem->getId()]);
144 144
 				}
145 145
 				else
146 146
 				{
147
-					$listItem = $listManager->createItem()->setType( $listtype );
148
-					$refItem = $manager->createItem()->setType( $type );
147
+					$listItem = $listManager->createItem()->setType($listtype);
148
+					$refItem = $manager->createItem()->setType($type);
149 149
 				}
150 150
 
151
-				$listItem = $listItem->setPosition( $pos++ )->fromArray( $list );
152
-				$refItem = $refItem->setLabel( $url )->setPreview( $url )->fromArray( $list )->setUrl( $url );
151
+				$listItem = $listItem->setPosition($pos++)->fromArray($list);
152
+				$refItem = $refItem->setLabel($url)->setPreview($url)->fromArray($list)->setUrl($url);
153 153
 
154
-				$catalog->addListItem( 'media', $listItem, $refItem );
154
+				$catalog->addListItem('media', $listItem, $refItem);
155 155
 			}
156 156
 		}
157 157
 
158
-		$catalog->deleteListItems( $listItems, true );
158
+		$catalog->deleteListItems($listItems, true);
159 159
 
160
-		return $this->getObject()->process( $catalog, $data );
160
+		return $this->getObject()->process($catalog, $data);
161 161
 	}
162 162
 
163 163
 
@@ -167,22 +167,22 @@  discard block
 block discarded – undo
167 167
 	 * @param array $list Associative list of key/value pairs from the mapping
168 168
 	 * @return boolean True if valid, false if not
169 169
 	 */
170
-	protected function checkEntry( array $list )
170
+	protected function checkEntry(array $list)
171 171
 	{
172
-		if( $this->getValue( $list, 'media.url' ) === null ) {
172
+		if ($this->getValue($list, 'media.url') === null) {
173 173
 			return false;
174 174
 		}
175 175
 
176
-		if( ( $type = $this->getValue( $list, 'catalog.lists.type' ) ) && !isset( $this->listTypes[$type] ) )
176
+		if (($type = $this->getValue($list, 'catalog.lists.type')) && !isset($this->listTypes[$type]))
177 177
 		{
178
-			$msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'catalog list' );
179
-			throw new \Aimeos\Controller\Common\Exception( $msg );
178
+			$msg = sprintf('Invalid type "%1$s" (%2$s)', $type, 'catalog list');
179
+			throw new \Aimeos\Controller\Common\Exception($msg);
180 180
 		}
181 181
 
182
-		if( ( $type = $this->getValue( $list, 'media.type' ) ) && !isset( $this->types[$type] ) )
182
+		if (($type = $this->getValue($list, 'media.type')) && !isset($this->types[$type]))
183 183
 		{
184
-			$msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'media' );
185
-			throw new \Aimeos\Controller\Common\Exception( $msg );
184
+			$msg = sprintf('Invalid type "%1$s" (%2$s)', $type, 'media');
185
+			throw new \Aimeos\Controller\Common\Exception($msg);
186 186
 		}
187 187
 
188 188
 		return true;
Please login to merge, or discard this patch.
common/src/Controller/Common/Catalog/Import/Csv/Processor/Text/Standard.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
44 44
 	 * @param \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object Decorated processor
45 45
 	 */
46
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
47
-			\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object = null )
46
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
47
+			\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $object = null)
48 48
 	{
49
-		parent::__construct( $context, $mapping, $object );
49
+		parent::__construct($context, $mapping, $object);
50 50
 
51 51
 		/** controller/common/catalog/import/csv/processor/text/listtypes
52 52
 		 * Names of the catalog list types for texts that are updated or removed
@@ -68,32 +68,32 @@  discard block
 block discarded – undo
68 68
 		 * @see controller/common/catalog/import/csv/processor/catalog/listtypes
69 69
 		 */
70 70
 		$key = 'controller/common/catalog/import/csv/processor/text/listtypes';
71
-		$this->listTypes = $context->getConfig()->get( $key );
71
+		$this->listTypes = $context->getConfig()->get($key);
72 72
 
73
-		if( $this->listTypes === null )
73
+		if ($this->listTypes === null)
74 74
 		{
75 75
 			$this->listTypes = [];
76
-			$manager = \Aimeos\MShop::create( $context, 'catalog/lists/type' );
76
+			$manager = \Aimeos\MShop::create($context, 'catalog/lists/type');
77 77
 
78
-			$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
79
-			$search->setConditions( $search->compare( '==', 'catalog.lists.type.domain', 'text' ) );
78
+			$search = $manager->createSearch()->setSlice(0, 0x7fffffff);
79
+			$search->setConditions($search->compare('==', 'catalog.lists.type.domain', 'text'));
80 80
 
81
-			foreach( $manager->searchItems( $search ) as $item ) {
81
+			foreach ($manager->searchItems($search) as $item) {
82 82
 				$this->listTypes[$item->getCode()] = $item->getCode();
83 83
 			}
84 84
 		}
85 85
 		else
86 86
 		{
87
-			$this->listTypes = array_flip( $this->listTypes );
87
+			$this->listTypes = array_flip($this->listTypes);
88 88
 		}
89 89
 
90 90
 
91
-		$manager = \Aimeos\MShop::create( $context, 'text/type' );
91
+		$manager = \Aimeos\MShop::create($context, 'text/type');
92 92
 
93
-		$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
94
-		$search->setConditions( $search->compare( '==', 'text.type.domain', 'catalog' ) );
93
+		$search = $manager->createSearch()->setSlice(0, 0x7fffffff);
94
+		$search->setConditions($search->compare('==', 'text.type.domain', 'catalog'));
95 95
 
96
-		foreach( $manager->searchItems( $search ) as $item ) {
96
+		foreach ($manager->searchItems($search) as $item) {
97 97
 			$this->types[$item->getCode()] = $item->getCode();
98 98
 		}
99 99
 	}
@@ -106,55 +106,55 @@  discard block
 block discarded – undo
106 106
 	 * @param array $data List of CSV fields with position as key and data as value
107 107
 	 * @return array List of data which hasn't been imported
108 108
 	 */
109
-	public function process( \Aimeos\MShop\Catalog\Item\Iface $catalog, array $data )
109
+	public function process(\Aimeos\MShop\Catalog\Item\Iface $catalog, array $data)
110 110
 	{
111
-		$listManager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists' );
112
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'text' );
111
+		$listManager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists');
112
+		$manager = \Aimeos\MShop::create($this->getContext(), 'text');
113 113
 
114 114
 		$listMap = [];
115
-		$map = $this->getMappedChunk( $data, $this->getMapping() );
116
-		$listItems = $catalog->getListItems( 'text', $this->listTypes );
115
+		$map = $this->getMappedChunk($data, $this->getMapping());
116
+		$listItems = $catalog->getListItems('text', $this->listTypes);
117 117
 
118
-		foreach( $listItems as $listItem )
118
+		foreach ($listItems as $listItem)
119 119
 		{
120
-			if( ( $refItem = $listItem->getRefItem() ) !== null ) {
121
-				$listMap[ $refItem->getContent() ][ $refItem->getType() ][ $listItem->getType() ] = $listItem;
120
+			if (($refItem = $listItem->getRefItem()) !== null) {
121
+				$listMap[$refItem->getContent()][$refItem->getType()][$listItem->getType()] = $listItem;
122 122
 			}
123 123
 		}
124 124
 
125
-		foreach( $map as $pos => $list )
125
+		foreach ($map as $pos => $list)
126 126
 		{
127
-			if( $this->checkEntry( $list ) === false ) {
127
+			if ($this->checkEntry($list) === false) {
128 128
 				continue;
129 129
 			}
130 130
 
131
-			$type = $this->getValue( $list, 'text.type', 'name' );
132
-			$listtype = $this->getValue( $list, 'catalog.lists.type', 'default' );
133
-			$content = $this->getValue( $list, 'text.content', '' );
131
+			$type = $this->getValue($list, 'text.type', 'name');
132
+			$listtype = $this->getValue($list, 'catalog.lists.type', 'default');
133
+			$content = $this->getValue($list, 'text.content', '');
134 134
 
135
-			if( isset( $listMap[$content][$type][$listtype] ) )
135
+			if (isset($listMap[$content][$type][$listtype]))
136 136
 			{
137 137
 				$listItem = $listMap[$content][$type][$listtype];
138 138
 				$refItem = $listItem->getRefItem();
139
-				unset( $listItems[ $listItem->getId() ] );
139
+				unset($listItems[$listItem->getId()]);
140 140
 			}
141 141
 			else
142 142
 			{
143
-				$listItem = $listManager->createItem()->setType( $listtype );
144
-				$refItem = $manager->createItem()->setType( $type );
143
+				$listItem = $listManager->createItem()->setType($listtype);
144
+				$refItem = $manager->createItem()->setType($type);
145 145
 			}
146 146
 
147
-			$listItem = $listItem->setPosition( $pos )->fromArray( $list );
147
+			$listItem = $listItem->setPosition($pos)->fromArray($list);
148 148
 
149
-			$label = mb_strcut( $this->getValue( $list, 'text.content', '' ), 0, 255 );
150
-			$refItem = $refItem->setLabel( $label )->fromArray( $list );
149
+			$label = mb_strcut($this->getValue($list, 'text.content', ''), 0, 255);
150
+			$refItem = $refItem->setLabel($label)->fromArray($list);
151 151
 
152
-			$catalog->addListItem( 'text', $listItem, $refItem );
152
+			$catalog->addListItem('text', $listItem, $refItem);
153 153
 		}
154 154
 
155
-		$catalog->deleteListItems( $listItems, true );
155
+		$catalog->deleteListItems($listItems, true);
156 156
 
157
-		return $this->getObject()->process( $catalog, $data );
157
+		return $this->getObject()->process($catalog, $data);
158 158
 	}
159 159
 
160 160
 
@@ -164,22 +164,22 @@  discard block
 block discarded – undo
164 164
 	 * @param array $list Associative list of key/value pairs from the mapping
165 165
 	 * @return boolean True if valid, false if not
166 166
 	 */
167
-	protected function checkEntry( array $list )
167
+	protected function checkEntry(array $list)
168 168
 	{
169
-		if( $this->getValue( $list, 'text.content' ) === null ) {
169
+		if ($this->getValue($list, 'text.content') === null) {
170 170
 			return false;
171 171
 		}
172 172
 
173
-		if( ( $type = $this->getValue( $list, 'catalog.lists.type' ) ) && !isset( $this->listTypes[$type] ) )
173
+		if (($type = $this->getValue($list, 'catalog.lists.type')) && !isset($this->listTypes[$type]))
174 174
 		{
175
-			$msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'catalog list' );
176
-			throw new \Aimeos\Controller\Common\Exception( $msg );
175
+			$msg = sprintf('Invalid type "%1$s" (%2$s)', $type, 'catalog list');
176
+			throw new \Aimeos\Controller\Common\Exception($msg);
177 177
 		}
178 178
 
179
-		if( ( $type = $this->getValue( $list, 'text.type' ) ) && !isset( $this->types[$type] ) )
179
+		if (($type = $this->getValue($list, 'text.type')) && !isset($this->types[$type]))
180 180
 		{
181
-			$msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'text' );
182
-			throw new \Aimeos\Controller\Common\Exception( $msg );
181
+			$msg = sprintf('Invalid type "%1$s" (%2$s)', $type, 'text');
182
+			throw new \Aimeos\Controller\Common\Exception($msg);
183 183
 		}
184 184
 
185 185
 		return true;
Please login to merge, or discard this patch.
controller/common/tests/TestHelperCntl.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@  discard block
 block discarded – undo
15 15
 	public static function bootstrap()
16 16
 	{
17 17
 		self::getAimeos();
18
-		\Aimeos\MShop::cache( false );
18
+		\Aimeos\MShop::cache(false);
19 19
 	}
20 20
 
21 21
 
22
-	public static function getContext( $site = 'unittest' )
22
+	public static function getContext($site = 'unittest')
23 23
 	{
24
-		if( !isset( self::$context[$site] ) ) {
25
-			self::$context[$site] = self::createContext( $site );
24
+		if (!isset(self::$context[$site])) {
25
+			self::$context[$site] = self::createContext($site);
26 26
 		}
27 27
 
28 28
 		return clone self::$context[$site];
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
 
32 32
 	public static function getAimeos()
33 33
 	{
34
-		if( !isset( self::$aimeos ) )
34
+		if (!isset(self::$aimeos))
35 35
 		{
36 36
 			require_once 'Bootstrap.php';
37
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
37
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
38 38
 
39
-			$extdir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) );
40
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true );
39
+			$extdir = dirname(dirname(dirname(dirname(dirname(__FILE__)))));
40
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true);
41 41
 		}
42 42
 
43 43
 		return self::$aimeos;
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	/**
48 48
 	 * @param string $site
49 49
 	 */
50
-	private static function createContext( $site )
50
+	private static function createContext($site)
51 51
 	{
52 52
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
53 53
 		$aimeos = self::getAimeos();
@@ -57,30 +57,30 @@  discard block
 block discarded – undo
57 57
 		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
58 58
 		$file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser';
59 59
 
60
-		$conf = new \Aimeos\MW\Config\PHPArray( [], $paths );
61
-		$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf );
62
-		$conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file );
63
-		$ctx->setConfig( $conf );
60
+		$conf = new \Aimeos\MW\Config\PHPArray([], $paths);
61
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
62
+		$conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file);
63
+		$ctx->setConfig($conf);
64 64
 
65 65
 
66
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
67
-		$ctx->setDatabaseManager( $dbm );
66
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
67
+		$ctx->setDatabaseManager($dbm);
68 68
 
69 69
 
70
-		$logger = new \Aimeos\MW\Logger\File( 'unittest.log', \Aimeos\MW\Logger\Base::DEBUG );
71
-		$ctx->setLogger( $logger );
70
+		$logger = new \Aimeos\MW\Logger\File('unittest.log', \Aimeos\MW\Logger\Base::DEBUG);
71
+		$ctx->setLogger($logger);
72 72
 
73 73
 
74 74
 		$session = new \Aimeos\MW\Session\None();
75
-		$ctx->setSession( $session );
75
+		$ctx->setSession($session);
76 76
 
77 77
 
78
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create( $ctx );
79
-		$locale = $localeManager->bootstrap( $site, '', '', false );
80
-		$ctx->setLocale( $locale );
78
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create($ctx);
79
+		$locale = $localeManager->bootstrap($site, '', '', false);
80
+		$ctx->setLocale($locale);
81 81
 
82 82
 
83
-		$ctx->setEditor( 'core:controller/common' );
83
+		$ctx->setEditor('core:controller/common');
84 84
 
85 85
 		return $ctx;
86 86
 	}
Please login to merge, or discard this patch.
tests/Controller/Common/Product/Import/Csv/Cache/Product/StandardTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,41 +16,41 @@
 block discarded – undo
16 16
 
17 17
 	protected function setUp()
18 18
 	{
19
-		\Aimeos\MShop::cache( true );
19
+		\Aimeos\MShop::cache(true);
20 20
 
21 21
 		$context = \TestHelperCntl::getContext();
22
-		$this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard( $context );
22
+		$this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard($context);
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		\Aimeos\MShop::cache( false );
28
+		\Aimeos\MShop::cache(false);
29 29
 		\Aimeos\MShop::clear();
30 30
 	}
31 31
 
32 32
 
33 33
 	public function testGet()
34 34
 	{
35
-		$this->assertNotEquals( null, $this->object->get( 'CNC' ) );
35
+		$this->assertNotEquals(null, $this->object->get('CNC'));
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::create( \TestHelperCntl::getContext(), 'product' )->createItem();
48
-		$item->setCode( 'cache-test' );
49
-		$item->setId( 1 );
47
+		$item = \Aimeos\MShop::create(\TestHelperCntl::getContext(), 'product')->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
Please login to merge, or discard this patch.
tests/Controller/Common/Product/Import/Csv/Cache/Catalog/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -16,44 +16,44 @@
 block discarded – undo
16 16
 
17 17
 	protected function setUp()
18 18
 	{
19
-		\Aimeos\MShop::cache( true );
19
+		\Aimeos\MShop::cache(true);
20 20
 
21 21
 		$context = \TestHelperCntl::getContext();
22
-		$this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard( $context );
22
+		$this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard($context);
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		\Aimeos\MShop::cache( false );
28
+		\Aimeos\MShop::cache(false);
29 29
 		\Aimeos\MShop::clear();
30 30
 	}
31 31
 
32 32
 
33 33
 	public function testGet()
34 34
 	{
35
-		$result = $this->object->get( 'root' );
35
+		$result = $this->object->get('root');
36 36
 
37
-		$this->assertNotEquals( null, $result );
38
-		$this->assertInternalType( 'integer', $result );
37
+		$this->assertNotEquals(null, $result);
38
+		$this->assertInternalType('integer', $result);
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testGetUnknown()
43 43
 	{
44
-		$this->assertEquals( null, $this->object->get( 'cache-test' ) );
44
+		$this->assertEquals(null, $this->object->get('cache-test'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testSet()
49 49
 	{
50
-		$item = \Aimeos\MShop::create( \TestHelperCntl::getContext(), 'catalog' )->createItem();
51
-		$item->setCode( 'cache-test' );
52
-		$item->setId( 1 );
50
+		$item = \Aimeos\MShop::create(\TestHelperCntl::getContext(), 'catalog')->createItem();
51
+		$item->setCode('cache-test');
52
+		$item->setId(1);
53 53
 
54
-		$this->object->set( $item );
55
-		$id = $this->object->get( 'cache-test' );
54
+		$this->object->set($item);
55
+		$id = $this->object->get('cache-test');
56 56
 
57
-		$this->assertEquals( $item->getId(), $id );
57
+		$this->assertEquals($item->getId(), $id);
58 58
 	}
59 59
 }
60 60
\ No newline at end of file
Please login to merge, or discard this patch.
Controller/Common/Product/Import/Csv/Processor/Product/StandardTest.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 
19 19
 	protected function setUp()
20 20
 	{
21
-		\Aimeos\MShop::cache( true );
21
+		\Aimeos\MShop::cache(true);
22 22
 
23 23
 		$this->context = \TestHelperCntl::getContext();
24
-		$this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] );
24
+		$this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []);
25 25
 
26
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
26
+		$manager = \Aimeos\MShop::create($this->context, 'product');
27 27
 		$search = $manager->createSearch();
28
-		$search->setConditions( $search->compare( '==', 'product.code', ['CNC', 'CNE'] ) );
28
+		$search->setConditions($search->compare('==', 'product.code', ['CNC', 'CNE']));
29 29
 
30 30
 		$this->products = [];
31
-		foreach( $manager->searchItems( $search ) as $id => $item ) {
31
+		foreach ($manager->searchItems($search) as $id => $item) {
32 32
 			$this->products[$item->getCode()] = $id;
33 33
 		}
34 34
 	}
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 	protected function tearDown()
38 38
 	{
39
-		\Aimeos\MShop::cache( false );
39
+		\Aimeos\MShop::cache(false);
40 40
 		\Aimeos\MShop::clear();
41 41
 	}
42 42
 
@@ -57,23 +57,23 @@  discard block
 block discarded – undo
57 57
 			3 => 'CNE',
58 58
 		);
59 59
 
60
-		$product = $this->create( 'job_csv_test' );
60
+		$product = $this->create('job_csv_test');
61 61
 
62
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
63
-		$object->process( $product, $data );
62
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
63
+		$object->process($product, $data);
64 64
 
65 65
 
66
-		$listItems1 = $product->getListItems( 'product', 'default' );
67
-		$listItems2 = $product->getListItems( 'product', 'suggestion' );
66
+		$listItems1 = $product->getListItems('product', 'default');
67
+		$listItems2 = $product->getListItems('product', 'suggestion');
68 68
 
69
-		$this->assertEquals( 1, count( $listItems1 ) );
70
-		$this->assertEquals( 1, count( $listItems2 ) );
69
+		$this->assertEquals(1, count($listItems1));
70
+		$this->assertEquals(1, count($listItems2));
71 71
 
72
-		$this->assertEquals( 1, reset( $listItems1 )->getStatus() );
73
-		$this->assertEquals( 1, reset( $listItems2 )->getStatus() );
72
+		$this->assertEquals(1, reset($listItems1)->getStatus());
73
+		$this->assertEquals(1, reset($listItems2)->getStatus());
74 74
 
75
-		$this->assertEquals( $this->products['CNC'], reset( $listItems1 )->getRefId() );
76
-		$this->assertEquals( $this->products['CNE'], reset( $listItems2 )->getRefId() );
75
+		$this->assertEquals($this->products['CNC'], reset($listItems1)->getRefId());
76
+		$this->assertEquals($this->products['CNE'], reset($listItems2)->getRefId());
77 77
 	}
78 78
 
79 79
 
@@ -89,24 +89,24 @@  discard block
 block discarded – undo
89 89
 			1 => "CNC\nCNE",
90 90
 		);
91 91
 
92
-		$product = $this->create( 'job_csv_test' );
92
+		$product = $this->create('job_csv_test');
93 93
 
94
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
95
-		$object->process( $product, $data );
94
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
95
+		$object->process($product, $data);
96 96
 
97 97
 
98 98
 		$pos = 0;
99 99
 		$listItems = $product->getListItems();
100
-		$prodIds = array( $this->products['CNC'], $this->products['CNE'] );
100
+		$prodIds = array($this->products['CNC'], $this->products['CNE']);
101 101
 
102
-		$this->assertEquals( 2, count( $listItems ) );
102
+		$this->assertEquals(2, count($listItems));
103 103
 
104
-		foreach( $listItems as $listItem )
104
+		foreach ($listItems as $listItem)
105 105
 		{
106
-			$this->assertEquals( 1, $listItem->getStatus() );
107
-			$this->assertEquals( 'product', $listItem->getDomain() );
108
-			$this->assertEquals( 'default', $listItem->getType() );
109
-			$this->assertEquals( $prodIds[$pos], $listItem->getRefId() );
106
+			$this->assertEquals(1, $listItem->getStatus());
107
+			$this->assertEquals('product', $listItem->getDomain());
108
+			$this->assertEquals('default', $listItem->getType());
109
+			$this->assertEquals($prodIds[$pos], $listItem->getRefId());
110 110
 			$pos++;
111 111
 		}
112 112
 	}
@@ -129,20 +129,20 @@  discard block
 block discarded – undo
129 129
 			1 => 'CNE',
130 130
 		);
131 131
 
132
-		$product = $this->create( 'job_csv_test' );
132
+		$product = $this->create('job_csv_test');
133 133
 
134
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
135
-		$object->process( $product, $data );
136
-		$object->process( $product, $dataUpdate );
134
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
135
+		$object->process($product, $data);
136
+		$object->process($product, $dataUpdate);
137 137
 
138 138
 
139 139
 		$listItems = $product->getListItems();
140
-		$listItem = reset( $listItems );
140
+		$listItem = reset($listItems);
141 141
 
142
-		$this->assertEquals( 1, count( $listItems ) );
143
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
142
+		$this->assertEquals(1, count($listItems));
143
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
144 144
 
145
-		$this->assertEquals( $this->products['CNE'], $listItem->getRefId() );
145
+		$this->assertEquals($this->products['CNE'], $listItem->getRefId());
146 146
 	}
147 147
 
148 148
 
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
 			1 => 'CNC',
159 159
 		);
160 160
 
161
-		$product = $this->create( 'job_csv_test' );
161
+		$product = $this->create('job_csv_test');
162 162
 
163
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
164
-		$object->process( $product, $data );
163
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
164
+		$object->process($product, $data);
165 165
 
166
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, [], $this->endpoint );
167
-		$object->process( $product, [] );
166
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, [], $this->endpoint);
167
+		$object->process($product, []);
168 168
 
169 169
 
170
-		$this->assertEquals( 0, count( $product->getListItems() ) );
170
+		$this->assertEquals(0, count($product->getListItems()));
171 171
 	}
172 172
 
173 173
 
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 			3 => 'CNE',
188 188
 		);
189 189
 
190
-		$product = $this->create( 'job_csv_test' );
190
+		$product = $this->create('job_csv_test');
191 191
 
192
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
193
-		$object->process( $product, $data );
192
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
193
+		$object->process($product, $data);
194 194
 
195 195
 
196 196
 		$listItems = $product->getListItems();
197 197
 
198
-		$this->assertEquals( 1, count( $listItems ) );
198
+		$this->assertEquals(1, count($listItems));
199 199
 	}
200 200
 
201 201
 
@@ -215,23 +215,23 @@  discard block
 block discarded – undo
215 215
 			3 => 'CNE',
216 216
 		);
217 217
 
218
-		$this->context->getConfig()->set( 'controller/common/product/import/csv/processor/product/listtypes', array( 'default' ) );
218
+		$this->context->getConfig()->set('controller/common/product/import/csv/processor/product/listtypes', array('default'));
219 219
 
220
-		$product = $this->create( 'job_csv_test' );
220
+		$product = $this->create('job_csv_test');
221 221
 
222
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
222
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
223 223
 
224
-		$this->setExpectedException( '\Aimeos\Controller\Common\Exception' );
225
-		$object->process( $product, $data );
224
+		$this->setExpectedException('\Aimeos\Controller\Common\Exception');
225
+		$object->process($product, $data);
226 226
 	}
227 227
 
228 228
 
229 229
 	/**
230 230
 	 * @param string $code
231 231
 	 */
232
-	protected function create( $code )
232
+	protected function create($code)
233 233
 	{
234
-		$manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context );
235
-		return $manager->createItem()->setCode( $code );
234
+		$manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context);
235
+		return $manager->createItem()->setCode($code);
236 236
 	}
237 237
 }
Please login to merge, or discard this patch.
Controller/Common/Product/Import/Csv/Processor/Property/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::cache( true );
20
+		\Aimeos\MShop::cache(true);
21 21
 
22 22
 		$this->context = \TestHelperCntl::getContext();
23
-		$this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] );
23
+		$this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []);
24 24
 	}
25 25
 
26 26
 
27 27
 	protected function tearDown()
28 28
 	{
29
-		\Aimeos\MShop::cache( false );
29
+		\Aimeos\MShop::cache(false);
30 30
 		\Aimeos\MShop::clear();
31 31
 	}
32 32
 
@@ -49,26 +49,26 @@  discard block
 block discarded – undo
49 49
 			4 => '50',
50 50
 		);
51 51
 
52
-		$product = $this->create( 'job_csv_test' );
52
+		$product = $this->create('job_csv_test');
53 53
 
54
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint );
55
-		$object->process( $product, $data );
54
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint);
55
+		$object->process($product, $data);
56 56
 
57 57
 
58 58
 		$pos = 0;
59 59
 		$expected = array(
60
-			array( 'package-weight', '3.00', 'de' ),
61
-			array( 'package-width', '50', null ),
60
+			array('package-weight', '3.00', 'de'),
61
+			array('package-width', '50', null),
62 62
 		);
63 63
 
64 64
 		$items = $product->getPropertyItems();
65
-		$this->assertEquals( 2, count( $items ) );
65
+		$this->assertEquals(2, count($items));
66 66
 
67
-		foreach( $items as $item )
67
+		foreach ($items as $item)
68 68
 		{
69
-			$this->assertEquals( $expected[$pos][0], $item->getType() );
70
-			$this->assertEquals( $expected[$pos][1], $item->getValue() );
71
-			$this->assertEquals( $expected[$pos][2], $item->getLanguageId() );
69
+			$this->assertEquals($expected[$pos][0], $item->getType());
70
+			$this->assertEquals($expected[$pos][1], $item->getValue());
71
+			$this->assertEquals($expected[$pos][2], $item->getLanguageId());
72 72
 			$pos++;
73 73
 		}
74 74
 	}
@@ -91,21 +91,21 @@  discard block
 block discarded – undo
91 91
 			1 => '10',
92 92
 		);
93 93
 
94
-		$product = $this->create( 'job_csv_test' );
94
+		$product = $this->create('job_csv_test');
95 95
 
96
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint );
97
-		$object->process( $product, $data );
98
-		$object->process( $product, $dataUpdate );
96
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint);
97
+		$object->process($product, $data);
98
+		$object->process($product, $dataUpdate);
99 99
 
100 100
 
101 101
 		$items = $product->getPropertyItems();
102
-		$item = reset( $items );
102
+		$item = reset($items);
103 103
 
104
-		$this->assertEquals( 1, count( $items ) );
105
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item );
104
+		$this->assertEquals(1, count($items));
105
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item);
106 106
 
107
-		$this->assertEquals( 'package-height', $item->getType() );
108
-		$this->assertEquals( '10', $item->getValue() );
107
+		$this->assertEquals('package-height', $item->getType());
108
+		$this->assertEquals('10', $item->getValue());
109 109
 	}
110 110
 
111 111
 
@@ -121,18 +121,18 @@  discard block
 block discarded – undo
121 121
 			1 => '3.00',
122 122
 		);
123 123
 
124
-		$product = $this->create( 'job_csv_test' );
124
+		$product = $this->create('job_csv_test');
125 125
 
126
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint );
127
-		$object->process( $product, $data );
126
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint);
127
+		$object->process($product, $data);
128 128
 
129
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, [], $this->endpoint );
130
-		$object->process( $product, [] );
129
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, [], $this->endpoint);
130
+		$object->process($product, []);
131 131
 
132 132
 
133 133
 		$items = $product->getPropertyItems();
134 134
 
135
-		$this->assertEquals( 0, count( $items ) );
135
+		$this->assertEquals(0, count($items));
136 136
 	}
137 137
 
138 138
 
@@ -152,23 +152,23 @@  discard block
 block discarded – undo
152 152
 			3 => '3.00',
153 153
 		);
154 154
 
155
-		$product = $this->create( 'job_csv_test' );
155
+		$product = $this->create('job_csv_test');
156 156
 
157
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint );
158
-		$object->process( $product, $data );
157
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint);
158
+		$object->process($product, $data);
159 159
 
160 160
 		$items = $product->getPropertyItems();
161 161
 
162
-		$this->assertEquals( 1, count( $items ) );
162
+		$this->assertEquals(1, count($items));
163 163
 	}
164 164
 
165 165
 
166 166
 	/**
167 167
 	 * @param string $code
168 168
 	 */
169
-	protected function create( $code )
169
+	protected function create($code)
170 170
 	{
171
-		$manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context );
172
-		return $manager->createItem()->setCode( $code );
171
+		$manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context);
172
+		return $manager->createItem()->setCode($code);
173 173
 	}
174 174
 }
175 175
\ No newline at end of file
Please login to merge, or discard this patch.
common/tests/Controller/Common/Product/Import/Csv/Processor/DoneTest.php 1 patch
Spacing   +6 added lines, -6 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::cache( true );
20
+		\Aimeos\MShop::cache(true);
21 21
 
22 22
 		$this->context = \TestHelperCntl::getContext();
23
-		$this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] );
23
+		$this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []);
24 24
 	}
25 25
 
26 26
 
27 27
 	protected function tearDown()
28 28
 	{
29
-		\Aimeos\MShop::cache( false );
29
+		\Aimeos\MShop::cache(false);
30 30
 		\Aimeos\MShop::clear();
31 31
 
32 32
 		$this->object = null;
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 
36 36
 	public function testProcess()
37 37
 	{
38
-		$product = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
38
+		$product = \Aimeos\MShop::create($this->context, 'product')->createItem();
39 39
 
40
-		$result = $this->object->process( $product, array( 'test' ) );
40
+		$result = $this->object->process($product, array('test'));
41 41
 
42
-		$this->assertEquals( array( 'test' ), $result );
42
+		$this->assertEquals(array('test'), $result);
43 43
 	}
44 44
 }
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
Controller/Common/Product/Import/Csv/Processor/Catalog/StandardTest.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -18,36 +18,36 @@  discard block
 block discarded – undo
18 18
 
19 19
 	public static function setUpBeforeClass()
20 20
 	{
21
-		$manager = \Aimeos\MShop\Product\Manager\Factory::create( \TestHelperCntl::getContext() );
21
+		$manager = \Aimeos\MShop\Product\Manager\Factory::create(\TestHelperCntl::getContext());
22 22
 
23 23
 		$item = $manager->createItem();
24
-		$item->setCode( 'job_csv_prod' );
25
-		$item->setType( 'default' );
26
-		$item->setStatus( 1 );
24
+		$item->setCode('job_csv_prod');
25
+		$item->setType('default');
26
+		$item->setStatus(1);
27 27
 
28
-		self::$product = $manager->saveItem( $item );
28
+		self::$product = $manager->saveItem($item);
29 29
 	}
30 30
 
31 31
 
32 32
 	public static function tearDownAfterClass()
33 33
 	{
34
-		$manager = \Aimeos\MShop\Product\Manager\Factory::create( \TestHelperCntl::getContext() );
35
-		$manager->deleteItem( self::$product->getId() );
34
+		$manager = \Aimeos\MShop\Product\Manager\Factory::create(\TestHelperCntl::getContext());
35
+		$manager->deleteItem(self::$product->getId());
36 36
 	}
37 37
 
38 38
 
39 39
 	protected function setUp()
40 40
 	{
41
-		\Aimeos\MShop::cache( true );
41
+		\Aimeos\MShop::cache(true);
42 42
 
43 43
 		$this->context = \TestHelperCntl::getContext();
44
-		$this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] );
44
+		$this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []);
45 45
 	}
46 46
 
47 47
 
48 48
 	protected function tearDown()
49 49
 	{
50
-		\Aimeos\MShop::cache( false );
50
+		\Aimeos\MShop::cache(false);
51 51
 		\Aimeos\MShop::clear();
52 52
 	}
53 53
 
@@ -68,30 +68,30 @@  discard block
 block discarded – undo
68 68
 			3 => 'job_csv_test',
69 69
 		);
70 70
 
71
-		$this->create( 'job_csv_test' );
71
+		$this->create('job_csv_test');
72 72
 
73
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint );
74
-		$object->process( self::$product, $data );
73
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint);
74
+		$object->process(self::$product, $data);
75 75
 
76
-		$category = $this->get( 'job_csv_test' );
77
-		$this->delete( $category );
76
+		$category = $this->get('job_csv_test');
77
+		$this->delete($category);
78 78
 
79 79
 
80 80
 		$pos = 0;
81 81
 		$listItems = $category->getListItems();
82 82
 		$expected = array(
83
-			array( 'default', 'job_csv_prod' ),
84
-			array( 'promotion', 'job_csv_prod' ),
83
+			array('default', 'job_csv_prod'),
84
+			array('promotion', 'job_csv_prod'),
85 85
 		);
86 86
 
87
-		$this->assertEquals( 2, count( $listItems ) );
87
+		$this->assertEquals(2, count($listItems));
88 88
 
89
-		foreach( $listItems as $listItem )
89
+		foreach ($listItems as $listItem)
90 90
 		{
91
-			$this->assertEquals( 1, $listItem->getStatus() );
92
-			$this->assertEquals( 'product', $listItem->getDomain() );
93
-			$this->assertEquals( $expected[$pos][0], $listItem->getType() );
94
-			$this->assertEquals( $expected[$pos][1], $listItem->getRefItem()->getCode() );
91
+			$this->assertEquals(1, $listItem->getStatus());
92
+			$this->assertEquals('product', $listItem->getDomain());
93
+			$this->assertEquals($expected[$pos][0], $listItem->getType());
94
+			$this->assertEquals($expected[$pos][1], $listItem->getRefItem()->getCode());
95 95
 			$pos++;
96 96
 		}
97 97
 	}
@@ -113,32 +113,32 @@  discard block
 block discarded – undo
113 113
 			3 => "job_csv_test\njob_csv_test2",
114 114
 		);
115 115
 
116
-		$this->create( 'job_csv_test' );
117
-		$this->create( 'job_csv_test2' );
116
+		$this->create('job_csv_test');
117
+		$this->create('job_csv_test2');
118 118
 
119
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint );
120
-		$object->process( self::$product, $data );
119
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint);
120
+		$object->process(self::$product, $data);
121 121
 
122
-		$category = $this->get( 'job_csv_test' );
123
-		$category2 = $this->get( 'job_csv_test2' );
122
+		$category = $this->get('job_csv_test');
123
+		$category2 = $this->get('job_csv_test2');
124 124
 
125
-		$this->delete( $category );
126
-		$this->delete( $category2 );
125
+		$this->delete($category);
126
+		$this->delete($category2);
127 127
 
128 128
 
129 129
 		$pos = 0;
130
-		$types = array( 'default', 'promotion', 'default', 'promotion' );
130
+		$types = array('default', 'promotion', 'default', 'promotion');
131 131
 
132
-		foreach( array( $category->getListItems(), $category2->getListItems() ) as $listItems )
132
+		foreach (array($category->getListItems(), $category2->getListItems()) as $listItems)
133 133
 		{
134
-			$this->assertEquals( 2, count( $listItems ) );
134
+			$this->assertEquals(2, count($listItems));
135 135
 
136
-			foreach( $listItems as $listItem )
136
+			foreach ($listItems as $listItem)
137 137
 			{
138
-				$this->assertEquals( 1, $listItem->getStatus() );
139
-				$this->assertEquals( 'product', $listItem->getDomain() );
140
-				$this->assertEquals( $types[$pos], $listItem->getType() );
141
-				$this->assertEquals( 'job_csv_prod', $listItem->getRefItem()->getCode() );
138
+				$this->assertEquals(1, $listItem->getStatus());
139
+				$this->assertEquals('product', $listItem->getDomain());
140
+				$this->assertEquals($types[$pos], $listItem->getType());
141
+				$this->assertEquals('job_csv_prod', $listItem->getRefItem()->getCode());
142 142
 				$pos++;
143 143
 			}
144 144
 		}
@@ -162,23 +162,23 @@  discard block
 block discarded – undo
162 162
 			1 => 'job_csv_test',
163 163
 		);
164 164
 
165
-		$this->create( 'job_csv_test' );
165
+		$this->create('job_csv_test');
166 166
 
167
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint );
168
-		$object->process( self::$product, $data );
169
-		$object->process( self::$product, $dataUpdate );
167
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint);
168
+		$object->process(self::$product, $data);
169
+		$object->process(self::$product, $dataUpdate);
170 170
 
171
-		$category = $this->get( 'job_csv_test' );
172
-		$this->delete( $category );
171
+		$category = $this->get('job_csv_test');
172
+		$this->delete($category);
173 173
 
174 174
 
175 175
 		$listItems = $category->getListItems();
176
-		$listItem = reset( $listItems );
176
+		$listItem = reset($listItems);
177 177
 
178
-		$this->assertEquals( 1, count( $listItems ) );
179
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
178
+		$this->assertEquals(1, count($listItems));
179
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
180 180
 
181
-		$this->assertEquals( 'job_csv_prod', $listItem->getRefItem()->getCode() );
181
+		$this->assertEquals('job_csv_prod', $listItem->getRefItem()->getCode());
182 182
 	}
183 183
 
184 184
 
@@ -194,21 +194,21 @@  discard block
 block discarded – undo
194 194
 			1 => 'job_csv_test',
195 195
 		);
196 196
 
197
-		$this->create( 'job_csv_test' );
197
+		$this->create('job_csv_test');
198 198
 
199
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint );
200
-		$object->process( self::$product, $data );
199
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint);
200
+		$object->process(self::$product, $data);
201 201
 
202
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, [], $this->endpoint );
203
-		$object->process( self::$product, [] );
202
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, [], $this->endpoint);
203
+		$object->process(self::$product, []);
204 204
 
205
-		$category = $this->get( 'job_csv_test' );
206
-		$this->delete( $category );
205
+		$category = $this->get('job_csv_test');
206
+		$this->delete($category);
207 207
 
208 208
 
209 209
 		$listItems = $category->getListItems();
210 210
 
211
-		$this->assertEquals( 0, count( $listItems ) );
211
+		$this->assertEquals(0, count($listItems));
212 212
 	}
213 213
 
214 214
 
@@ -228,18 +228,18 @@  discard block
 block discarded – undo
228 228
 			3 => 'job_csv_test',
229 229
 		);
230 230
 
231
-		$this->create( 'job_csv_test' );
231
+		$this->create('job_csv_test');
232 232
 
233
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint );
234
-		$object->process( self::$product, $data );
233
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint);
234
+		$object->process(self::$product, $data);
235 235
 
236
-		$category = $this->get( 'job_csv_test' );
237
-		$this->delete( $category );
236
+		$category = $this->get('job_csv_test');
237
+		$this->delete($category);
238 238
 
239 239
 
240 240
 		$listItems = $category->getListItems();
241 241
 
242
-		$this->assertEquals( 1, count( $listItems ) );
242
+		$this->assertEquals(1, count($listItems));
243 243
 	}
244 244
 
245 245
 
@@ -259,60 +259,60 @@  discard block
 block discarded – undo
259 259
 			3 => 'job_csv_test',
260 260
 		);
261 261
 
262
-		$this->context->getConfig()->set( 'controller/common/product/import/csv/processor/catalog/listtypes', array( 'default' ) );
262
+		$this->context->getConfig()->set('controller/common/product/import/csv/processor/catalog/listtypes', array('default'));
263 263
 
264
-		$this->create( 'job_csv_test' );
264
+		$this->create('job_csv_test');
265 265
 
266
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint );
266
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint);
267 267
 
268
-		$this->setExpectedException( '\Aimeos\Controller\Common\Exception' );
269
-		$object->process( self::$product, $data );
268
+		$this->setExpectedException('\Aimeos\Controller\Common\Exception');
269
+		$object->process(self::$product, $data);
270 270
 	}
271 271
 
272 272
 
273 273
 	/**
274 274
 	 * @param string $code
275 275
 	 */
276
-	protected function create( $code )
276
+	protected function create($code)
277 277
 	{
278
-		$manager = \Aimeos\MShop\Catalog\Manager\Factory::create( $this->context );
278
+		$manager = \Aimeos\MShop\Catalog\Manager\Factory::create($this->context);
279 279
 
280 280
 		$item = $manager->createItem();
281
-		$item->setCode( $code );
281
+		$item->setCode($code);
282 282
 
283
-		$manager->insertItem( $item );
283
+		$manager->insertItem($item);
284 284
 
285 285
 		return $item;
286 286
 	}
287 287
 
288 288
 
289
-	protected function delete( \Aimeos\MShop\Catalog\Item\Iface $catItem )
289
+	protected function delete(\Aimeos\MShop\Catalog\Item\Iface $catItem)
290 290
 	{
291
-		$manager = \Aimeos\MShop\Catalog\Manager\Factory::create( $this->context );
292
-		$listManager = $manager->getSubManager( 'lists' );
291
+		$manager = \Aimeos\MShop\Catalog\Manager\Factory::create($this->context);
292
+		$listManager = $manager->getSubManager('lists');
293 293
 
294
-		foreach( $catItem->getListItems('product') as $listItem ) {
295
-			$listManager->deleteItem( $listItem->getId() );
294
+		foreach ($catItem->getListItems('product') as $listItem) {
295
+			$listManager->deleteItem($listItem->getId());
296 296
 		}
297 297
 
298
-		$manager->deleteItem( $catItem->getId() );
298
+		$manager->deleteItem($catItem->getId());
299 299
 	}
300 300
 
301 301
 
302 302
 	/**
303 303
 	 * @param string $code
304 304
 	 */
305
-	protected function get( $code )
305
+	protected function get($code)
306 306
 	{
307
-		$manager = \Aimeos\MShop\Catalog\Manager\Factory::create( $this->context );
307
+		$manager = \Aimeos\MShop\Catalog\Manager\Factory::create($this->context);
308 308
 
309 309
 		$search = $manager->createSearch();
310
-		$search->setConditions( $search->compare( '==', 'catalog.code', $code ) );
310
+		$search->setConditions($search->compare('==', 'catalog.code', $code));
311 311
 
312
-		$result = $manager->searchItems( $search, array('product') );
312
+		$result = $manager->searchItems($search, array('product'));
313 313
 
314
-		if( ( $item = reset( $result ) ) === false ) {
315
-			throw new \RuntimeException( sprintf( 'No catalog item for code "%1$s"', $code ) );
314
+		if (($item = reset($result)) === false) {
315
+			throw new \RuntimeException(sprintf('No catalog item for code "%1$s"', $code));
316 316
 		}
317 317
 
318 318
 		return $item;
Please login to merge, or discard this patch.