1 | <?php |
||
26 | final class Interface_ implements Element |
||
27 | // @codingStandardsIgnoreEnd |
||
28 | { |
||
29 | /** |
||
30 | * @var Fqsen Full Qualified Structural Element Name |
||
31 | */ |
||
32 | private $fqsen; |
||
33 | |||
34 | /** |
||
35 | * @var DocBlock|null |
||
36 | */ |
||
37 | private $docBlock; |
||
38 | |||
39 | /** @var Constant[] $constants */ |
||
40 | private $constants = []; |
||
41 | |||
42 | /** @var Method[] $methods */ |
||
43 | private $methods = []; |
||
44 | |||
45 | /** @var Fqsen[] $parents */ |
||
46 | private $parents = []; |
||
47 | |||
48 | /** |
||
49 | * @var Location |
||
50 | */ |
||
51 | private $location; |
||
52 | |||
53 | /** |
||
54 | * Initializes the object. |
||
55 | * |
||
56 | * @param Fqsen[] $parents |
||
57 | */ |
||
58 | 2 | public function __construct( |
|
73 | |||
74 | /** |
||
75 | * Returns the constants of this interface. |
||
76 | * |
||
77 | * @return Constant[] |
||
78 | */ |
||
79 | 1 | public function getConstants(): array |
|
83 | |||
84 | /** |
||
85 | * Add constant to this interface. |
||
86 | */ |
||
87 | 1 | public function addConstant(Constant $constant): void |
|
88 | { |
||
89 | 1 | $this->constants[(string) $constant->getFqsen()] = $constant; |
|
90 | 1 | } |
|
91 | |||
92 | /** |
||
93 | * Returns the methods in this interface. |
||
94 | * |
||
95 | * @return Method[] |
||
96 | */ |
||
97 | 1 | public function getMethods(): array |
|
98 | { |
||
99 | 1 | return $this->methods; |
|
100 | } |
||
101 | |||
102 | /** |
||
103 | * Add method to this interface. |
||
104 | */ |
||
105 | 1 | public function addMethod(Method $method): void |
|
106 | { |
||
107 | 1 | $this->methods[(string) $method->getFqsen()] = $method; |
|
108 | 1 | } |
|
109 | |||
110 | /** |
||
111 | * Returns the Fqsen of the element. |
||
112 | */ |
||
113 | 1 | public function getFqsen(): Fqsen |
|
117 | |||
118 | /** |
||
119 | * Returns the name of the element. |
||
120 | */ |
||
121 | public function getName(): string |
||
125 | |||
126 | /** |
||
127 | * Returns the DocBlock of this interface if available. |
||
128 | */ |
||
129 | 1 | public function getDocBlock(): ?DocBlock |
|
133 | |||
134 | /** |
||
135 | * Returns the Fqsen of the interfaces this interface is extending. |
||
136 | * |
||
137 | * @return Fqsen[] |
||
138 | */ |
||
139 | public function getParents(): array |
||
143 | |||
144 | public function getLocation(): Location |
||
148 | } |
||
149 |