Passed
Branch refactor/kernels (b754ed)
by Atanas
01:59
created

HasConditionTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCondition() 0 2 1
A setCondition() 0 2 1
1
<?php
2
/**
3
 * @package   WPEmerge
4
 * @author    Atanas Angelov <[email protected]>
5
 * @copyright 2018 Atanas Angelov
6
 * @license   https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0
7
 * @link      https://wpemerge.com/
8
 */
9
10
namespace WPEmerge\Routing;
11
12
use WPEmerge\Routing\Conditions\ConditionInterface;
13
14
/**
15
 * Represent an object which has a route condition.
16
 */
17
trait HasConditionTrait {
18
	/**
19
	 * Route condition.
20
	 *
21
	 * @var ConditionInterface
22
	 */
23
	protected $condition = null;
24
25
	/**
26
	 * Get condition.
27
	 *
28
	 * @codeCoverageIgnore
29
	 * @return ConditionInterface
30
	 */
31
	public function getCondition() {
32
		return $this->condition;
33
	}
34
35
	/**
36
	 * Set condition.
37
	 *
38
	 * @codeCoverageIgnore
39
	 * @param  ConditionInterface $condition
40
	 * @return void
41
	 */
42
	public function setCondition( ConditionInterface $condition ) {
43
		$this->condition = $condition;
44
	}
45
}
46