DummyLang   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 61
ccs 0
cts 24
cp 0
rs 10
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 3 1
A getAll() 0 3 1
A get() 0 10 2
A loadLang() 0 3 1
A has() 0 3 1
1
<?php
2
/**
3
 * @name      OpenImporter
4
 * @copyright OpenImporter contributors
5
 * @license   BSD https://opensource.org/licenses/BSD-3-Clause
6
 *
7
 * @version 1.0
8
 */
9
10
namespace OpenImporter;
11
12
/**
13
 * Class DummyLang
14
 *
15
 * Replaces the Lang class if something bad happens, for example if the
16
 * XML file is not properly formatted or if the directory is wrong
17
 *
18
 * @package OpenImporter
19
 */
20
class DummyLang
21
{
22
	/**
23
	 * Intercepts loading of xml file.
24
	 *
25
	 * @return null
26
	 */
27
	public function loadLang()
28
	{
29
		return null;
30
	}
31
32
	/**
33
	 * Tests if given $key exists in lang, always return true
34
	 *
35
	 * @return bool
36
	 */
37
	public function has()
38
	{
39
		return true;
40
	}
41
42
	/**
43
	 * Returns the specified $key.
44
	 *
45
	 * @param string $key Name of the variable
46
	 *
47
	 * @return string|null Value of the specified $key
48
	 */
49
	public function __get($key)
50
	{
51
		return $key;
52
	}
53
54
	/**
55
	 * Returns the specified $key.
56
	 *
57
	 * @param string|array $key Name of the variable
58
	 *
59
	 * @return string|null Value of the specified $key
60
	 */
61
	public function get($key)
62
	{
63
		if (is_array($key))
64
		{
65
			$l_key = array_shift($key);
66
67
			return $l_key . ' ' . implode(' ', $key);
68
		}
69
70
		return $key;
71
	}
72
73
	/**
74
	 * Returns the whole lang as an array.
75
	 *
76
	 * @return array Whole lang
77
	 */
78
	public function getAll()
79
	{
80
		return array();
81
	}
82
}
83