ReducerNode::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
nc 1
cc 1
eloc 2
nop 1
crap 2
1
<?php
2
3
namespace PPP\DataModel;
4
5
6
/**
7
 * A reducer node e.g. an operator list -> resource
8
 *
9
 * @licence AGPLv3+
10
 * @author Thomas Pellissier Tanon
11
 */
12
abstract class ReducerNode extends AbstractNode {
13
14
	/**
15
	 * @var AbstractNode
16
	 */
17
	private $operand;
18
19
	/**
20
	 * @param AbstractNode $operand
21
	 */
22
	public function __construct($operand) {
23
		$this->operand = $operand;
24
	}
25
26
	/**
27
	 * @return AbstractNode[]
28
	 */
29
	public function getOperand() {
30
		return $this->operand;
31
	}
32
33
	/**
34
	 * @see AbstractNode::equals
35
	 */
36
	public function equals($target) {
37
		return $target instanceof self && $this->operand->equals($target->operand);
38
	}
39
}
40