Completed
Pull Request — master (#69)
by Jakub
21:27 queued 10:37
created

location_href::test()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
crap 2
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\analyser\test;
12
13
class location_href implements test_interface
14
{
15
	/**
16
	 * {@inheritDoc}
17
	 */
18 12
	public function test($ad_code)
19
	{
20 12
		if (preg_match('/location\.href(\s)*=/U', $ad_code))
21 12
		{
22
			return array(
23
				'warning'	=> array(
24 3
					'LOCATION_CHANGE',
25 3
				),
26 3
			);
27
		}
28
29 9
		return array();
30
	}
31
}
32