base   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 48
rs 10
ccs 10
cts 10
cp 1
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A get_name() 0 3 1
A __construct() 0 4 1
A will_display() 0 3 1
A get_desc() 0 3 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 type_interface
17
{
18
	/**
19
	 * User object
20
	 * @var \phpbb\user
0 ignored issues
show
Bug introduced by
The type phpbb\user was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
	 */
22
	protected $user;
23
24
	/**
25
	 * Language object
26
	 * @var \phpbb\language\language
0 ignored issues
show
Bug introduced by
The type phpbb\language\language was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
	 */
28
	protected $language;
29
30
	/**
31
	 * Construct a template location object
32
	 *
33
	 * @param	\phpbb\user					$user		User object
34
	 * @param	\phpbb\language\language	$language	Language object
35
	 */
36 26
	public function __construct(\phpbb\user $user, \phpbb\language\language $language)
37
	{
38 26
		$this->user = $user;
39 26
		$this->language = $language;
40 26
	}
41
42
	/**
43
	 * {@inheritDoc}
44
	 */
45 2
	public function get_name()
46
	{
47 2
		return $this->language->lang('AD_' . strtoupper($this->get_id()));
48
	}
49
50
	/**
51
	 * {@inheritDoc}
52
	 */
53 2
	public function get_desc()
54
	{
55 2
		return $this->language->lang('AD_' . strtoupper($this->get_id()) . '_DESC');
56
	}
57
58
	/**
59
	 * {@inheritDoc}
60
	 */
61 8
	public function will_display()
62
	{
63 8
		return true;
64
	}
65
}
66