Skip to content
Snippets Groups Projects

Issue #3100732: Allow specifying `meta` data on JSON:API objects

Closed Björn Brala requested to merge issue/drupal-3100732:3100732-allow-specifying-meta into 10.1.x
1 file
+ 10
5
Compare changes
  • Side-by-side
  • Inline
  • 24dc4ef8
    Issue #3283776 by Wim Leers, lauriii: Make... · 24dc4ef8
    catch authored
    Issue #3283776 by Wim Leers, lauriii: Make CKEditor5PluginDefinition::getElements() consistent with CKEditor5PluginDefinition::get*()
    
    (cherry picked from commit ee3835bc)
@@ -444,13 +444,18 @@ public function hasAdminLibrary(): bool {
/**
* Gets the list of elements and attributes this plugin allows to create/edit.
*
* @return string[]|false
* FALSE if this plugin does not create/edit any elements or attributes.
* Otherwise a list.
* @return string[]
* A list of elements and attributes.
*
* @see \Drupal\ckeditor5\Annotation\DrupalAspectsOfCKEditor5Plugin::$elements
*
* @throws \LogicException
* When called on a plugin definition that has no elements.
*/
public function getElements() {
public function getElements(): array {
if (!$this->hasElements()) {
throw new \LogicException('::getElements() should only be called if ::hasElements() returns TRUE.');
}
return $this->drupal['elements'];
}
@@ -498,7 +503,7 @@ public static function isCreatableElement(string $element): bool {
* @see \Drupal\ckeditor5\Annotation\DrupalAspectsOfCKEditor5Plugin::$elements
*/
public function hasElements(): bool {
return $this->getElements() !== FALSE;
return $this->drupal['elements'] !== FALSE;
}
/**
Loading