Passed
Push — master ( fedbc6...da3a15 )
by Satoshi
02:47
created

Class_   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getFullyQualifiedNamespaceName() 0 6 1
A getFullyQualifiedClassName() 0 3 1
A include() 0 3 1
A isClass() 0 3 1
A getType() 0 3 1
A createPropertyFQSEN() 0 3 1
A createClassConstantFQSEN() 0 3 1
A createMethodFQSEN() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName;
5
6
use DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName;
7
8
class Class_ extends Base
9
{
10
    function getType(): string
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
11
    {
12
        return FullyQualifiedStructuralElementName::TYPE_CLASS;
13
    }
14
15
    public function include(Base $that): bool
16
    {
17
        return $this->getFullyQualifiedClassName() === $that->getFullyQualifiedClassName();
18
    }
19
20
    public function isClass(): bool
21
    {
22
        return true;
23
    }
24
25
    public function getFullyQualifiedNamespaceName(): array
26
    {
27
        $names = $this->getFullyQualifiedClassName();
28
        array_pop($names);
29
30
        return $names;
31
    }
32
33
    public function getFullyQualifiedClassName(): ?array
34
    {
35
        return explode('\\', substr($this->toString(), 1));
36
    }
37
38
    public function createMethodFQSEN(string $methodName): Method
39
    {
40
        return FullyQualifiedStructuralElementName::createMethod($this->toString(), $methodName);
41
    }
42
43
    public function createPropertyFQSEN(string $propertyName): Property
44
    {
45
        return FullyQualifiedStructuralElementName::createProperty($this->toString(), $propertyName);
46
    }
47
48
    public function createClassConstantFQSEN(string $constantName): ClassConstant
49
    {
50
        return FullyQualifiedStructuralElementName::createClassConstant($this->toString(), $constantName);
51
    }
52
}
53