| 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 | 156 | public function __construct(string $name, $value = null) |
|
| 12 | { |
||
| 13 | 156 | parent::__construct($name); |
|
| 14 | 156 | $this->setValue($value); |
|
| 15 | 156 | } |
|
| 16 | |||
| 17 | 132 | public function getAssignmentDeclarator(): string |
|
| 18 | { |
||
| 19 | 132 | return '$'; |
|
| 20 | } |
||
| 21 | |||
| 22 | 132 | public function getAssignmentSign(): string |
|
| 23 | { |
||
| 24 | 132 | return $this->hasValue() ? ' = ' : ''; |
|
| 25 | } |
||
| 26 | |||
| 27 | 132 | public function getAssignmentFinishing(): string |
|
| 30 | } |
||
| 31 | |||
| 32 | 156 | public function getAcceptNonScalarValue(): bool |
|
| 33 | { |
||
| 34 | 156 | return true; |
|
| 35 | } |
||
| 36 | |||
| 37 | 6 | public function getChildrenTypes(): array |
|
| 38 | { |
||
| 39 | 6 | return []; |
|
| 40 | } |
||
| 41 | |||
| 42 | 82 | public function endsWithSemicolon(): bool |
|
| 45 | } |
||
| 46 | } |
||
| 47 |