1 | <?php |
||
11 | class Tag extends AbstractBaseHtmlTagObject implements TagInterface |
||
12 | { |
||
13 | /** |
||
14 | * The tag name. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | private $tag; |
||
19 | |||
20 | /** |
||
21 | * The tag attributes. |
||
22 | * |
||
23 | * @var \drupol\htmltag\Attributes\AttributesInterface |
||
24 | */ |
||
25 | private $attributes; |
||
26 | |||
27 | /** |
||
28 | * The tag content. |
||
29 | * |
||
30 | * @var mixed[]|null |
||
31 | */ |
||
32 | private $content; |
||
33 | |||
34 | /** |
||
35 | * Tag constructor. |
||
36 | * |
||
37 | * @param \drupol\htmltag\Attributes\AttributesInterface $attributes |
||
38 | * The attributes object. |
||
39 | * @param string $name |
||
40 | * The tag name. |
||
41 | * @param mixed $content |
||
42 | * The content. |
||
43 | */ |
||
44 | 10 | public function __construct(AttributesInterface $attributes, $name, $content = false) |
|
50 | |||
51 | /** |
||
52 | * @param string $name |
||
53 | * @param array $arguments |
||
54 | * |
||
55 | * @return \drupol\htmltag\Tag\TagInterface |
||
56 | */ |
||
57 | 1 | public static function __callStatic($name, array $arguments = []) |
|
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 1 | public function __toString() |
|
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 3 | public function attr($name = null, ...$value) |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 10 | public function content(...$content) |
|
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | 8 | public function render() |
|
111 | |||
112 | /** |
||
113 | * Render the tag content. |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | 10 | private function renderContent() |
|
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | 1 | public function serialize() |
|
152 | |||
153 | /** |
||
154 | * {@inheritdoc} |
||
155 | */ |
||
156 | 1 | public function unserialize($serialized) |
|
164 | |||
165 | /** |
||
166 | * Alter the values of an object. |
||
167 | * |
||
168 | * @param callable ...$closures |
||
169 | * A closure. |
||
170 | * |
||
171 | * @return object |
||
172 | * The object. |
||
173 | */ |
||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | */ |
||
177 | 1 | public function alter(callable ...$closures) |
|
187 | |||
188 | /** |
||
189 | * {@inheritdoc} |
||
190 | */ |
||
191 | 10 | protected function escape($string) |
|
199 | } |
||
200 |