Completed
Push — master ( ce721c...ce62ef )
by Thomas
02:37
created

ValueTrait::isExpression()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace gossi\codegen\model\parts;
3
4
trait ValueTrait {
5
6
	private $value;
7
8
	private $hasValue = false;
9
10
	private $expression;
11
12
	private $hasExpression = false;
13
14
	/**
15
	 * @param string $value
16
	 * @deprecated use `setValue()` instead
17
	 * @return static
18
	 */
19 6
	public function setDefaultValue($value) {
20 6
		return $this->setValue($value);
21
	}
22
23
	/**
24
	 * @deprecated use `unsetValue()` instead
25
	 */
26
	public function unsetDefaultValue() {
27
		return $this->unsetValue();
28
	}
29
30
	/**
31
	 * @deprecated use `getValue()` instead
32
	 */
33 4
	public function getDefaultValue() {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
34 4
		return $this->getValue();
35
	}
36
37
	/**
38
	 * @deprecated use `hasValue()` instead
39
	 */
40 2
	public function hasDefaultValue() {
41 2
		return $this->hasValue();
42
	}
43
44 21
	public function setValue($value) {
45 21
		$this->value = $value;
46 21
		$this->hasValue = true;
47
48 21
		return $this;
49
	}
50
51 1
	public function unsetValue() {
52 1
		$this->value = null;
53 1
		$this->hasValue = false;
54
55 1
		return $this;
56
	}
57
58 12
	public function getValue() {
59 12
		return $this->value;
60
	}
61
62 20
	public function hasValue() {
63 20
		return $this->hasValue || $this->hasExpression;
64
	}
65
66 5
	public function isExpression() {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
67 5
		return $this->hasExpression;
68
	}
69
70 3
	public function setExpression($expr) {
71 3
		$this->expression = $expr;
72 3
		$this->hasExpression = true;
73
74 3
		return $this;
75
	}
76
77 2
	public function getExpression() {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
78 2
		return $this->expression;
79
	}
80
81 1
	public function unsetExpression() {
82 1
		$this->expression = null;
83 1
		$this->hasExpression = false;
84
85 1
		return $this;
86
	}
87
}
88