Split ParamReturnAndVarTagMalformsFixer into single-task doc block rules#86
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split
ParamReturnAndVarTagMalformsFixerinto single-task rulesThe all-in-one
ParamReturnAndVarTagMalformsFixermixed ~10 unrelated doc-block fixes behind one rule. This splits it into focused, single-task rules — each fixes one kind of@param/@return/@varmalform, so they can be enabled, skipped and reasoned about individually.AbstractDocBlockFixerbase; each rule only implements its ownprocessDocContent()MalformWorkerclasses +MalformWorkerInterfaceare removed (logic inlined into the rules)ParamReturnAndVarTagMalformsFixeris kept as a deprecated, empty rule implementingDeprecatedFixerInterface, pointing at its successorsconfig/sets/docblock.phpset, imported fromconfig/symplify.php@phpstan-and@psalm-prefixed tag variantsNew rules
AddMissingParamNameFixer— add a missing variable name to a@paramAddMissingVarNameFixer— add a missing variable name to an inline@varDoubleAsteriskInlineVarFixer— use a/**doc block for an inline@varcommentFixParamNameTypoFixer— fix a typo in the@paramname to match the real argumentRemoveDeadParamFixer— remove a dead@paramline that has only a name and no type/** * @param string $name - * @param $age */ function withDeadParam(string $name, $age) { }RemoveParamNameReferenceFixer— remove the reference&from a@paramnameRemoveSuperfluousReturnNameFixer— remove a superfluous variable name from@returnRemoveSuperfluousVarNameFixer— remove a superfluous variable name from a property@varSingleLineInlineVarDocBlockFixer— collapse a multi-line inline@vardoc block into one lineSwitchedTypeAndNameFixer— reorder switched type and variable nameTests
tests/Fixer/Commenting/<Fixer>/dir (test + isolated fixtures, moved viagit mv)tests/Set/DocblockSet/integration test that runs the wholedocblockset, so no coverage is lostVerification
ECS, Rector (dry-run), PHPStan and the full PHPUnit suite (160 tests) all pass.