From 8d64f164c0579a9645061d97dc185252950875d0 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Fri, 15 Dec 2023 17:12:26 -0600 Subject: [PATCH] Add docblock --- src/BufferedContent.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/BufferedContent.php b/src/BufferedContent.php index b7360328..af7dfff9 100644 --- a/src/BufferedContent.php +++ b/src/BufferedContent.php @@ -10,6 +10,16 @@ final class BufferedContent implements HttpContent { + public static function fromString(string $content, ?string $contentType = null): self + { + return new self($content, $contentType); + } + + /** + * Creates an instance using the given JSON serializable data with the content-type application/json. + * + * @param mixed $json Data which may be JSON serialized with {@see json_encode()}. + */ public static function fromJson(mixed $json): self { try { @@ -22,11 +32,6 @@ public static function fromJson(mixed $json): self } } - public static function fromString(string $content, ?string $contentType = null): self - { - return new self($content, $contentType); - } - public static function fromFile( string $path, ?string $contentType = null,