We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello
The DowngradeTypedPropertyRector rule doesn't preserve the default value if the property is nullable.
I didn't find the right way to fix this code to PR but i believe that maybe the default value should not be overridden here https://github.com/rectorphp/rector-src/blob/main/rules/DowngradePhp74/Rector/Property/DowngradeTypedPropertyRector.php#L70 if there is a default value defined on the original property
Best
See https://getrector.org/demo/1ec72395-f107-68ec-9441-876a705acf57
<?php declare(strict_types=1); class DemoFile { protected ?string $test = "test"; }
DowngradeTypedPropertyRector
DowngradeAttributeToAnnotationRector
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Hello
The DowngradeTypedPropertyRector rule doesn't preserve the default value if the property is nullable.
I didn't find the right way to fix this code to PR but i believe that maybe the default value should not be overridden here
https://github.com/rectorphp/rector-src/blob/main/rules/DowngradePhp74/Rector/Property/DowngradeTypedPropertyRector.php#L70
if there is a default value defined on the original property
Best
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.org/demo/1ec72395-f107-68ec-9441-876a705acf57
Responsible rules
DowngradeTypedPropertyRector
DowngradeAttributeToAnnotationRector
Expected Behavior
The text was updated successfully, but these errors were encountered: