<?php
namespace nur\sery\php\content\impl;

use nur\sery\php\content\content;
use nur\sery\php\content\IStaticContent;

class ATag implements IStaticContent {
  function __construct(string $tag, $contents=null) {
    $this->tag = $tag;
    $this->contents = $contents;
  }

  protected $tag;
  protected $contents;

  function getContent(): iterable {
    return [
      "<$this->tag>",
      ...content::quote($this->contents),
      "</$this->tag>",
    ];
  }
}
