Skip to content

Add RemoveParamDescriptionDuplicateNameFixer for PHP and blink - #99

Merged
TomasVotruba merged 2 commits into
mainfrom
remove-param-description-duplicate-name
Sep 29, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
remove-param-description-duplicate-name

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Adds a custom PHP-CS-Fixer rule that removes a @param description when it only duplicates the parameter name, ignoring case, whitespace and trailing punctuation.

-/**
- * @param int|string $leadId Lead ID
- */
+/**
+ * @param int|string $leadId
+ */

A genuine description (e.g. @param int $id Numeric identifier of the record) is left untouched.

What's included

  • RemoveParamDescriptionDuplicateNameFixer (extends AbstractDocBlockFixer) plus PHPUnit fixtures.
  • Registered in DocblockLevel::RULES, so it is part of the common prepared set (and the docblock level).
  • Ported to the blink Go engine: registered in All(), priority -37, added to the common set and ecsSrcOnlyFixers, with Go unit tests.
  • Refreshed rule-count snapshots (ecs-rules.txt, ecs-all-fixers.txt, blink README).

Checks

  • phpstan, rector, check-cs: green
  • PHPUnit: 312 tests green
  • go build / test / vet / gofmt -s: green
  • blink parity vs ECS on 1301 rector-src files: 0 diffs

Note: the fixer_sources job HEAD-checks each rule's source URL against ecs-src main. It stays red until this PR is merged, because the fixer file only lands on main on merge; it goes green afterwards.

Strip a @PARAM description that only repeats the parameter name,
ignoring case, whitespace and trailing punctuation. Ported to the blink
Go engine and added to the common set.
Add the fixer to DocblockLevel::RULES so ECS's common prepared set runs
it, matching blink's common set for 1:1 parity. Point the blink rule's
source at ecs-src, add it to ecsSrcOnlyFixers, set priority -37, and
refresh the rule-count snapshots.
@TomasVotruba
TomasVotruba merged commit ab33332 into main Sep 29, 2026
16 of 17 checks passed
@TomasVotruba
TomasVotruba deleted the remove-param-description-duplicate-name branch September 29, 2026 22:19
vitek-rostislav added a commit to shopsys/shopsys that referenced this pull request Oct 7, 2026
- coding standards now report such descriptions since ecsphp/ecs-src#99
ShopsysBot pushed a commit to shopsys/framework that referenced this pull request Oct 7, 2026
- coding standards now report such descriptions since ecsphp/ecs-src#99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant