src/Tokens/Elements/Time.php 1 location
|
@@ 32-50 (lines=19) @@
|
29 |
|
); |
30 |
|
} |
31 |
|
|
32 |
|
protected function removeInvalidChildren(LoggerInterface $logger) |
33 |
|
{ |
34 |
|
// If attribute "datetime" is not present, then only TEXT type |
35 |
|
// children allowed. |
36 |
|
if (!$this->hasAttribute('datetime')) { |
37 |
|
foreach ($this->children as $child) { |
38 |
|
if ($child instanceof NonParticipating) { |
39 |
|
continue; |
40 |
|
} |
41 |
|
|
42 |
|
if (!$child instanceof Text) { |
43 |
|
$logger->debug('Removing ' . $child . '. Element "time" without "datetime" attribute may only contain TEXT.'); |
44 |
|
$this->removeChild($child); |
45 |
|
|
46 |
|
continue; |
47 |
|
} |
48 |
|
} |
49 |
|
} |
50 |
|
} |
51 |
|
} |
52 |
|
|
src/Tokens/Elements/Title.php 1 location
|
@@ 16-29 (lines=14) @@
|
13 |
|
*/ |
14 |
|
class Title extends OpenElement implements MetadataContent |
15 |
|
{ |
16 |
|
protected function removeInvalidChildren(LoggerInterface $logger) |
17 |
|
{ |
18 |
|
// TITLE must contain only non-whitespace text or comments. |
19 |
|
foreach ($this->children as $child) { |
20 |
|
if ($child instanceof NonParticipating) { |
21 |
|
continue; |
22 |
|
} |
23 |
|
|
24 |
|
if (!$child instanceof Text) { |
25 |
|
$logger->debug('Removing ' . $child . '. Only text allowed inside TITLE.'); |
26 |
|
$this->removeChild($child); |
27 |
|
} |
28 |
|
} |
29 |
|
} |
30 |
|
} |
31 |
|
|
src/Tokens/Elements/Button.php 1 location
|
@@ 42-51 (lines=10) @@
|
39 |
|
); |
40 |
|
} |
41 |
|
|
42 |
|
protected function removeInvalidChildren(LoggerInterface $logger) |
43 |
|
{ |
44 |
|
foreach ($this->children as $child) { |
45 |
|
if ($child instanceof InteractiveContent && |
46 |
|
$child->isInteractiveContent()) { |
47 |
|
$logger->debug('Removing ' . $child . '. No interactive content inside a "button" element.'); |
48 |
|
$this->removeChild($child); |
49 |
|
} |
50 |
|
} |
51 |
|
} |
52 |
|
|
53 |
|
public function isInteractiveContent() : bool |
54 |
|
{ |
src/Tokens/Elements/Optgroup.php 1 location
|
@@ 31-43 (lines=13) @@
|
28 |
|
); |
29 |
|
} |
30 |
|
|
31 |
|
protected function removeInvalidChildren(LoggerInterface $logger) |
32 |
|
{ |
33 |
|
foreach ($this->children as $child) { |
34 |
|
if ($child instanceof NonParticipating || |
35 |
|
$child instanceof Option || |
36 |
|
$child instanceof ScriptSupporting) { |
37 |
|
continue; |
38 |
|
} |
39 |
|
|
40 |
|
$logger->debug('Removing ' . $child . '. Only "option" and script supporting elements allowed as children of a "optgroup" element.'); |
41 |
|
$this->removeChild($child); |
42 |
|
} |
43 |
|
} |
44 |
|
|
45 |
|
protected function removeInvalidSelf(LoggerInterface $logger) : bool |
46 |
|
{ |
src/Tokens/Elements/Textarea.php 1 location
|
@@ 47-58 (lines=12) @@
|
44 |
|
); |
45 |
|
} |
46 |
|
|
47 |
|
protected function removeInvalidChildren(LoggerInterface $logger) |
48 |
|
{ |
49 |
|
foreach ($this->children as $child) { |
50 |
|
if ($child instanceof NonParticipating || |
51 |
|
$child instanceof Text) { |
52 |
|
continue; |
53 |
|
} |
54 |
|
|
55 |
|
$logger->debug('Removing ' . $child . '. Only text is allowed as children of a "textarea" element.'); |
56 |
|
$this->removeChild($child); |
57 |
|
} |
58 |
|
} |
59 |
|
|
60 |
|
public function isInteractiveContent() : bool |
61 |
|
{ |