1 | <?php |
||
23 | class Tag extends ElementAbstract implements TagInterface |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * Tag Name. |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $name; |
||
31 | |||
32 | /** |
||
33 | * Tag Type. |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $type; |
||
37 | |||
38 | /** |
||
39 | * Define a parameter name. |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $variable; |
||
43 | |||
44 | /** |
||
45 | * Tag Description. |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $description; |
||
49 | |||
50 | /** |
||
51 | * Element Referenced. |
||
52 | * @var ElementInterface |
||
53 | */ |
||
54 | protected $referenced; |
||
55 | |||
56 | /** |
||
57 | * Tags containing type. |
||
58 | * @var ArrayCollection |
||
59 | */ |
||
60 | protected $tagNeedsType; |
||
61 | |||
62 | /** |
||
63 | * Inline documentation, that is to put {} around of the text. |
||
64 | * @var boolean |
||
65 | */ |
||
66 | protected $isInline = false; |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 47 | public function init() |
|
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | 28 | public function getName() |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 25 | public function setName($name) |
|
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | 15 | public function getType() |
|
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | 15 | public function setType($type) |
|
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | 14 | public function getVariable() |
|
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | 10 | public function setVariable($variable) |
|
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | 18 | public function getDescription() |
|
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | 20 | public function setDescription($description) |
|
153 | |||
154 | /** |
||
155 | * This tag, has type? |
||
156 | * @return bool |
||
157 | */ |
||
158 | 10 | protected function needsType() |
|
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | 3 | public function getReferenced() |
|
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | 12 | public function setReferenced(ElementInterface $referenced) |
|
180 | |||
181 | /** |
||
182 | * {@inheritdoc} |
||
183 | */ |
||
184 | 14 | public function isInline() |
|
188 | |||
189 | /** |
||
190 | * {@inheritdoc} |
||
191 | */ |
||
192 | 2 | public function setIsInline($isInline = true) |
|
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | 13 | public function toString() |
|
221 | |||
222 | /** |
||
223 | * Creating a Tag from an Argument Object. |
||
224 | * |
||
225 | * @param ArgumentInterface $argument |
||
226 | * |
||
227 | * @return TagInterface |
||
228 | */ |
||
229 | 8 | public static function createFromArgument(ArgumentInterface $argument) |
|
241 | |||
242 | /** |
||
243 | * Create var tag from property. |
||
244 | * |
||
245 | * @param PropertyInterface $property |
||
246 | * |
||
247 | * @return Tag |
||
248 | */ |
||
249 | 3 | public static function createFromProperty(PropertyInterface $property) |
|
257 | } |
||
258 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.