Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Oct 22, 2025

@TomasVotruba per our discussion on 153fc78#r168615132

since the rule register back to php81 set, this safe belt keep nullable is needed.

this to avoid new issue opened again:

This needs to be nullable, or it will not safe, however, the drawback is property itself become nullable, while it originally not, as it always initialized inside constructor before.

This also ensure no bc break

@samsonasik
Copy link
Member Author

Ready to merge 👍

@TomasVotruba
Copy link
Member

Thank you. I'm wondering how this rule could be ever useful. I personally never saw it practice, except nested PHP attributes :)

Let's give this another round and collect feedback in real projects. The nullable property might be good enough to use the feature in codebase 👍

@TomasVotruba TomasVotruba merged commit b4e964f into main Oct 23, 2025
52 checks passed
@TomasVotruba TomasVotruba deleted the keep-nullable branch October 23, 2025 07:29
@samsonasik
Copy link
Member Author

samsonasik commented Oct 23, 2025

@TomasVotruba you can see example on spiral framework that it cause bc break

https://github.com/spiral/framework/blob/3d1055a956093bc7a72e531cf55fb5c3e410ab29/rector.php#L96

so skip there, make nullable is the way it has less bc break.

@TomasVotruba
Copy link
Member

We need exact code structure.

@samsonasik
Copy link
Member Author

samsonasik commented Oct 23, 2025

@TomasVotruba see exact example commit

spiral/framework@9cf5a48

that reverted previous apply and skip the new in initializers, because nullable removed

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.

3 participants