ClassLike   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
eloc 8
c 3
b 0
f 1
dl 0
loc 41
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getVertex() 0 3 1
A __construct() 0 3 1
A getInternalTag() 0 3 1
A getName() 0 3 1
A __toString() 0 3 1
A getDepsInternalTag() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace DependencyAnalyzer\DependencyGraph;
5
6
use DependencyAnalyzer\DependencyGraph\ExtraPhpDocTags\DepsInternal;
7
use DependencyAnalyzer\DependencyGraph\ExtraPhpDocTags\Internal;
8
use Fhaculty\Graph\Vertex;
9
10
class ClassLike
11
{
12
    /**
13
     * @var Vertex
14
     */
15
    private $vertex;
16
17
    public function __construct(Vertex $vertex)
18
    {
19
        $this->vertex = $vertex;
20
    }
21
22
    public function getVertex(): Vertex
23
    {
24
        return $this->vertex;
25
    }
26
27
    public function getName(): string
28
    {
29
        return $this->vertex->getId();
30
    }
31
32
    /**
33
     * @return DepsInternal[]
34
     */
35
    public function getDepsInternalTag(): array
36
    {
37
        return $this->vertex->getAttribute(DepsInternal::getTagName());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->vertex->ge...Internal::getTagName()) could return the type null which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
38
    }
39
40
    /**
41
     * @return Internal[]
42
     */
43
    public function getInternalTag(): array
44
    {
45
        return $this->vertex->getAttribute(Internal::getTagName());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->vertex->ge...Internal::getTagName()) could return the type null which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
46
    }
47
48
    public function __toString(): string
49
    {
50
        return $this->getName();
51
    }
52
}
53