Test Failed
Push — psr4-packages ( 592372 )
by Luis
02:13
created

InterfaceDefinition::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
1
<?php
2
/**
3
 * PHP version 7.1
4
 *
5
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
6
 */
7
8
namespace PhUml\Code;
9
10
use PhUml\Graphviz\HasNodeIdentifier;
11
use PhUml\Graphviz\ObjectHashIdentifier;
12
13
class InterfaceDefinition implements HasNodeIdentifier
14
{
15
    use ObjectHashIdentifier;
16
17
    /** @var string */
18
    public $name;
19
20
    /** @var Method[] */
21
    public $functions;
22
23
    /** @var InterfaceDefinition */
24
    public $extends;
25
26
    public function __construct(string $name, array $functions = [], $extends = null)
27
    {
28
        $this->name = $name;
29
        $this->functions = $functions;
30
        $this->extends = $extends;
31
    }
32
33
    public function hasParent(): bool
34
    {
35
        return $this->extends !== null;
36
    }
37
}
38