main_module::main()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 17
rs 10
ccs 7
cts 7
cp 1
crap 1
1
<?php
2
/**
3
 *
4
 * Advertisement management. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ads\ucp;
12
13
/**
14
 * Advertisement management ACP module.
15
 */
16
class main_module
17
{
18
	public $page_title;
19
	public $tpl_name;
20
	public $u_action;
21
22
	/**
23
	 * Main UCP module
24
	 *
25
	 * @throws \Exception
26
	 */
27 1
	public function main()
28
	{
29 1
		global $phpbb_container;
30
31
		/** @var \phpbb\ads\controller\ucp_controller $ucp_controller */
32 1
		$ucp_controller = $phpbb_container->get('phpbb.ads.ucp.controller');
33
34
		// Make the $u_action url available in the UCP controller
35 1
		$ucp_controller->set_page_url($this->u_action);
36
37
		// Load a template
38 1
		$this->tpl_name = 'ucp_ads_stats';
39
40
		// Set the page title for our UCP page
41 1
		$this->page_title = 'UCP_PHPBB_ADS_STATS';
42
43 1
		$ucp_controller->main();
44 1
	}
45
}
46