@@ -32,7 +32,7 @@ public static function getContents(MessageInterface $message):string{
3232 $ content = StreamUtil::getContents ($ message ->getBody ());
3333
3434 if ($ content === null ){
35- throw new RuntimeException ('invalid message content ' );
35+ throw new RuntimeException ('invalid message content ' ); // @codeCoverageIgnore
3636 }
3737
3838 return $ content ;
@@ -104,7 +104,7 @@ public static function toString(MessageInterface $message, bool|null $appendBody
104104 * @see https://github.com/kjdev/php-ext-zstd
105105 * @see https://en.wikipedia.org/wiki/HTTP_compression#Content-Encoding_tokens
106106 *
107- * @throws \RuntimeException
107+ * @throws \Throwable|\ RuntimeException
108108 */
109109 public static function decompress (MessageInterface $ message ):string {
110110 $ data = self ::getContents ($ message );
@@ -122,7 +122,6 @@ public static function decompress(MessageInterface $message):string{
122122 }
123123 catch (Throwable $ e ){
124124 if (in_array ($ encoding , ['br ' , 'zstd ' ])){
125- /** @var \RuntimeException $e */
126125 throw $ e ;
127126 }
128127 }
@@ -131,7 +130,7 @@ public static function decompress(MessageInterface $message):string{
131130 }
132131
133132 /**
134- *
133+ * @codeCoverageIgnore
135134 */
136135 protected static function call_decompress_func (string $ func , string $ data ):string {
137136 $ fn = $ func .'_uncompress ' ;
@@ -140,7 +139,7 @@ protected static function call_decompress_func(string $func, string $data):strin
140139 throw new RuntimeException (sprintf ('cannot decompress %s compressed message body ' , $ func ));
141140 }
142141
143- return call_user_func ( $ fn, $ data );
142+ return $ fn( $ data );
144143 }
145144
146145 /**
@@ -176,7 +175,7 @@ public static function setContentTypeHeader(
176175 );
177176
178177 if ($ mime === null ){
179- throw new RuntimeException ('could not determine content type ' );
178+ throw new RuntimeException ('could not determine content type ' ); // @codeCoverageIgnore
180179 }
181180
182181 return $ message ->withHeader ('Content-Type ' , $ mime );
0 commit comments