Completed
Push — master ( 60fc22...165a83 )
by Peter
04:31
created

MatcherConfig::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 1
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 55
	public function __construct($config)
32
	{
33 55
		assert(isset($config['addendum']), new ConfigurationException('Matcher plugins require `addendum`'));
34 55
		assert(isset($config['reflection']), new ConfigurationException('Matcher plugins require `reflection`'));
35 55
		$this->addendum = $config['addendum'];
36 55
		$this->reflection = $config['reflection'];
37 55
	}
38
39
	/**
40
	 * Addendum instance
41
	 * @var Addendum
42
	 */
43
	public $addendum = null;
44
45
	/**
46
	 *
47
	 * @var ReflectionAnnotatedClass|ReflectionAnnotatedMethod|ReflectionAnnotatedProperty
48
	 */
49
	public $reflection = null;
50
51
}
52