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

Respect final as literals #5

Merged
merged 2 commits into from
Jul 20, 2018
Merged

Respect final as literals #5

merged 2 commits into from
Jul 20, 2018

Conversation

milo
Copy link
Contributor

@milo milo commented Jul 19, 2018

An idea is that only final followed by class or function is the keyword to remove. If followed by = (constant assigning value) or ( (method signature) it is a literal.

@Majkl578
Copy link

Also needs to consider formats like final static function or final public function. 👍
closes #4

@JanTvrdik
Copy link

Have you considered using TOKEN_PARSE flag of token_get_all (available in PHP 7+)? I've never used this, but it looks like it may help.

@Majkl578
Copy link

@JanTvrdik Neat, didn't know that one! 👌 That may work, if that also applies to Foo::FINAL.

@milo
Copy link
Contributor Author

milo commented Jul 19, 2018

@Majkl578 Actually final starts caching, no matter of other keywords order.
@JanTvrdik Good idea! I'll check it.

@milo
Copy link
Contributor Author

milo commented Jul 19, 2018

@JanTvrdik You are right 😄

@dg
Copy link
Owner

dg commented Jul 20, 2018

Great, thanks!

@dg dg merged commit 10658ae into dg:master Jul 20, 2018
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