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

Fix Parsing of Multiline Argument Descriptions #527

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/command.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ private static function parse_docblock( $docblock ) {
$key = key( $ret['parameters'][ $param_name ] );
reset( $ret['parameters'][ $param_name ] );
if ( ! empty( $ret['parameters'][ $param_name ][ $key ][2] )
&& '{' === substr( $ret['parameters'][ $param_name ][ $key ][2], -1 ) ) {
&&
in_array( substr( $ret['parameters'][ $param_name ][ $key ][2], -1 ), [ '{', ',' ], true )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if a multi-line comment doesn't end with a comma?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @wojtekn

Thank you for your feedback and suggestion, I’ve updated the logic and refined the code based on it. I've also created a brief video to explain the updates, the assumptions made, and the approach taken.

Here’s the link to the video: Link

) {
$in_param = [ $param_name, $key ];
}
}
Expand Down