Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat global constant declared using const keyword as global and not class constant #57

Merged
merged 1 commit into from
Nov 22, 2011
Merged

Conversation

tetsuo13
Copy link
Contributor

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.

#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.
peej added a commit that referenced this pull request Nov 22, 2011
Treat global constant declared using const keyword as global and not class constant
@peej peej merged commit 0e2a51e into peej:master Nov 22, 2011
@avit
Copy link

avit commented Dec 16, 2011

I think this introduced a regression: const defined in a class now shows up as a global.

@tetsuo13
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants