Completed
Pull Request — master (#4)
by Jakub
06:07
created

base   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 42
ccs 3
cts 9
cp 0.3333
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A will_display() 0 4 1
A get_name() 0 4 1
A get_desc() 0 4 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\admanagement\location\type;
12
13
/**
14
* Base class for template location types
15
*/
16
abstract class base implements \phpbb\admanagement\location\type\type_interface
17
{
18
	/**
19
	* User object
20
	* @var \phpbb\user
21
	*/
22
	protected $user;
23
24
	/**
25
	* Construct an after_profile template location object
26
	*
27
	* @param	\phpbb\user	$config	User object
0 ignored issues
show
Bug introduced by
There is no parameter named $config. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
28
	*/
29 19
	public function __construct(\phpbb\user $user)
30
	{
31 19
		$this->user = $user;
32 19
	}
33
34
	/**
35
	* {@inheritDoc}
36
	*/
37
	public function get_name()
38
	{
39
		return $this->user->lang('AD_' . strtoupper($this->get_id()));
40
	}
41
42
	/**
43
	* {@inheritDoc}
44
	*/
45
	public function get_desc()
46
	{
47
		return $this->user->lang('AD_' . strtoupper($this->get_id()) . '_DESC');
48
	}
49
50
	/**
51
	* {@inheritDoc}
52
	*/
53
	public function will_display()
54
	{
55
		return true;
56
	}
57
}
58