Passed
Push — master ( 44dd5c...d886ca )
by Aimeos
02:13
created

Standard::finish()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2019
6
 * @package Controller
7
 * @subpackage Common
8
 */
9
10
11
namespace Aimeos\Controller\Common\Common\Import\Xml\Processor\Lists;
12
13
14
/**
15
 * Lists processor for XML imports
16
 *
17
 * @package Controller
18
 * @subpackage Common
19
 */
20
class Standard
21
	extends \Aimeos\Controller\Common\Common\Import\Xml\Processor\Base
22
	implements \Aimeos\Controller\Common\Common\Import\Xml\Processor\Iface
23
{
24
	use \Aimeos\Controller\Common\Common\Import\Xml\Traits;
25
26
27
	/** controller/common/common/import/xml/processor/lists/name
28
	 * Name of the lists processor implementation
29
	 *
30
	 * Use "Myname" if your class is named "\Aimeos\Controller\Common\Common\Import\Xml\Processor\Lists\Myname".
31
	 * The name is case-sensitive and you should avoid camel case names like "MyName".
32
	 *
33
	 * @param string Last part of the processor class name
34
	 * @since 2019.04
35
	 * @category Developer
36
	 */
37
38
39
	/**
40
	 * Clean up and store data.
41
	 */
42
	public function finish()
43
	{
44
		foreach( $this->getProcessors() as $proc ) {
45
			$proc->finish();
0 ignored issues
show
Bug introduced by
The method finish() does not exist on Aimeos\Controller\Common...ort\Xml\Processor\Iface. Since it exists in all sub-types, consider adding an abstract or default implementation to Aimeos\Controller\Common...ort\Xml\Processor\Iface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
			$proc->/** @scrutinizer ignore-call */ 
46
          finish();
Loading history...
46
		}
47
	}
48
49
50
	/**
51
	 * Updates the given item using the data from the DOM node
52
	 *
53
	 * @param \Aimeos\MShop\Common\Item\Iface $item Item which should be updated
54
	 * @param \DOMNode $node XML document node containing a list of nodes to process
55
	 * @return \Aimeos\MShop\Common\Item\Iface Updated item
56
	 */
57
	public function process( \Aimeos\MShop\Common\Item\Iface $item, \DOMNode $node )
58
	{
59
		foreach( $node->childNodes as $listNode )
60
		{
61
			if( $listNode->nodeName[0] === '#' ) {
62
				continue;
63
			}
64
65
			$item = $this->getProcessor( 'lists/' . $listNode->nodeName )->process( $item, $listNode );
66
		}
67
68
		return $item;
69
	}
70
}
71