1 | <?php |
||
2 | declare(strict_types=1); |
||
3 | |||
4 | namespace DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName; |
||
5 | |||
6 | use DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName; |
||
7 | |||
8 | class Constant extends Base |
||
9 | { |
||
10 | function getType(): string |
||
0 ignored issues
–
show
|
|||
11 | { |
||
12 | return FullyQualifiedStructuralElementName::TYPE_CONSTANT; |
||
13 | } |
||
14 | |||
15 | public function include(Base $that): bool |
||
16 | { |
||
17 | return $this->isSame($that); |
||
18 | } |
||
19 | |||
20 | public function isConstant(): bool |
||
21 | { |
||
22 | return true; |
||
23 | } |
||
24 | |||
25 | public function getFullyQualifiedNamespaceNameAsArray(): array |
||
26 | { |
||
27 | $names = explode('\\', substr($this->toString(), 1)); |
||
28 | array_pop($names); |
||
29 | |||
30 | return $names; |
||
31 | } |
||
32 | |||
33 | public function getFullyQualifiedClassNameAsArray(): ?array |
||
34 | { |
||
35 | return null; |
||
36 | } |
||
37 | } |
||
38 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.