Passed
Push — develop ( 6b3bb3...b964e0 )
by Mikaël
01:53 queued 11s
created

PhpVariable::hasAccessibilityConstraint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WsdlToPhp\PhpGenerator\Element;
6
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
28
    {
29 132
        return '';
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
43
    {
44 82
        return true;
45
    }
46
}
47