SentenceNode   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 36
c 0
b 0
f 0
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getValue() 0 3 1
A getType() 0 3 1
A equals() 0 4 2
1
<?php
2
3
namespace PPP\DataModel;
4
5
/**
6
 * A sentence node.
7
 *
8
 * @licence AGPLv3+
9
 * @author Thomas Pellissier Tanon
10
 */
11
class SentenceNode extends AbstractNode {
12
13
	/**
14
	 * @var string
15
	 */
16
	private $value;
17
18
	/**
19
	 * @param string $value
20
	 */
21 3
	public function __construct($value) {
22 3
		$this->value = $value;
23 3
	}
24
25
	/**
26
	 * @return string
27
	 */
28 1
	public function getValue() {
29 1
		return $this->value;
30
	}
31
32
	/**
33
	 * @see AbstractNode::getType
34
	 */
35 1
	public function getType() {
36 1
		return 'sentence';
37
	}
38
39
	/**
40
	 * @see AbstractNode::equals
41
	 */
42 3
	public function equals($target) {
43 3
		return $target instanceof self &&
44 3
			$this->value === $target->value;
45
	}
46
}
47