glayzzle / php-parser

:herb: NodeJS PHP Parser - extract AST or tokens
https://php-parser.glayzzle.com/
BSD 3-Clause "New" or "Revised" License
534 stars 71 forks source link

Don`t mark property as static #1134

Open Xsaven opened 4 months ago

Xsaven commented 4 months ago

This property is static in my code, but in the node there is not a single identifying sign that it is static, so I cannot assemble the code correctly.

image
czosel commented 4 months ago

Hi @Xsaven, can you share some example source code?

Xsaven commented 4 months ago

This is the class I'm trying to parse image Here is the code of the parser itself image

mreiden commented 3 months ago

I believe you are wanting the isStatic and visibility properties on the PropertyStatement object (the parent of the properties array containing the Property you highlighted in your class).

I found this counterintuitive, but the properties array is there to handle declaring multiple properties in one statement (though I never see anyone use this format): protected static ?string $test = null, $test2= 'str';

I do not think there is a bug here though.

Xsaven commented 1 month ago

@mreiden What do you mean you don't think there is a mistake there? The fact remains that there is no isStatic property!