Bug in reflector annotation?

majo
Member | 21
+
0
-

Annotation:

* @Column(type="int", length=(1,2,3))

return by $fooReflection->getAnnotation(‘Column’):

array(4) { 'type' => string(3) "int" 'length' => string(2) "(1" [0] => int(2) [1] => int(3) }

Nette 2.4

Last edited by majo (2017-02-17 16:07)

David Matějka
Moderator | 6231
+
0
-

it's not a bug, nette annotation parser from nette/reflection just does not support any complex structure.

btw, nette/reflection has been deprected. for advanced annotation parsing I would recommend you doctrine/annotations.

but it could be sufficient for you to parse the annotation using some simple regex like this (but do not use this function directly, it is internal so it may be changed/removed in the future) and then decode the content using NEON

majo
Member | 21
+
0
-

thanks