PluginsTrait::setPlugins()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
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 https://maslosoft.com/addendum/ - maslosoft addendum
12
 * @link https://code.google.com/p/addendum/ - original addendum project
13
 */
14
15
namespace Maslosoft\Addendum\Matcher\Traits;
16
17
use Maslosoft\Addendum\Collections\MatcherConfig;
18
use Maslosoft\Addendum\Interfaces\Matcher\MatcherInterface;
19
20
/**
21
 * PluginsTrait
22
 *
23
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
24
 */
25
trait PluginsTrait
26
{
27
28
	/**
29
	 * Matcher configuration
30
	 * @var MatcherConfig
31
	 */
32
	private $_plugins = [];
33
34
	/**
35
	 * Get matcher configuration
36
	 * @return MatcherConfig
37
	 */
38 61
	public function getPlugins()
39
	{
40 61
		return $this->_plugins;
41
	}
42
43
	/**
44
	 * Set matcher configuration
45
	 * @param MatcherConfig $plugins
46
	 * @return MatcherInterface|PluginsTrait
47
	 */
48 61
	public function setPlugins(MatcherConfig $plugins)
49
	{
50 61
		$this->_plugins = $plugins;
51 61
		$matcher = $this;
52 61
		assert($matcher instanceof MatcherInterface);
53 61
		return $matcher;
54
	}
55
56
}
57