PhpFile::toString()   A
last analyzed

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 1
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 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