cranetm / yii2-json-rpc-2.0

Other
26 stars 18 forks source link

Docblock parser fixes #4

Closed tyler-ham closed 9 years ago

tyler-ham commented 9 years ago

See the commit messages for more details.

cranetm commented 9 years ago

Do @param https://github.com/param and @return https://github.com/return need many spaces between fields? Does phpDocumentor parse it normaly?

2015-09-25 6:16 GMT+03:00 Tyler Ham notifications@github.com:

See the commit messages for more details.

You can view, comment on, or merge this pull request online at:

https://github.com/cranetm/yii2-json-rpc-2.0/pull/4 Commit Summary

  • Fix the order of @param type and variable name in phpDoc parser and README.
  • Allow @param and @return docblock lines more flexibility with whitespace characters

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/cranetm/yii2-json-rpc-2.0/pull/4.

tyler-ham commented 9 years ago

Yes, phpDocumentor parses it normally.

While the additional spaces are not necessary, some authors (and IDE tools) prefer to align the fields of these parameters vertically by inserting additional spaces. For example (from https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/1.11/Symfony/CS/Fixer.php):

/**
 * Fixes all files for the given finder.
 *
 * @param ConfigInterface $config A ConfigInterface instance
 * @param bool            $dryRun Whether to simulate the changes or not
 * @param bool            $diff   Whether to provide diff
 *
 * @return array
 */
public function fix(ConfigInterface $config, $dryRun = false, $diff = false)
{
   ...
}

In this case, the additional spaces between bool and $dryRun (and $diff) must be accounted for when parsing these docblock tags.