Total Complexity | 8 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class PhpVariable extends AbstractElement implements AssignedValueElementInterface |
||
8 | { |
||
9 | use AssignedValueElementTrait; |
||
10 | |||
11 | 158 | public function __construct(string $name, $value = null) |
|
12 | { |
||
13 | 158 | parent::__construct($name); |
|
14 | 158 | $this->setValue($value); |
|
15 | 158 | } |
|
16 | |||
17 | 134 | public function getAssignmentDeclarator(): string |
|
18 | { |
||
19 | 134 | return '$'; |
|
20 | } |
||
21 | |||
22 | 134 | public function getAssignmentSign(): string |
|
23 | { |
||
24 | 134 | return $this->hasValue() ? ' = ' : ''; |
|
25 | } |
||
26 | |||
27 | 134 | public function getAssignmentFinishing(): string |
|
30 | } |
||
31 | |||
32 | 158 | public function getAcceptNonScalarValue(): bool |
|
33 | { |
||
34 | 158 | return true; |
|
35 | } |
||
36 | |||
37 | 6 | public function getChildrenTypes(): array |
|
38 | { |
||
39 | 6 | return []; |
|
40 | } |
||
41 | |||
42 | 84 | public function endsWithSemicolon(): bool |
|
45 | } |
||
46 | } |
||
47 |