http-message
http-message copied to clipboard
declare `__toString` as `@throws void`
with this change static analysis tools are able to detect implementations which throw.
see https://phpstan.org/r/90fcf22e-b99b-4455-bf32-a9a7078fbb39
technically throwing from __toString() is allowed since php 7.4+, but since the contract explicitly mentions this should not be done, I figured declaring the respective phpdoc would be a improvement.