In addition to the abstract base class we should have an interface for getFormElement()

See #1952394-116: Add configuration translation user interface module in core

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Status: Active » Needs review
Issue tags: +D8MI, +sprint, +language-config
FileSize
5.18 KB

Here it goes. Named it ElementInterface since its the interface that the base class Element also implements :) Now comes with typehints and docs fixes naturally :)

Gábor Hojtsy’s picture

Status: Needs review » Fixed
Issue tags: -sprint

Aaaand, committed :) Feel free to reopen with better suggestions :)

tstoeckler’s picture

Issue tags: +sprint
+++ b/lib/Drupal/config_translation/FormElement/Element.php
@@ -51,6 +53,9 @@ abstract class Element {
-  abstract public function getFormElement($definition, $language, $value);
+  /**
+   * {@inheritdoc}
+   */
+  abstract public function getFormElement(array $definition, Language $language, $value);

Is there a point in keeping this? It seems like it could just be removed.

Gábor Hojtsy’s picture

Status: Fixed » Needs review
FileSize
1.38 KB

Absolutely right. Also the point of the interface is we can typehint that. So fixing the inline type hint as well :)

Gábor Hojtsy’s picture

Status: Needs review » Fixed

Committed / pushed that, thanks!

tstoeckler’s picture

Yay, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.