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 | * @param DocBlock|null $docBlock |
||
57 | */ |
||
58 | 2 | public function __construct(Fqsen $fqsen, DocBlock $docBlock = null, Location $location = null) |
|
68 | |||
69 | /** |
||
70 | * Returns the methods of this Trait. |
||
71 | * |
||
72 | * @return Method[] |
||
73 | */ |
||
74 | 1 | public function getMethods(): array |
|
78 | |||
79 | /** |
||
80 | * Add a method to this Trait |
||
81 | */ |
||
82 | 1 | public function addMethod(Method $method): void |
|
86 | |||
87 | /** |
||
88 | * Returns the properties of this trait. |
||
89 | * |
||
90 | * @return Property[] |
||
91 | */ |
||
92 | 1 | public function getProperties(): array |
|
96 | |||
97 | /** |
||
98 | * Add a property to this Trait. |
||
99 | */ |
||
100 | 1 | public function addProperty(Property $property): void |
|
104 | |||
105 | /** |
||
106 | * Returns the Fqsen of the element. |
||
107 | */ |
||
108 | 1 | public function getFqsen(): Fqsen |
|
112 | |||
113 | /** |
||
114 | * Returns the name of the element. |
||
115 | */ |
||
116 | 1 | public function getName(): string |
|
120 | |||
121 | 1 | public function getDocBlock(): ?DocBlock |
|
125 | |||
126 | /** |
||
127 | * Returns fqsen of all traits used by this trait. |
||
128 | * |
||
129 | * @return Fqsen[] |
||
130 | */ |
||
131 | 1 | public function getUsedTraits(): array |
|
135 | |||
136 | /** |
||
137 | * Add reference to trait used by this trait. |
||
138 | */ |
||
139 | 1 | public function addUsedTrait(Fqsen $fqsen): void |
|
143 | |||
144 | public function getLocation(): Location |
||
148 | } |
||
149 |