1 | <?php |
||
26 | final class Class_ 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 = null; |
||
38 | |||
39 | /** |
||
40 | * @var boolean Whether this is an abstract class. |
||
41 | */ |
||
42 | private $abstract = false; |
||
43 | |||
44 | /** |
||
45 | * @var boolean Whether this class is marked as final and can't be subclassed. |
||
46 | */ |
||
47 | private $final = false; |
||
48 | |||
49 | /** |
||
50 | * @var null|Fqsen The class this class is extending. |
||
51 | */ |
||
52 | private $parent = null; |
||
53 | |||
54 | /** |
||
55 | * @var Fqsen[] References to interfaces that are implemented by this class. |
||
56 | */ |
||
57 | private $implements = []; |
||
58 | |||
59 | /** |
||
60 | * @var Constant[] References to constants defined in this class. |
||
61 | */ |
||
62 | private $constants = []; |
||
63 | |||
64 | /** |
||
65 | * @var Property[] References to properties defined in this class. |
||
66 | */ |
||
67 | private $properties = []; |
||
68 | |||
69 | /** |
||
70 | * @var Method[] References to methods defined in this class. |
||
71 | */ |
||
72 | private $methods = []; |
||
73 | |||
74 | /** |
||
75 | * @var Fqsen[] References to traits consumed by this class |
||
76 | */ |
||
77 | private $usedTraits = []; |
||
78 | |||
79 | /** |
||
80 | * @var Location |
||
81 | */ |
||
82 | private $location; |
||
83 | |||
84 | /** |
||
85 | * Initializes a number of properties with the given values. Others are initialized by definition. |
||
86 | */ |
||
87 | 3 | public function __construct( |
|
106 | |||
107 | /** |
||
108 | * Returns true when this class is final. Otherwise returns false. |
||
109 | */ |
||
110 | 1 | public function isFinal(): bool |
|
114 | |||
115 | /** |
||
116 | * Returns true when this class is abstract. Otherwise returns false. |
||
117 | */ |
||
118 | 1 | public function isAbstract(): bool |
|
122 | |||
123 | /** |
||
124 | * Returns the superclass this class is extending if available. |
||
125 | */ |
||
126 | 1 | public function getParent(): ?Fqsen |
|
130 | |||
131 | /** |
||
132 | * Returns the interfaces this class is implementing. |
||
133 | * |
||
134 | * @return Fqsen[] |
||
135 | */ |
||
136 | 1 | public function getInterfaces(): array |
|
140 | |||
141 | /** |
||
142 | * Add a interface Fqsen this class is implementing. |
||
143 | */ |
||
144 | 1 | public function addInterface(Fqsen $interface): void |
|
148 | |||
149 | /** |
||
150 | * Returns the constants of this class. |
||
151 | * |
||
152 | * @return Constant[] |
||
153 | */ |
||
154 | 1 | public function getConstants(): array |
|
158 | |||
159 | /** |
||
160 | * Add Constant to this class. |
||
161 | */ |
||
162 | 1 | public function addConstant(Constant $constant): void |
|
166 | |||
167 | /** |
||
168 | * Returns the methods of this class. |
||
169 | * |
||
170 | * @return Method[] |
||
171 | */ |
||
172 | 1 | public function getMethods(): array |
|
176 | |||
177 | /** |
||
178 | * Add a method to this class. |
||
179 | */ |
||
180 | 1 | public function addMethod(Method $method): void |
|
184 | |||
185 | /** |
||
186 | * Returns the properties of this class. |
||
187 | * |
||
188 | * @return Property[] |
||
189 | */ |
||
190 | 1 | public function getProperties(): array |
|
194 | |||
195 | /** |
||
196 | * Add a property to this class. |
||
197 | */ |
||
198 | 1 | public function addProperty(Property $property): void |
|
202 | |||
203 | /** |
||
204 | * Returns the traits used by this class. |
||
205 | * |
||
206 | * @return Fqsen[] |
||
207 | */ |
||
208 | 1 | public function getUsedTraits(): array |
|
212 | |||
213 | /** |
||
214 | * Add trait fqsen used by this class. |
||
215 | */ |
||
216 | 1 | public function addUsedTrait(Fqsen $fqsen): void |
|
220 | |||
221 | /** |
||
222 | * Returns the Fqsen of the element. |
||
223 | */ |
||
224 | public function getFqsen(): Fqsen |
||
228 | |||
229 | /** |
||
230 | * Returns the name of the element. |
||
231 | */ |
||
232 | public function getName(): string |
||
236 | |||
237 | public function getDocBlock(): ?DocBlock |
||
241 | |||
242 | public function getLocation(): Location |
||
246 | } |
||
247 |