Closed tyler-ham closed 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:
- Fix the order of @param https://github.com/param type and variable name in phpDoc parser and README
- Allow @param https://github.com/param and @return https://github.com/return docblock lines more flexibility with whitespace characters (the regular expresion previously required exactly 1 space character between fields, but now it allows any number of spaces)
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
- M JsonRpc2/Controller.php https://github.com/cranetm/yii2-json-rpc-2.0/pull/4/files#diff-0 (10)
- M README.md https://github.com/cranetm/yii2-json-rpc-2.0/pull/4/files#diff-1 (8)
Patch Links:
- https://github.com/cranetm/yii2-json-rpc-2.0/pull/4.patch
- https://github.com/cranetm/yii2-json-rpc-2.0/pull/4.diff
— Reply to this email directly or view it on GitHub https://github.com/cranetm/yii2-json-rpc-2.0/pull/4.
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.
See the commit messages for more details.