Completed
Push — master ( 22b422...fbd4ac )
by Peter
05:54
created

MatcherConfig::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3.072

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
ccs 8
cts 10
cp 0.8
rs 9.4285
cc 3
eloc 7
nc 3
nop 1
crap 3.072
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL, Commercial license.
5
 *
6
 * @package maslosoft/addendum
7
 * @licence AGPL, Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]> (Meta container, further improvements, bugfixes)
9
 * @copyright Copyright (c) Maslosoft (Meta container, further improvements, bugfixes)
10
 * @copyright Copyright (c) Jan Suchal (Original version, builder, parser)
11
 * @link http://maslosoft.com/addendum/ - maslosoft addendum
12
 * @link https://code.google.com/p/addendum/ - original addendum project
13
 */
14
15
namespace Maslosoft\Addendum\Collections;
16
17
use Maslosoft\Addendum\Addendum;
18
use Maslosoft\Addendum\Exceptions\ConfigurationException;
19
use Maslosoft\Addendum\Reflection\ReflectionAnnotatedClass;
20
use Maslosoft\Addendum\Reflection\ReflectionAnnotatedMethod;
21
use Maslosoft\Addendum\Reflection\ReflectionAnnotatedProperty;
22
23
/**
24
 * MatcherConfig
25
 *
26
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
27
 */
28
class MatcherConfig
29
{
30
31 47
	public function __construct($config)
32
	{
33 47
		if(!isset($config['addendum']))
34 47
		{
35
			throw new ConfigurationException('Matcher plugins require `addendum`');
36
		}
37 47
		if(!isset($config['reflection']))
38 47
		{
39
			throw new ConfigurationException('Matcher plugins require `reflection`');
40
		}
41 47
		$this->addendum = $config['addendum'];
42 47
		$this->reflection = $config['reflection'];
43 47
	}
44
45
	/**
46
	 * Addendum instance
47
	 * @var Addendum
48
	 */
49
	public $addendum = null;
50
51
	/**
52
	 *
53
	 * @var ReflectionAnnotatedClass|ReflectionAnnotatedMethod|ReflectionAnnotatedProperty
54
	 */
55
	public $reflection = null;
56
57
}
58