Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Dec 20, 2022

Given the following code:

final class Fixture
{
    private $url;

    public function __construct()
    {
        $this->url = 'https://website.tld';
    }
}

The moved value from constructor assign should not be removed, ref https://getrector.org/demo/082ad859-87da-4222-bc3f-b50bc1b3c101

Current diff:

-    private $url;
+    private string $url;

Expected diff:

-    private $url;
+    private string $url = 'https://website.tld';

Applied rules:

- Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector
- Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector

…removed on InlineConstructorDefaultToPropertyRector+TypedPropertyFromStrictConstructorRector
@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @stefantalen

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba
Copy link
Member

Thank you 👏

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.

4 participants