PhpInterface::getAbstract()   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 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 PhpInterface extends PhpClass
8
{
9
    public const PHP_DECLARATION = 'interface';
10
11
    public const PHP_IMPLEMENTS_KEYWORD = 'extends';
12
13 16
    public function getAbstract(): bool
14
    {
15 16
        return false;
16
    }
17
18 16
    public function getExtends()
19
    {
20 16
        return null;
21
    }
22
23 18
    public function getChildrenTypes(): array
24
    {
25
        return [
26 18
            'string',
27
            PhpAnnotationBlock::class,
28
            PhpMethod::class,
29
            PhpConstant::class,
30
        ];
31
    }
32
33 18
    public function addChild($child): AbstractElement
34
    {
35 18
        if ($child instanceof PhpMethod) {
36 10
            $child->setHasBody(false);
37
        }
38
39 18
        return parent::addChild($child);
40
    }
41
}
42