Skip to content

Commit

Permalink
Add docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 15, 2023
1 parent e5c1448 commit 8d64f16
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/BufferedContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down

0 comments on commit 8d64f16

Please sign in to comment.