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

Using PHP keywords as method name #2055

Closed
machitgarha opened this issue Jan 8, 2019 · 4 comments
Closed

Using PHP keywords as method name #2055

machitgarha opened this issue Jan 8, 2019 · 4 comments

Comments

@machitgarha
Copy link

machitgarha commented Jan 8, 2019

I want to document a class (the link to the project exists in the Environment section) that has a method named JSON::isSet(). When I want to document it using phpDocumentor, the following error will be shown and the documentation will not be created successfully:

Parse Error: Syntax error, unexpected T_ISSET, expecting T_STRING on line 307 No summary was found for this file

Since PHP methods are case-insensitive, maybe phpDocumentor think the method as JSON::isset(), a PHP keyword. It may think a PHP keyword as method name is an error; however, as of PHP7, it is possible to do that (see this RFC).

How to overcome the problem? Is there any quick fix for this?

Note: When I comment the JSON::isSet() definition or I change its name to something else (e.g. JSON::is_set()) and run the same command, the documentation will be created successfully.

Environment

@machitgarha machitgarha changed the title Using PHPpglorpgppw;,wrpgjwrggip Using PHP Jan 8, 2019
@machitgarha machitgarha changed the title Using PHP Using PHP keywords as method name Jan 8, 2019
@machitgarha machitgarha reopened this Jan 8, 2019
@jaapio
Copy link
Member

jaapio commented Jan 9, 2019

Hi,

Thanks for you report. I thing you have to switch to phpdoc v3. We had issues like this we could not fix in phpdoc v2. V3 is still in alpha phase but should be stable enough to handle a library like yours.

Please let me know if this solves your issue.

@machitgarha
Copy link
Author

Hi, @jaapio!
Thanks for the new version. The problem fixed. However, it doesn't import protected methods in the documentation.

@jaapio
Copy link
Member

jaapio commented Jan 18, 2019

This issue is fixed with #2056

@jaapio jaapio closed this as completed Jan 18, 2019
@nelson6e65
Copy link

Thanks! I'll check. 😃

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

No branches or pull requests

3 participants