public function validate($value, Constraint
$constraint) { if (!
$constraint instanceof SourceEditingRedundantTagsConstraint
) { throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\SourceEditingRedundantTagsConstraint'
);
} if (empty($value)) { return;
} $text_editor =
$this->
createTextEditorObjectFromContext();
$other_enabled_plugins =
$this->
getOtherEnabledPlugins($text_editor, 'ckeditor5_sourceEditing'
);
$enableable_disabled_plugins =
$this->
getEnableableDisabledPlugins($text_editor);
// An array of tags enabled by every plugin other than Source Editing.
$enabled_plugin_elements =
new HTMLRestrictions($this->pluginManager->
getProvidedElements(array_keys($other_enabled_plugins),
$text_editor, FALSE
));
$disabled_plugin_elements =
new HTMLRestrictions($this->pluginManager->
getProvidedElements(array_keys($enableable_disabled_plugins),
$text_editor, FALSE
));
$enabled_plugin_plain_tags =
new HTMLRestrictions($this->pluginManager->
getProvidedElements(array_keys($other_enabled_plugins),
$text_editor, FALSE, TRUE
));
$disabled_plugin_plain_tags =
new HTMLRestrictions($this->pluginManager->
getProvidedElements(array_keys($enableable_disabled_plugins),
$text_editor, FALSE, TRUE
));
// The single element for which source editing is enabled, which we are
// checking now.
$source_enabled_element = HTMLRestrictions::
fromString($value);