PluginsTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 32
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPlugins() 0 4 1
A setPlugins() 0 7 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