1 | <?php |
||
26 | final class Trait_ 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 Property[] $properties */ |
||
40 | private $properties = []; |
||
41 | |||
42 | /** @var Method[] $methods */ |
||
43 | private $methods = []; |
||
44 | |||
45 | /** @var Fqsen[] $usedTraits References to traits consumed by this trait */ |
||
46 | private $usedTraits = []; |
||
47 | |||
48 | /** |
||
49 | * @var Location |
||
50 | */ |
||
51 | private $location; |
||
52 | |||
53 | /** |
||
54 | * Initializes the all properties |
||
55 | */ |
||
56 | 2 | public function __construct(Fqsen $fqsen, ?DocBlock $docBlock = null, ?Location $location = null) |
|
66 | |||
67 | /** |
||
68 | * Returns the methods of this Trait. |
||
69 | * |
||
70 | * @return Method[] |
||
71 | */ |
||
72 | 1 | public function getMethods(): array |
|
76 | |||
77 | /** |
||
78 | * Add a method to this Trait |
||
79 | */ |
||
80 | 1 | public function addMethod(Method $method): void |
|
84 | |||
85 | /** |
||
86 | * Returns the properties of this trait. |
||
87 | * |
||
88 | * @return Property[] |
||
89 | */ |
||
90 | 1 | public function getProperties(): array |
|
94 | |||
95 | /** |
||
96 | * Add a property to this Trait. |
||
97 | */ |
||
98 | 1 | public function addProperty(Property $property): void |
|
102 | |||
103 | /** |
||
104 | * Returns the Fqsen of the element. |
||
105 | */ |
||
106 | 1 | public function getFqsen(): Fqsen |
|
110 | |||
111 | /** |
||
112 | * Returns the name of the element. |
||
113 | */ |
||
114 | 1 | public function getName(): string |
|
118 | |||
119 | 1 | public function getDocBlock(): ?DocBlock |
|
123 | |||
124 | /** |
||
125 | * Returns fqsen of all traits used by this trait. |
||
126 | * |
||
127 | * @return Fqsen[] |
||
128 | */ |
||
129 | 1 | public function getUsedTraits(): array |
|
133 | |||
134 | /** |
||
135 | * Add reference to trait used by this trait. |
||
136 | */ |
||
137 | 1 | public function addUsedTrait(Fqsen $fqsen): void |
|
141 | |||
142 | public function getLocation(): Location |
||
146 | } |
||
147 |