Skip to content

Commit 002a314

Browse files
authored
cleanup code with early return
1 parent f7159b6 commit 002a314

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Formatter/FullHttpMessageFormatter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ private function addBody(MessageInterface $request, $message)
8080
$stream = $request->getBody();
8181
if (!$stream->isSeekable() || 0 === $this->maxBodyLength) {
8282
// Do not read the stream
83-
$message .= "\n";
84-
} else {
85-
$message .= "\n".mb_substr($stream->__toString(), 0, $this->maxBodyLength);
86-
$stream->rewind();
83+
return $message."\n";
8784
}
85+
86+
$message .= "\n".mb_substr($stream->__toString(), 0, $this->maxBodyLength);
87+
$stream->rewind();
8888

8989
return $message;
9090
}

0 commit comments

Comments
 (0)