-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] clarify stringable type annotations #36057
New issue
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
Conversation
nicolas-grekas
commented
Mar 13, 2020
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | no |
New feature? | no |
Deprecations? | no |
Tickets | - |
License | MIT |
Doc PR | - |
In our projects psalm complains that the \Stringable class has not been seen. We fixed it by installing the PHP80 polyfill. Shouldn't you add it as a composer require when using it? |
I considered that but that's not a requirement of the code, so it's not needed. If it's a requirement for you because of the tooling you use, this is legit and then you should add the polyfill. |
Yes, I was also unsure, but you are right. The code doesn't need it. 👍 |
Having these methods return This seems to force all existing userland code that consumed any of these methods to remove The userland flow basically is
Is this the migration path for this? the polyfill while it fast-forwards the feature doesnt give the full benefit because we dont have union types :( |
further to my comments, I can see some of this discussion did happen on the RFC
I guess my userland code is living through this scenario right now as described by Patrick ALLAERT |
This has always been |
I'm not totally sure I follow? I don't see In regard to the userland problem steps 1-6, is that the expectation here? I can see some of this discussion bleeds into the RFC but from consumption of this interface, it seems that is the expected thing here. That is to bounce between typing string then no type then php8's union type? |