Completed
Branch master (4ffab1)
by Aimeos
02:31
created

Base   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 3
c 2
b 1
f 0
lcom 0
cbo 0
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __call() 0 4 1
A getContext() 0 4 1
1
<?php
2
3
/**
4
 * @copyright Metaways Infosystems GmbH, 2012
5
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
6
 * @copyright Aimeos (aimeos.org), 2015
7
 * @package Controller
8
 * @subpackage Frontend
9
 */
10
11
12
namespace Aimeos\Controller\Frontend;
13
14
15
/**
16
 * Common methods for frontend controller classes.
17
 *
18
 * @package Controller
19
 * @subpackage Frontend
20
 */
21
abstract class Base
22
{
23
	private $context = null;
24
25
26
	/**
27
	 * Common initialization for controller classes.
28
	 *
29
	 * @param \Aimeos\MShop\Context\Item\Iface $context Common MShop context object
30
	 */
31
	public function __construct( \Aimeos\MShop\Context\Item\Iface $context )
32
	{
33
		$this->context = $context;
34
	}
35
36
37
	/**
38
	 * Catches unknown methods
39
	 *
40
	 * @param string $name Name of the method
41
	 * @param array $param List of method parameter
42
	 * @return boolean Returns always false
43
	 */
44
	public function __call( $name, array $param )
45
	{
46
		return false;
47
	}
48
49
50
	/**
51
	 * Returns the context object.
52
	 *
53
	 * @return \Aimeos\MShop\Context\Item\Iface context object implementing \Aimeos\MShop\Context\Item\Iface
54
	 */
55
	protected function getContext()
56
	{
57
		return $this->context;
58
	}
59
}
60