Completed
Pull Request — master (#69)
by Jakub
30:44 queued 28:04
created

manager::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
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;
12
13
class manager
14
{
15
	/** @var array Ad code analysis tests */
16
	protected $tests;
17
18
	/**
19
	 * Construct an ad code analysis manager object
20
	 *
21
	 * @param	array	$tests	Ad code analysis tests passed via the service container
22
	 */
23
	public function __construct($tests)
24
	{
25
		$this->tests = $tests;
26
	}
27
28
	public function test($ad_code)
29
	{
30
		$result = array(
31
			'notice'	=> array(),
32
			'warning'	=> array(),
33
			'error'		=> array(),
34
		);
35
		foreach ($this->tests as $test)
36
		{
37
			$result = array_merge_recursive($result, $test->test($ad_code));
38
		}
39
40
		// TODO: return in reasonable way
41
	}
42
}
43