Completed
Push — master ( 050438...0a0307 )
by Matt
19s
created

base   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get_name() 0 4 1
A get_desc() 0 4 1
A will_display() 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\ads\location\type;
12
13
/**
14
* Base class for template location types
15
*/
16
abstract class base implements \phpbb\ads\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	$user	User object
28
	*/
29 40
	public function __construct(\phpbb\user $user)
30
	{
31 40
		$this->user = $user;
32 40
	}
33
34
	/**
35
	* {@inheritDoc}
36
	*/
37 12
	public function get_name()
38
	{
39 12
		return $this->user->lang('AD_' . strtoupper($this->get_id()));
40
	}
41
42
	/**
43
	* {@inheritDoc}
44
	*/
45 12
	public function get_desc()
46
	{
47 12
		return $this->user->lang('AD_' . strtoupper($this->get_id()) . '_DESC');
48
	}
49
50
	/**
51
	* {@inheritDoc}
52
	*/
53 1
	public function will_display()
54
	{
55 1
		return true;
56
	}
57
}
58