Skip to content
This repository was archived by the owner on Jul 12, 2026. It is now read-only.

Make handle @param duplicates and word boundaries correct - #21

Merged
TomasVotruba merged 3 commits into
symplify:mainfrom
zonuexe:fix/issue-20
Jul 25, 2023
Merged

Make handle @param duplicates and word boundaries correct#21
TomasVotruba merged 3 commits into
symplify:mainfrom
zonuexe:fix/issue-20

Conversation

@zonuexe

@zonuexe zonuexe commented Apr 30, 2023

Copy link
Copy Markdown
Contributor

resolve #20


$typoName = $paramNames[$key];
$replacePattern = '#@param(.*?)' . preg_quote($typoName, '#') . '#';
$replacePattern = '#@param(.*?)(' . preg_quote($typoName, '#') . '\b)#';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

unset($paramNames[$paramPosition]);
unset($argumentNames[$key]);
} else {
$missArgumentNames[$key] = $argumentName;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Make $argumentNames a list to hold all arguments and add the wrong argument to another argument instead of unset.

@zonuexe

zonuexe commented Apr 30, 2023

Copy link
Copy Markdown
Contributor Author

This comment is a note of a problem I noticed when working on this PR.


The README says that symplify/coding-standard is part of the Symplify monorepo, but it looks like that is no longer the case.


One of the complications in developing symplify/coding-standard is that ECS and symplify/coding-standard are dependent on each other for development.

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

@TomasVotruba

TomasVotruba commented Apr 30, 2023

Copy link
Copy Markdown
Member

Hi, thanks for the fix.
I've just confirmed the CI. Could you look at it and fix it? Ideally re-run test and Rector locally, so we have it fixed for sure and can be merged on next check. Thank you 👍

Comment thread .github/workflows/code_analysis.yaml
@zonuexe

zonuexe commented May 2, 2023

Copy link
Copy Markdown
Contributor Author

@TomasVotruba
This PR is ready. It contains a weird hack to get the tests to run correctly, but CI seems to pass. #21 (comment)

@TomasVotruba

Copy link
Copy Markdown
Member

Thank you 👏

@TomasVotruba
TomasVotruba merged commit e000966 into symplify:main Jul 25, 2023
@zonuexe
zonuexe deleted the fix/issue-20 branch July 27, 2023 05:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParamReturnAndVarTagMalformsFixer incorrectly replaces both duplicated PHPDoc

2 participants