Completed
Push — develop ( 273208...5b590b )
by Daniel
09:31
created

forum   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 3 Features 1
Metric Value
wmc 3
c 6
b 3
f 1
lcom 1
cbo 0
dl 0
loc 62
ccs 15
cts 15
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A handle() 0 18 2
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2013 Daniel A. (blitze)
6
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
 *
8
 */
9
10
namespace blitze\sitemaker\controller;
11
12
class forum
13
{
14
	/** @var \phpbb\config\config */
15
	protected $config;
16
17
	/** @var \phpbb\controller\helper */
18
	protected $helper;
19
20
	/** @var \phpbb\template\template */
21
	protected $template;
22
23
	/** @var \phpbb\language\language */
24
	protected $translator;
25
26
	/** @var string phpBB root path */
27
	protected $phpbb_root_path;
28
29
	/** @var string phpEx */
30
	protected $php_ext;
31
32
	/**
33
	 * Constructor
34
	 *
35
	 * @param \phpbb\config\config			$config			Config object
36
	 * @param \phpbb\controller\helper		$helper			Controller Helper object
37
	 * @param \phpbb\template\template		$template		Template object
38
	 * @param \phpbb\language\language		$translator		Language object
39
	 * @param string						$root_path		phpBB root path
40
	 * @param string						$php_ext		phpEx
41
	 */
42 1
	public function __construct(\phpbb\config\config $config, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\language\language $translator, $root_path, $php_ext)
43
	{
44 1
		$this->config = $config;
45 1
		$this->helper = $helper;
46 1
		$this->template = $template;
47 1
		$this->translator = $translator;
48 1
		$this->phpbb_root_path = $root_path;
49 1
		$this->php_ext = $php_ext;
50 1
	}
51
52
	/**
53
	 * @return \Symfony\Component\HttpFoundation\Response
54
	 */
55 1
	public function handle()
56
	{
57
		// @codeCoverageIgnoreStart
58
		if (!function_exists('display_forums'))
59
		{
60
			include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
61
		}
62
		// @codeCoverageIgnoreEnd
63
64 1
		display_forums('', $this->config['load_moderators']);
65
66 1
		$this->template->assign_block_vars('navlinks', array(
67 1
			'FORUM_NAME'	=> $this->translator->lang('FORUM'),
68 1
			'U_VIEW_FORUM'	=> $this->helper->route('blitze_sitemaker_forum')
69 1
		));
70
71 1
		return $this->helper->render('index_body.html', $this->translator->lang('FORUM_INDEX'));
72
	}
73
}
74