Panel::getPanel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
crap 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