Completed
Push — master ( 3f1b14...d7a449 )
by Luis
14:49 queued 04:53
created

InterfaceDefinition   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hasParent() 0 3 1
A __construct() 0 5 1
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