Passed
Pull Request — master (#1)
by Dark❶
03:30
created

main_module   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 34
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A main() 0 21 1
1
<?php
2
/**
3
 *
4
 * Reduce Search Index [RSI]. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2020, Dark❶, https://dark1.tech
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace dark1\reducesearchindex\acp;
12
13
/**
14
 * Reduce Search Index [RSI] ACP module.
15
 */
16
class main_module
17
{
18
	public $page_title;
19
	public $tpl_name;
20
	public $u_action;
21
22
	/**
23
	 * Main ACP module
24
	 *
25
	 * @param int    $id   The module ID
26
	 * @param string $mode The module mode
27
	 * @throws \Exception
28
	 */
29
	public function main($id, $mode)
30
	{
31
		global $phpbb_container;
32
33
		/** @var \dark1\reducesearchindex\controller\acp_controller $acp_controller */
34
		$acp_controller = $phpbb_container->get('dark1.reducesearchindex.controller.acp');
35
36
		// Load the display handle in our ACP controller
37
		$acp_controller->set_data($id, $mode, $this->u_action);
38
39
		// Get data from our ACP controller
40
		$acp_get_data = $acp_controller->get_data();
41
42
		// Load a template from adm/style for our ACP page
43
		$this->tpl_name = $acp_get_data['tpl_name'];
44
45
		// Set the page title for our ACP page
46
		$this->page_title = $acp_get_data['page_title'];
47
48
		// Load the display handle in our ACP controller
49
		$acp_controller->display();
50
	}
51
}
52