Skip to content

Commit eb8b380

Browse files
authored
AtlassianDocumentFormat allow string into constructor (#95)
* feat: AtlassianDocumentFormat allow string into constructor * fix: Style code --------- Co-authored-by: Romain MILLAN <[email protected]>
1 parent ae1d7b3 commit eb8b380

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/ADF/AtlassianDocumentFormat.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@ class AtlassianDocumentFormat implements \JsonSerializable
1818

1919
private ?Document $document = null;
2020

21-
public function __construct(Document|Node $document)
21+
public function __construct(Document|Node|string $document)
2222
{
23+
if (is_string($document)) {
24+
$this->document = (new Document())
25+
->paragraph()
26+
->text($document)
27+
->end();
28+
29+
return;
30+
}
31+
2332
$this->document = $document;
2433
}
2534

0 commit comments

Comments
 (0)