Attributes not supported ? #8550
-
Hello ! I love your library !
Simply returning the node does not work, as the resolver expect specific types: https://github.com/rectorphp/rector/blob/main/src/Application/ChangedNodeScopeRefresher.php#L86-L96 I have version 1.0.3 Am I missing something ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You can use the |
Beta Was this translation helpful? Give feedback.
-
Since this does not work correctly as it is a more complex change:
I tried to parse the attributes over this change to make them work. I think I will try to directly make an 'annotationToAttributes' parser for ApiPlatform, and if done I can maybe make a PR here. Do you have any model of annotationToAttributes class that I could look at for it to fit your practices ? Or maybe it is already done somewhere ? |
Beta Was this translation helpful? Give feedback.
You can use the
Stmt
that contains the Attribute, egPhpParser\Node\Stmt\Class_
, then process its$node->attrGroups
to get thePhpParser\Node\Attribute
, then process it.