| Total Complexity | 4 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class AbstractStringContainer extends Node implements \Stringable, StringContainerInterface |
||
| 20 | { |
||
| 21 | /** @var string */ |
||
| 22 | protected $literal = ''; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param array<string, mixed> $data |
||
| 26 | * @param array<string, mixed> $attributes |
||
| 27 | */ |
||
| 28 | public function __construct(string $contents = '', array $data = [], array $attributes = []) |
||
| 29 | { |
||
| 30 | parent::__construct(); |
||
| 31 | |||
| 32 | $this->literal = $contents; |
||
| 33 | $this->data->import($data); |
||
| 34 | $this->attributes->import($attributes); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function __toString(): string |
||
| 38 | { |
||
| 39 | return $this->getLiteral(); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function getLiteral(): string |
||
| 45 | } |
||
| 46 | |||
| 47 | public function setLiteral(string $contents): void |
||
| 50 | } |
||
| 51 | } |
||
| 52 |