You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found two issues when getting Psalter to add/fix parameters into doc blocks (either MissingParamType or MismatchingDocblockParamType, both with safe_types) where the existing param descriptions are either ignored or removed.
I made one issue as these seem related. Happy to split if you prefer.
Issue 1: Param is duplicated
If I have the following code and I run Psalter to add a type in then it duplicates the param in the doc block rather than merging it.
classC {
/** * @param $ab the string you pass in */publicfunctionfooFoo($ab): void {}
}
/** * @param string $ab */functioncallsWithString($ab): void {
(newC)->fooFoo($ab);
}
is turned into
classC {
/** * @param $ab the string you pass in * @param string $ab */publicfunctionfooFoo($ab): void {}
}
/** * @param string $ab */functioncallsWithString($ab): void {
(newC)->fooFoo($ab);
}
Where as I would hope would be that the docblock would become
I found two issues when getting Psalter to add/fix parameters into doc blocks (either
MissingParamType
orMismatchingDocblockParamType
, both withsafe_types
) where the existing param descriptions are either ignored or removed.I made one issue as these seem related. Happy to split if you prefer.
Issue 1: Param is duplicated
If I have the following code and I run Psalter to add a type in then it duplicates the param in the doc block rather than merging it.
is turned into
Where as I would hope would be that the docblock would become
Issue 2: Param description removed when fixing incorrect doc block types
Worse, and somewhat relatedly, if Psalter is fixing a return type, it drops the param description entirely.
becomes
The text was updated successfully, but these errors were encountered: