Panel   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 1
cbo 4
dl 0
loc 43
ccs 14
cts 14
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getId() 0 3 1
A getTab() 0 6 1
A getPanel() 0 8 1
1
<?php
2
3
namespace l10nNetteTranslator;
4
5
use Nette\Object;
6
use Tracy\IBarPanel;
7
8
class Panel extends Object implements IBarPanel {
9
	/** @var \l10nNetteTranslator\Translator */
10
	protected $translator;
11
12 1
	public function __construct(\l10nNetteTranslator\Translator $translator) {
13 1
		$this->translator = $translator;
14 1
	}
15
16
	/**
17
	 * Return's panel ID
18
	 *
19
	 * @return string
20
	 */
21 1
	public function getId() {
22 1
		return __CLASS__;
23
	}
24
25
	/**
26
	 * Returns the code for the panel tab
27
	 *
28
	 * @return string
29
	 */
30 1
	public function getTab() {
31 1
		ob_start();
32 1
		require __DIR__ . '/Templates/tab.phtml';
33
34 1
		return ob_get_clean();
35
	}
36
37
	/**
38
	 * Returns the code for the panel itself
39
	 *
40
	 * @return string
41
	 */
42 1
	public function getPanel() {
43 1
		$lang_code = $this->translator->getActiveLanguageAndPlural()->getLanguage()->getIso639_1();
44
45 1
		ob_start();
46 1
		require __DIR__ . '/Templates/panel.phtml';
47
48 1
		return ob_get_clean();
49
	}
50
}
51