1 | <?php |
||
24 | final class Trait_ implements Element |
||
25 | // @codingStandardsIgnoreEnd |
||
26 | { |
||
27 | /** |
||
28 | * @var Fqsen Full Qualified Structural Element Name |
||
29 | */ |
||
30 | private $fqsen; |
||
31 | |||
32 | /** |
||
33 | * @var DocBlock|null |
||
34 | */ |
||
35 | private $docBlock; |
||
36 | |||
37 | /** @var Property[] $properties */ |
||
38 | private $properties = array(); |
||
39 | |||
40 | /** @var Method[] $methods */ |
||
41 | private $methods = array(); |
||
42 | |||
43 | /** @var Fqsen[] $usedTraits References to traits consumed by this trait */ |
||
44 | private $usedTraits = array(); |
||
45 | |||
46 | /** |
||
47 | * @var Location |
||
48 | */ |
||
49 | private $location; |
||
50 | |||
51 | 2 | /** |
|
52 | * Initializes the all properties |
||
53 | 2 | * |
|
54 | 2 | * @param Fqsen $fqsen |
|
55 | 2 | * @param DocBlock|null $docBlock |
|
56 | */ |
||
57 | public function __construct(Fqsen $fqsen, DocBlock $docBlock = null, Location $location = null) |
||
67 | |||
68 | /** |
||
69 | * Returns the methods of this Trait. |
||
70 | * |
||
71 | * @return Method[] |
||
72 | */ |
||
73 | 1 | public function getMethods() |
|
77 | |||
78 | /** |
||
79 | * Add a method to this Trait |
||
80 | * |
||
81 | * @param Method $method |
||
82 | * @return void |
||
83 | 1 | */ |
|
84 | public function addMethod(Method $method) |
||
88 | |||
89 | /** |
||
90 | * Returns the properties of this trait. |
||
91 | * |
||
92 | * @return Property[] |
||
93 | */ |
||
94 | 1 | public function getProperties() |
|
98 | |||
99 | /** |
||
100 | * Add a property to this Trait. |
||
101 | * |
||
102 | * @param Property $property |
||
103 | * @return void |
||
104 | 1 | */ |
|
105 | public function addProperty(Property $property) |
||
109 | |||
110 | /** |
||
111 | * Returns the Fqsen of the element. |
||
112 | * |
||
113 | * @return Fqsen |
||
114 | 1 | */ |
|
115 | public function getFqsen() |
||
119 | |||
120 | /** |
||
121 | * Returns the name of the element. |
||
122 | 1 | * |
|
123 | * @return string |
||
124 | 1 | */ |
|
125 | public function getName() |
||
129 | |||
130 | /** |
||
131 | * @return null|DocBlock |
||
132 | 1 | */ |
|
133 | public function getDocBlock() |
||
137 | |||
138 | /** |
||
139 | * Returns fqsen of all traits used by this trait. |
||
140 | * |
||
141 | * @return Fqsen[] |
||
142 | 1 | */ |
|
143 | public function getUsedTraits() |
||
147 | |||
148 | /** |
||
149 | * Add reference to trait used by this trait. |
||
150 | * |
||
151 | * @param Fqsen $fqsen |
||
152 | */ |
||
153 | public function addUsedTrait(Fqsen $fqsen) |
||
157 | |||
158 | /** |
||
159 | * @return Location |
||
160 | */ |
||
161 | public function getLocation() |
||
165 | } |
||
166 |