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
17use League\CommonMark\Node\Node;
18
19/**
20 * @method children() AbstractInline[]
21 */
22abstract class AbstractInline extends Node
23{
24    /**
25     * @var array<string, mixed>
26     *
27     * Used for storage of arbitrary data
28     */
29    public $data = [];
30
31    public function isContainer(): bool
32    {
33        return false;
34    }
35
36    /**
37     * @param string $key
38     * @param mixed  $default
39     *
40     * @return mixed
41     */
42    public function getData(string $key, $default = null)
43    {
44        return isset($this->data[$key]) ? $this->data[$key] : $default;
45    }
46}
47