Skip to content

Conversation

@samsonasik
Copy link
Member

@Etienne-Schmitt this is to fix rectorphp/rector#7687

the dynamic property can be anything accessible from object creation, so better to remove the type, ref https://3v4l.org/tHRgE

@samsonasik samsonasik force-pushed the remove-type-complete-dynamic branch from d89ceb3 to cefe406 Compare December 24, 2022 06:31
@samsonasik
Copy link
Member Author

It is also what documentation code example show to only add property with docblock, not typed:

/**
* @var int
*/
public $value;
public function set()
{
$this->value = 5;

so it make consistent with the result 👍

@samsonasik samsonasik force-pushed the remove-type-complete-dynamic branch from 38d1006 to 2932977 Compare December 24, 2022 06:40
@samsonasik
Copy link
Member Author

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

@TomasVotruba
Copy link
Member

Thank you, this makes sense 👍

@TomasVotruba TomasVotruba merged commit f8814b1 into main Dec 24, 2022
@TomasVotruba TomasVotruba deleted the remove-type-complete-dynamic branch December 24, 2022 08:26
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.

CompleteDynamicPropertiesRector is adding type in parents but not in children (and in the reverse order too)

4 participants