Closed mjauvin closed 3 years ago
@LukeTowers @bennothommo any objection to merge this?
@mjauvin Before merging, would you be able to do some unit tests? I'd be especially interested to see if it's parsing params that span multiple lines?
@bennothommo why would a tag span multiple lines? The @param, @since and @event definitely won't.
@mjauvin "event" and "since" likely won't, but it's fairly common for the param tag to span a couple of lines for more complex parameters, or for listing potential parameter values.
@bennothommo can you give an example of this? How would it be delimited, by an empty line?
@mjauvin This is one example: https://github.com/wintercms/winter/blob/develop/modules/system/classes/SourceManifest.php#L419-L420
It would either be delimited by another tag being defined (like say another @param
or @since
tag), or it would be delimited by the event doc block ending.
I would say, however, that I'm sure the ReflectionDocBlock library would have this covered if you were to use that instead.
Fair enough @bennothommo.
I am not using the ReflectionDocBlock library because the format for our Events doc blocks is not really compatible with the standard format.
@mjauvin Fair enough if that's the case, but if you get stuck, it might be worth having a browse through their code and see if they do things differently.
I'll modify the @param parser to handle multi-lines.
Extracts all the events doc blocks and returns the doc block comment and where it is triggered.
Example CMS page using this:
And the partial (events.htm):