public static function validatePair(EditorInterface
$text_editor, FilterFormatInterface
$text_format, bool
$all_compatibility_problems = TRUE
): ConstraintViolationListInterface
{ if ($text_editor->
getEditor() !== 'ckeditor5'
) { throw new \
InvalidArgumentException('This text editor is not configured to use CKEditor 5.'
);
} $typed_config_manager = \Drupal::
getContainer()->
get('config.typed'
);
$typed_config =
$typed_config_manager->
createFromNameAndData( 'ckeditor5_valid_pair__format_and_editor',
[ // A mix of:
// - editor.editor.*.settings — note that "settings" is top-level in
// editor.editor.*, and so it is here, so all validation constraints
// will continue to work fine.
'settings' =>
$text_editor->
toArray()['settings'
],
// - filter.format.*.filters — note that "filters" is top-level in
// filter.format.*, and so it is here, so all validation constraints
// will continue to work fine.
'filters' =>
$text_format->
toArray()['filters'
],