Completed
Push — master ( f3c739...beecce )
by Matt
12s
created

before_posts::get_category()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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
class before_posts extends base
14
{
15
	/**
16
	 * {@inheritDoc}
17
	 */
18 30
	public function get_id()
19
	{
20 30
		return 'before_posts';
21
	}
22
23
	/**
24
	 * {@inheritDoc}
25
	 */
26 30
	public function get_category()
27
	{
28 30
		return self::CAT_IN_POSTS;
29
	}
30
31
	/**
32
	 * {@inheritDoc}
33
	 */
34 7
	public function will_display()
35
	{
36 7
		return strpos($this->user->page['page_name'], 'viewtopic') !== false;
37
	}
38
}
39