Completed
Push — master ( ec5717...657e76 )
by Matt
07:27
created

topic_preview_module::get_styles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 12
ccs 7
cts 7
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
crap 1
1
<?php
2
/**
3
*
4
* Topic Preview
5
*
6
* @copyright (c) 2013 Matt Friedman
7
* @license GNU General Public License, version 2 (GPL-2.0)
8
*
9
*/
10
11
namespace vse\topicpreview\acp;
12
13
/**
14
* @package acp
15
*/
16
class topic_preview_module
17
{
18
	/** @var string */
19
	public $u_action;
20
21
	/**
22
	 * Main ACP module
23
	 *
24
	 * @param int    $id
25
	 * @param string $mode
26
	 * @return null
27
	 */
28 1
	public function main($id, $mode)
29
	{
30 1
		global $phpbb_container;
1 ignored issue
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
31
32 1
		$user = $phpbb_container->get('user');
33 1
		$this->tpl_name   = 'acp_topic_preview';
34 1
		$this->page_title = $user->lang('TOPIC_PREVIEW');
35
36 1
		$phpbb_container->get('vse.topicpreview.acp.controller')
37 1
			->set_u_action($this->u_action)
38 1
			->handle();
39 1
	}
40
}
41