Make handle @param duplicates and word boundaries correct - #21
Conversation
|
|
||
| $typoName = $paramNames[$key]; | ||
| $replacePattern = '#@param(.*?)' . preg_quote($typoName, '#') . '#'; | ||
| $replacePattern = '#@param(.*?)(' . preg_quote($typoName, '#') . '\b)#'; |
There was a problem hiding this comment.
Add \b to make the pattern for $foo not match $fooo.
https://www.php.net/manual/en/regexp.reference.escape.php#:~:text=%5Cb-,word%20boundary,-%5CB
| unset($paramNames[$paramPosition]); | ||
| unset($argumentNames[$key]); | ||
| } else { | ||
| $missArgumentNames[$key] = $argumentName; |
There was a problem hiding this comment.
Make $argumentNames a list to hold all arguments and add the wrong argument to another argument instead of unset.
|
This comment is a note of a problem I noticed when working on this PR. The README says that One of the complications in developing Since the composer installed version of ECS bundles dependencies, the bundled ones will be preferentially loaded in PHPUnit executed from this project. It confused me that I changed the code and it was not reflected in PHPUnit. Luckily the problem was easily solved by creating a symlink like this: rm -rf vendor/symplify/easy-coding-standard/vendor/symplify/coding-standard
ln -s $PWD vendor/symplify/easy-coding-standard/vendor/symplify/coding-standard |
|
Hi, thanks for the fix. |
|
@TomasVotruba |
|
Thank you 👏 |
resolve #20