Skip to content
Snippets Groups Projects

Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL

Open Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL
Open Andor requested to merge issue/drupal-3312049:3312049-return-null-vs-void into 10.1.x
2 files
+ 103
4
Compare changes
  • Side-by-side
  • Inline
Files
2
  • dd9c7183
    Issue #3356929 by Wim Leers, kevinquillen: Provide an upgrade path from... · dd9c7183
    Lauri Timmanee authored
    Issue #3356929 by Wim Leers, kevinquillen: Provide an upgrade path from "codesnippet" contrib CKEditor 4 plugin to "CodeBlock" core CKEditor 5 plugin
@@ -4,6 +4,8 @@
namespace Drupal\ckeditor5\Plugin\CKEditor4To5Upgrade;
// cspell:ignore codesnippet
use Drupal\ckeditor5\HTMLRestrictions;
use Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginInterface;
use Drupal\Core\Plugin\PluginBase;
@@ -15,9 +17,11 @@
* @CKEditor4To5Upgrade(
* id = "contrib",
* cke4_buttons = {
* "Code"
* "Code",
* "CodeSnippet",
* },
* cke4_plugin_settings = {
* "codesnippet",
* },
* cke5_plugin_elements_subset_configuration = {
* }
@@ -37,6 +41,10 @@ public function mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem(string $cke4_but
case 'Code':
return ['code'];
// @see https://www.drupal.org/project/codesnippet
case 'CodeSnippet':
return ['codeBlock'];
default:
throw new \OutOfBoundsException();
}
@@ -46,7 +54,25 @@ public function mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem(string $cke4_but
* {@inheritdoc}
*/
public function mapCKEditor4SettingsToCKEditor5Configuration(string $cke4_plugin_id, array $cke4_plugin_settings): ?array {
throw new \OutOfBoundsException();
switch ($cke4_plugin_id) {
case 'codesnippet':
$languages = [];
$enabled_cke4_languages = array_filter($cke4_plugin_settings['highlight_languages']);
foreach ($enabled_cke4_languages as $language) {
$languages[] = [
'language' => $language,
'label' => $language,
];
}
return [
'ckeditor5_codeBlock' => [
'languages' => $languages,
],
];
default:
throw new \OutOfBoundsException();
}
}
/**
Loading