镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[CodeQuality] Mirror comment on InlineConstructorDefaultToPropertyRector - #7074

Merged
samsonasik merged 5 commits into
mainfrom
code-quality-inline
Jul 20, 2025
Merged

samsonasik merged 5 commits into
mainfrom
code-quality-inline

Conversation

@samsonasik

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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 <actions@github.com>
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

InlineConstructorDefaultToPropertyRector removing comments

2 participants