diff --git a/core/lib/Drupal/Core/Render/Annotation/FormElement.php b/core/lib/Drupal/Core/Render/Annotation/FormElement.php index 8da7f53..b7288a0 100644 --- a/core/lib/Drupal/Core/Render/Annotation/FormElement.php +++ b/core/lib/Drupal/Core/Render/Annotation/FormElement.php @@ -8,7 +8,21 @@ namespace Drupal\Core\Render\Annotation; /** - * @todo. + * Defines a form element plugin annotation object. + * + * Form elements are also valid render elements, but they specifically represent + * an HTML element that takes input as part of a form. It will be discovered via + * the same mechanism as regular render element plugins. + * + * Plugin Namespace: Element + * + * For a working example, see \Drupal\Core\Render\Element\Textfield. + * + * @see \Drupal\Core\Render\ElementInfoManager + * @see \Drupal\Core\Render\ElementInterface + * @see \Drupal\Core\Render\FormElement + * + * @ingroup plugin_api * * @Annotation */ diff --git a/core/lib/Drupal/Core/Render/Annotation/RenderElement.php b/core/lib/Drupal/Core/Render/Annotation/RenderElement.php index f7b5b03..cb03875 100644 --- a/core/lib/Drupal/Core/Render/Annotation/RenderElement.php +++ b/core/lib/Drupal/Core/Render/Annotation/RenderElement.php @@ -15,19 +15,19 @@ * Render element plugins allow modules to declare their own Render API element * types and specify their default values. * - * This hook allows modules to declare their own render element types and to - * specify their default values. The values returned by this hook will be + * This annotation allows modules to declare their own render element types and + * to specify their default values. The values returned by this plugin will be * merged with the elements returned by render arrays and so can return defaults * for any Render APIs keys in addition to those explicitly documented by * \Drupal\Core\Render\ElementInfoManagerInterface::getInfo(). * * Plugin Namespace: Element * - * For a working example, see \Drupal\Core\Render\Element\Textfield. + * For a working example, see \Drupal\Core\Render\Element\Link. * * @see \Drupal\Core\Render\ElementInfoManager - * @see \Drupal\Core\Render\ElementInfoPluginInterface - * @see \Drupal\Core\Render\ElementInfoPluginBase + * @see \Drupal\Core\Render\ElementInterface + * @see \Drupal\Core\Render\RenderElement * * @ingroup plugin_api * diff --git a/core/lib/Drupal/Core/Render/Element/ElementInterface.php b/core/lib/Drupal/Core/Render/Element/ElementInterface.php index 7eb753a..020e18a 100644 --- a/core/lib/Drupal/Core/Render/Element/ElementInterface.php +++ b/core/lib/Drupal/Core/Render/Element/ElementInterface.php @@ -12,9 +12,11 @@ /** * Provides an interface for element plugins. * - * @see \Drupal\Core\Render\Annotation\ElementInfo * @see \Drupal\Core\Render\ElementInfoManager - * @see \Drupal\Core\Render\ElementInfoBase + * @see \Drupal\Core\Render\Annotation\RenderElement + * @see \Drupal\Core\Render\Annotation\FormElement + * @see \Drupal\Core\Render\RenderElement + * @see \Drupal\Core\Render\FormElement */ interface ElementInterface extends PluginInspectionInterface { diff --git a/core/lib/Drupal/Core/Render/Element/FormElement.php b/core/lib/Drupal/Core/Render/Element/FormElement.php index d3ee790..a118f0a 100644 --- a/core/lib/Drupal/Core/Render/Element/FormElement.php +++ b/core/lib/Drupal/Core/Render/Element/FormElement.php @@ -8,7 +8,13 @@ namespace Drupal\Core\Render\Element; /** - * @todo. + * Provides a base class for form render plugins. + * + * @see \Drupal\Core\Render\Annotation\FormElement + * @see \Drupal\Core\Render\ElementInterface + * @see \Drupal\Core\Render\ElementInfoManager + * + * @ingroup plugin_api */ abstract class FormElement extends RenderElement { diff --git a/core/lib/Drupal/Core/Render/Element/RenderElement.php b/core/lib/Drupal/Core/Render/Element/RenderElement.php index cf6ad20..19cb772 100644 --- a/core/lib/Drupal/Core/Render/Element/RenderElement.php +++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php @@ -11,10 +11,10 @@ use Drupal\Core\Render\Element; /** - * Provides a base class for element plugins. + * Provides a base class for element render plugins. * - * @see \Drupal\Core\Render\Annotation\ElementInfo - * @see \Drupal\Core\Render\ElementInfoInterface + * @see \Drupal\Core\Render\Annotation\RenderElement + * @see \Drupal\Core\Render\ElementInterface * @see \Drupal\Core\Render\ElementInfoManager * * @ingroup plugin_api diff --git a/core/lib/Drupal/Core/Render/ElementInfoManager.php b/core/lib/Drupal/Core/Render/ElementInfoManager.php index 43d0b86..a60e54d 100644 --- a/core/lib/Drupal/Core/Render/ElementInfoManager.php +++ b/core/lib/Drupal/Core/Render/ElementInfoManager.php @@ -14,9 +14,11 @@ /** * Provides a plugin manager for element plugins. * - * @see \Drupal\Core\Render\Annotation\ElementInfo - * @see \Drupal\Core\Render\ElementInfoInterface - * @see \Drupal\Core\Render\ElementInfoBase + * @see \Drupal\Core\Render\ElementInterface + * @see \Drupal\Core\Render\Annotation\RenderElement + * @see \Drupal\Core\Render\Annotation\FormElement + * @see \Drupal\Core\Render\RenderElement + * @see \Drupal\Core\Render\FormElement * * @ingroup plugin_api */ @@ -57,7 +59,8 @@ public function getInfo($type) { * Builds up all element information. */ protected function buildInfo() { - // @todo Remove this hook once all elements are converted to plugins. + // @todo Remove this hook once all elements are converted to plugins in + // https://www.drupal.org/node/2311393. $info = $this->moduleHandler->invokeAll('element_info'); foreach ($this->getDefinitions() as $element_type => $definition) { diff --git a/core/lib/Drupal/Core/Render/Plugin/README.txt b/core/lib/Drupal/Core/Render/Plugin/README.txt index 7f04b88..f761e01 100644 --- a/core/lib/Drupal/Core/Render/Plugin/README.txt +++ b/core/lib/Drupal/Core/Render/Plugin/README.txt @@ -1,2 +1,4 @@ -@todo This must be here because DrupalKernel is stupid. Fix in - https://www.drupal.org/node/2309889. +@todo This must be here because DrupalKernel will only allow namespaces to + provide plugins if there is a Plugin subdirectory, and git does not allow + empty subdirectories. This file should be removed once + https://www.drupal.org/node/2309889 is fixed.