Distinguish between const keyword used inside class definition and not (#50)
PHP 5.3.0 introduced behavior of using const keyword in place of define() for global constants. token_get_all() still treats it as a class constant however.
Distinguish between const keyword used inside class definition and not (
PHP 5.3.0 introduced behavior of using const keyword in place of define() for
global constants. token_get_all() still treats it as a class constant however.
I think this introduced a regression: const defined in a class now shows up as a global.
I've duplicated this behavior. Trouble lies with the inherit limitations in using token_get_all(): it correctly identifies tokens but doesn't understand their parent/child relationships with other objects. For example, a class constant is identical to a global constant.
I'll try to either amend my previous commit or attempt at modifying PHPDoctor's parsing engine to add relationships -- the latter of which is probably needed in order to implement some of the other features requested in tickets.
This commit breaks parsing for class constants and does not properly parse the value for global constants declared using CONST. For a fix view pgraham/phpdoctor@1e22bb9
I would submit a pull request but this fix is on a branch that requires php5.3 and has diverged considerably from master.
Absolutely this commit should be fixed, either by merging the previous revision or continuing on with 1e22bb9 as you suggest. It seems that this project is suffering from a bit of neglect as of recently; there are a few forks that are way ahead.
Sorry for the lack of progress on this project, I have new dad syndrome and my coding has taken a backseat. It may be better for @pgraham's branch to be used for now, it's probably worth migrating to 5.3 anyway.
Hey Congrats, I will likely be in the same boat in about a month or so :)
It shouldn't be too hard to move my fix to the master branch in order to open a pull request.