Passed
Push — master ( bba07b...c2f305 )
by Aimeos
02:28
created

Base   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 36
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __destruct() 0 3 1
A __construct() 0 3 1
A getContext() 0 3 1
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;
12
13
14
/**
15
 * Abstract class with common methods for all XML import processors
16
 *
17
 * @package Controller
18
 * @subpackage Common
19
 */
20
abstract class Base
21
{
22
	use \Aimeos\Controller\Common\Common\Import\Traits;
23
24
25
	private $context;
26
27
28
	/**
29
	 * Initializes the object
30
	 *
31
	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
32
	 */
33
	public function __construct( \Aimeos\MShop\Context\Item\Iface $context )
34
	{
35
		$this->context = $context;
36
	}
37
38
39
	/**
40
	 * Cleanup before removing the object
41
	 */
42
	public function __destruct()
43
	{
44
		$this->saveTypes();
45
	}
46
47
48
	/**
49
	 * Returns the context item
50
	 *
51
	 * @return \Aimeos\MShop\Context\Item\Iface Context object
52
	 */
53
	protected function getContext()
54
	{
55
		return $this->context;
56
	}
57
}
58