Passed
Push — master ( 1fb040...5fddea )
by Satoshi
02:25
created

Method::getFullyQualifiedNamespaceNameAsArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName;
5
6
use DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName;
7
8
class Method extends Base
9
{
10
    public function getType(): string
11
    {
12
        return FullyQualifiedStructuralElementName::TYPE_METHOD;
13
    }
14
15
    public function include(Base $that): bool
16
    {
17
        return $this->isSame($that);
18
    }
19
20
    public function isMethod(): bool
21
    {
22
        return true;
23
    }
24
25
    public function getFullyQualifiedNamespaceNameAsArray(): array
26
    {
27
        $names = $this->getFullyQualifiedClassNameAsArray();
28
        array_pop($names);
29
30
        return $names;
31
    }
32
33
    public function getFullyQualifiedClassNameAsArray(): ?array
34
    {
35
        list($fqcn, $method) = explode('::', $this->toString(), 2);
36
        return explode('\\', substr($fqcn, 1));
37
    }
38
}
39