You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
calling a __toString() getter, changes the Uri object state, which makes == comparison for Uri object unreliable. That is essentially a BC break in my opinion.
either do not store that value, somewhat on behalf of the client, and make the client store it if he needs to have it resolved
or resolve it in __constructor
Additional Context
I am in the middle of migration to newer php version, and I needed to update guzzlehttp/psr7 package and ended up fixing the codebase as we have == comparison used on Uri objects, thankfully there were tests that also broke so was not a surprise on production.
The text was updated successfully, but these errors were encountered:
Description
calling a
__toString()
getter, changes the Uri object state, which makes == comparison for Uri object unreliable. That is essentially a BC break in my opinion.How to reproduce
Possible Solution
it is caused by
composedComponents
that is used to store the value of resolved uri, and it is done lazy, on first call.I see two solutions:
__constructor
Additional Context
I am in the middle of migration to newer php version, and I needed to update guzzlehttp/psr7 package and ended up fixing the codebase as we have
==
comparison used on Uri objects, thankfully there were tests that also broke so was not a surprise on production.The text was updated successfully, but these errors were encountered: