stats   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 41
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A display() 0 13 1
A __construct() 0 5 1
1
<?php
2
3
/**
4
 *
5
 * @package sitemaker
6
 * @copyright (c) 2013 Daniel A. (blitze)
7
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
8
 *
9
 */
10
11
namespace blitze\sitemaker\blocks;
12
13
use blitze\sitemaker\services\blocks\driver\block;
14
15
/**
16
 * Stats Block
17
 */
18
class stats extends block
19
{
20
	/** @var \phpbb\config\config */
21
	protected $config;
22
23
	/** @var \phpbb\language\language */
24
	protected $translator;
25
26
	/** @var \phpbb\template\template */
27
	protected $template;
28
29
	/**
30
	 * Constructor
31
	 *
32
	 * @param \phpbb\config\config			$config			phpBB configuration
33
	 * @param \phpbb\language\language		$translator		Language object
34
	 * @param \phpbb\template\template		$template		Template object
35 2
	 */
36
	public function __construct(\phpbb\config\config $config, \phpbb\language\language $translator, \phpbb\template\template $template)
37 2
	{
38 2
		$this->config = $config;
39 2
		$this->translator = $translator;
40 2
		$this->template = $template;
41
	}
42
43
	/**
44
	 * {@inheritdoc}
45 1
	 */
46
	public function display(array $settings, $edit_mode = false)
47 1
	{
48 1
		$content = '';
49 1
		$content .= $this->translator->lang('TOTAL_POSTS_COUNT', (int) $this->config['num_posts']) . '<br />';
50 1
		$content .= $this->translator->lang('TOTAL_TOPICS', (int) $this->config['num_topics']) . '<br />';
51 1
		$content .= $this->translator->lang('TOTAL_USERS', (int) $this->config['num_users']) . '<br />';
52
		$content .= $this->translator->lang('NEWEST_USER', get_username_string('full', (int) $this->config['newest_user_id'], $this->config['newest_username'], $this->config['newest_user_colour']));
53 1
54
		$this->template->assign_var('NEWEST_USER', false);
55
56 1
		return array(
57 1
			'title'		=> 'STATISTICS',
58 1
			'content'	=> $content,
59
		);
60
	}
61
}
62