Skip to content

Append suffixes correctly for phpcpd#253

Merged
zdenekdrahos merged 4 commits into
EdgedesignCZ:masterfrom
Metadrop:fb-phpcpd-suffix
Feb 4, 2023
Merged

Append suffixes correctly for phpcpd#253
zdenekdrahos merged 4 commits into
EdgedesignCZ:masterfrom
Metadrop:fb-phpcpd-suffix

Conversation

@omarlopesino

Copy link
Copy Markdown
Contributor

Since phpcpd has released the 6.0 version the --names have been removed in favour of the new argument --suffix. This change has been adapted at PHPqa project but it needs a correction.

CUrrently, the --suffix arguments is added by joining all the suffixes by commas. Example:

--suffix="*.php,*.theme,*.module"

But that syntax is not correct. This is the documentation of the suffix command from PHPcpd:

  --suffix <suffix> Include files with names ending in <suffix> in the analysis
                    (default: .php; can be given multiple times)

The suffix parameter only accepts one suffix, and if it is needed to add more suffixes, the --suffix parameter must be repeated. So, the example I shown below should be corrected to this:

--suffix="*.php,*.theme,*.module" --suffix="*.module" --suffix="*.theme"

This pull request fixes the usage of suffix to be added by repeating suffix arguments and not joining the suffixes by commas. Please review, thanks!

Comment thread src/Tools/Analyzer/Phpcpd.php Outdated
@omarlopesino

Copy link
Copy Markdown
Contributor Author

The PHP 5.6 tests are failing but it does not look like a fail related to the changes done in the PR:

imagen

@omarlopesino

Copy link
Copy Markdown
Contributor Author

I've done the requested changes. Please review, thanks!

@zdenekdrahos zdenekdrahos self-requested a review February 4, 2023 15:16
@zdenekdrahos zdenekdrahos merged commit fbdfef4 into EdgedesignCZ:master Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants