Skip to content

[CodeQuality] Mirror comment on InlineConstructorDefaultToPropertyRector #7074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 20, 2025

Conversation

samsonasik
Copy link
Member

Fixes rectorphp/rector#9273

Note:

On multiple props on single property definitions:

/**
 * some existing comment
 */
private $thing1, $thing2, $thing3;

public function __construct()
{
        // first
        $this->thing1 = 1;
        // second
        $this->thing2 = 2;
        // third
        $this->thing3 = 3;
}

The multiple comments will be merged as is:

    /**
     * some existing comment
     */
+    // first
+    // second
+    // third
private $thing1, $thing2, $thing3;

then, phpdoc info will require rebuild by set it to null.I add $mergeExistingComments flag that set to false on mirrorComments method on AbstractRector to avoid regression on other existing rules.

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @calebdw

@samsonasik samsonasik force-pushed the code-quality-inline branch from 07390d2 to bf9a79d Compare July 20, 2025 11:28
@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it to have faster feedback to test ;)

@samsonasik samsonasik merged commit baf984c into main Jul 20, 2025
47 checks passed
@samsonasik samsonasik deleted the code-quality-inline branch July 20, 2025 11:32
samsonasik added a commit that referenced this pull request Jul 21, 2025
…tor (#7074)

* [CodeQuality] Mirror comment on InlineConstructorDefaultToPropertyRector

* clean

* clean

* clean

* [ci-review] Rector Rectify

---------

Co-authored-by: GitHub Action <[email protected]>
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.

InlineConstructorDefaultToPropertyRector removing comments
2 participants