function Contrib::mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem

File

core/modules/ckeditor5/src/Plugin/CKEditor4To5Upgrade/Contrib.php, line 34

Class

Contrib
Provides the CKEditor 4 to 5 upgrade path for contrib plugins now in core.

Namespace

Drupal\ckeditor5\Plugin\CKEditor4To5Upgrade

Code

public function mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem(string $cke4_button, HTMLRestrictions $text_format_html_restrictions) : ?array {
  switch ($cke4_button) {
    // @see https://www.drupal.org/project/codetag
    case 'Code':
      return [
        'code',
      ];
    default:
      throw new \OutOfBoundsException();
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.