PhpInterface   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 33
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getExtends() 0 3 1
A getChildrenTypes() 0 7 1
A getAbstract() 0 3 1
A addChild() 0 7 2
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