ckeditor_accordion-8.x-1.3/src/Plugin/CKEditor4To5Upgrade/Accordion.php
src/Plugin/CKEditor4To5Upgrade/Accordion.php
<?php
declare(strict_types=1);
namespace Drupal\ckeditor_accordion\Plugin\CKEditor4To5Upgrade;
use Drupal\ckeditor5\HTMLRestrictions;
use Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginInterface;
use Drupal\Core\Plugin\PluginBase;
use Drupal\filter\FilterFormatInterface;
/**
* A function to update CKEditor from 4 to 5.
*
* @CKEditor4To5Upgrade(
* id = "ckeditor_accordion",
* cke4_buttons = {
* "Accordion",
* },
* cke4_plugin_settings = {
* },
* cke5_plugin_elements_subset_configuration = {
* }
* )
*
* @internal
* Plugin classes are internal.
*/
class Accordion extends PluginBase implements CKEditor4To5UpgradePluginInterface {
/**
* {@inheritdoc}
*/
public function mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem(string $cke4_button, HTMLRestrictions $text_format_html_restrictions): ?array {
switch ($cke4_button) {
case 'Accordion':
return ['Accordion'];
default:
throw new \OutOfBoundsException();
}
}
/**
* {@inheritdoc}
*/
public function mapCKEditor4SettingsToCKEditor5Configuration(string $cke4_plugin_id, array $cke4_plugin_settings): ?array {
throw new \OutOfBoundsException();
}
/**
* {@inheritdoc}
*/
public function computeCKEditor5PluginSubsetConfiguration(string $cke5_plugin_id, FilterFormatInterface $text_format): ?array {
throw new \OutOfBoundsException();
}
}
