[TypeDeclaration] Do not remove multiple docblocks with comment on TypedPropertyFromAssignsRector#3263
Conversation
1876303 to
d42ce3c
Compare
|
Fixed 🎉 /cc @neveldo |
|
All checks have passed 🎉 @TomasVotruba it is ready for review. |
|
The safest way seems mark previous docs as comment. |
|
I updated to mark Doc as Comment when not in last, as the used one is last 06b3f6e |
e6d60c3 to
45ab2dc
Compare
|
Next todo: preserve spacing new line between docblocks/comments when calling |
|
I see. Is this ready for review? |
|
Yes, but not mergeable yet, as currently just calling: will remove the spacing, that will cause many unnecessary space removal for something like:. I can split into smaller PR for change this part only (comment + single docblock): // A comment
- /**
- * @var \DateTime
- */for non-multiple docblocks, wdyt? |
2413173 to
1585b8a
Compare
|
I added failing fixture to preserve multiple docs when docs never changed 04929fb , it currently still removing space new line even docs never changed, which invalid. final class PreserveMultipleDocsNoChange
{
// A comment
-
/**
* Another comment
*/
-
/**
* @var class-string
*/
- private $property;
+ private string $property; |
4955e14 to
e250ddd
Compare
…mAssignsRector more fixture rules-tests Fix Fixed 🎉 final touch: eol Final touch: return null on multiple docs updated to mark Doc as Comment when not in last, as the used one is last Final touch: clean up [ci-review] Rector Rectify apply setDocComment after set comments attribute failing fixture preserve multiple docs no change type create another attribute to save previous docs
171bc08 to
c6484ff
Compare
12ade3f to
548f144
Compare
|
@TomasVotruba it finally resolved now 🎉 🎉 🎉 , on after phpdocinfo changed, when no longer children, it needs to apply
|
|
All checks have passed 🎉 @TomasVotruba it is ready for review. |
Fixes rectorphp/rector#7693
Multiiple docblock should only remove last doc as detected one is the last:
// A comment /** * Another comment */ - /** - * @var \DateTime - */For only
comment + docblock, it remove the docblock part: