1<?php
2
3/*
4 * This file is part of the league/commonmark package.
5 *
6 * (c) Colin O'Dell <colinodell@gmail.com>
7 *
8 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
9 *  - (c) John MacFarlane
10 *
11 * For the full copyright and license information, please view the LICENSE
12 * file that was distributed with this source code.
13 */
14
15namespace League\CommonMark\Inline\Element;
16
17class AbstractStringContainer extends AbstractInline
18{
19    /**
20     * @var string
21     */
22    protected $content = '';
23
24    /**
25     * @param string               $contents
26     * @param array<string, mixed> $data
27     */
28    public function __construct(string $contents = '', array $data = [])
29    {
30        $this->content = $contents;
31        $this->data = $data;
32    }
33
34    /**
35     * @return string
36     */
37    public function getContent(): string
38    {
39        return $this->content;
40    }
41
42    /**
43     * @param string $contents
44     *
45     * @return $this
46     */
47    public function setContent(string $contents)
48    {
49        $this->content = $contents;
50
51        return $this;
52    }
53}
54