2
0

TextNode.php 491 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Services\Template;
  3. class TextNode extends ContentNode
  4. {
  5. public string $content;
  6. public function __construct(string $content, array $position = [])
  7. {
  8. $this->type = 'text';
  9. $this->content = $content;
  10. $this->position = $position;
  11. }
  12. public function toArray(): array
  13. {
  14. return [
  15. 'type' => $this->type,
  16. 'content' => $this->content,
  17. 'position' => $this->position
  18. ];
  19. }
  20. }