PhpFile   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 30
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPhpDeclaration() 0 3 1
A getChildrenTypes() 0 11 1
A getLineBeforeChildren() 0 3 1
A toString() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WsdlToPhp\PhpGenerator\Element;
6
7
class PhpFile extends AbstractElement
8
{
9
    public const START_FILE = '<?php';
10
11 22
    public function getPhpDeclaration(): string
12
    {
13 22
        return self::START_FILE;
14
    }
15
16 22
    public function getLineBeforeChildren(?int $indentation = null): string
17
    {
18 22
        return '';
19
    }
20
21 22
    public function toString(?int $indentation = null): string
22
    {
23 22
        return sprintf('%s%s', parent::toString($indentation), self::BREAK_LINE_CHAR);
24
    }
25
26 24
    public function getChildrenTypes(): array
27
    {
28
        return [
29 24
            'string',
30
            PhpAnnotationBlock::class,
31
            PhpClass::class,
32
            PhpConstant::class,
33
            PhpDeclare::class,
34
            PhpFunction::class,
35
            PhpInterface::class,
36
            PhpVariable::class,
37
        ];
38
    }
39
}
40