From 1b4a58b66aaca7b91ef27255ef76ed55f4d30814 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 26 Nov 2021 15:27:55 +0100 Subject: [PATCH] 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 --- src/StreamInterface.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/StreamInterface.php b/src/StreamInterface.php index f68f391..aac7124 100644 --- a/src/StreamInterface.php +++ b/src/StreamInterface.php @@ -21,6 +21,7 @@ interface StreamInterface * * This method MUST NOT raise an exception in order to conform with PHP's * string casting operations. + * @throws void * * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring * @return string