// HTMLRestrictions does not accept a tag with an empty array, make sure
// to remove them here.
if (empty($b_without_class_wildcard[$allowedElement])) { unset($b_without_class_wildcard[$allowedElement]);
} } $intersection =
$a->
intersect(new HTMLRestrictions($b_without_class_wildcard));
// Leverage the "GHS configuration" representation to easily find whether
// there is an intersection for classes. Other implementations are possible.
$intersection_as_ghs_config =
$intersection->
toGeneralHtmlSupportConfig();
$ghs_config_classes =
array_column($intersection_as_ghs_config, 'classes'
);
return !
empty($ghs_config_classes);
} /**
* Finds the plugin with elements that conflict with the style element.
*
* @param \Drupal\ckeditor5\HTMLRestrictions $needle
* A style definition element: a single tag, plus the 'class' attribute,
* plus >=1 allowed 'class' attribute values.
*
* @return \Drupal\Core\StringTranslation\TranslatableMarkup
* The label of the plugin that is conflicting with this style.
*
* @throws \OutOfBoundsException
* When a $needle is provided which does not exist among the other plugins.
*/