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

Multiline annotation for class constants fails to add subsequent lines #320

Closed
davidsneighbour opened this issue Dec 19, 2017 · 3 comments
Closed
Assignees
Labels

Comments

@davidsneighbour
Copy link

I have constants in classes documented as the following sample:

/**
 * @constant Invoice is solved - meaning invoice is paid and all related bookings are set to solved
 */
const STATUS_SOLVED = 900;

This parses correct. But when I cut the string in two lines (so it's below 80 characters per line) the second and subsequent lines are ignored in the resulting documentation file.

/**
 * @constant Invoice is solved - meaning invoice is paid and all related 
 *            bookings are set to solved
 */
const STATUS_SOLVED = 900;

Are there any rules that constants have to be documented in one single line?

@theseer
Copy link
Owner

theseer commented Dec 19, 2017

No, that seems to be a bug in the docblock parsing.

@theseer theseer self-assigned this Dec 19, 2017
@theseer theseer added the Bug label Dec 19, 2017
@davidsneighbour
Copy link
Author

Just to go sure: with subsequent lines I only mean the multi-line docs for this one constant, not the following constants or parameters documentation.

@theseer theseer closed this as completed in 467596f Jan 8, 2018
@theseer
Copy link
Owner

theseer commented Jan 8, 2018

Two side notes regarding the fix for future reference:

  • Officially, there is no @constant annotation in phpDoc as far as I could find
  • The actual parsing implementation wasn't that off - it took the first line as compact summary, the following lines as description body. I changed this to be merged together. All tests are still good but I'm not fully convinced yet that won't break anything...

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

No branches or pull requests

2 participants