Conversation
Those methods can return an empty string, but only if the instance is created with an empty string. I propose these changes in bleeding edge, as it would break the compatibility in the constructor.
Technically that doesn't forbid passing a empty string to the constructor no (?) |
Yeah, that's my dichotomy: if static analysis "forbids" or "prevents" you from calling the constructor with an empty string, we could consider "safe" to infer that the functions should return a That's how it works in userland anyway: if you ignore the SAT warning in the constructor, the getters will have an invalid value at runtime. |
Which warning ? I dont get one with |
|
I mean the error message that PHPStan would throw because of this line: https://github.com/phpstan/phpstan-src/pull/4794/changes#diff-cf5b76484540219ae620db261e215bda6b16a613fdb72eede0befb5c55fec466R6 |
Yes why would PHPStan introduce such error when it's permitted by PHP itself ? |
Those methods can return an empty string, but only if the instance is created with an empty string.
I propose these changes in bleeding edge, as it would break the compatibility in the constructor.