Commit 59b27cf
committed
fix: AttributeValueResolver should not drop values of annotations
If the file being parsed has already imported a class matching the name
of the annotation tag, then the annotation tag will have been parsed
as a DoctrineAnnotationTagValueNode.
For some tags - e.g. Behat steps - the `$phpDocTagNode->value` will
cast to an empty string (because the annotation text does not actually
contain valid Doctrine annotation values). In this case, the actual
annotation value needs to be retrieved from
`$phpDocTagNode->value->getOriginalContent()`.
This was causing AnnotationToAttributeRector to drop the attribute
values when converting from annotations to attributes in a file that
already contained some attributes.
This was previously implemented, but was reverted more recently as part
of dropping support for comments on these nodes.1 parent 7366fc5 commit 59b27cf
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
0 commit comments