diff --git a/core/modules/contextual/src/Element/ContextualLinks.php b/core/modules/contextual/src/Element/ContextualLinks.php index 5cf8cab..ba0c34d 100644 --- a/core/modules/contextual/src/Element/ContextualLinks.php +++ b/core/modules/contextual/src/Element/ContextualLinks.php @@ -15,6 +15,7 @@ * @FormElement("contextual_links") */ class ContextualLinks extends FormElement { + /** * {@inheritdoc} */ @@ -38,7 +39,7 @@ public function getInfo() { /** * Pre-render callback: Builds a renderable array for contextual links. * - * @param $element + * @param array $element * A renderable array containing a #contextual_links property, which is a * keyed array. Each key is the name of the group of contextual links to * render (based on the 'group' key in the *.links.contextual.yml files for @@ -57,10 +58,10 @@ public function getInfo() { * )) * @endcode * - * @return + * @return array * A renderable array representing contextual links. */ - public static function preRenderLinks($element) { + public static function preRenderLinks(array $element) { // Retrieve contextual menu links. $items = array(); @@ -105,4 +106,5 @@ public static function preRenderLinks($element) { public static function getLinksManager() { return \Drupal::service('plugin.manager.menu.contextual_link'); } + } diff --git a/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php b/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php index e9500eb..7d053c3 100644 --- a/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php +++ b/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php @@ -16,6 +16,7 @@ * @FormElement("contextual_links_placeholder") */ class ContextualLinksPlaceholder extends FormElement { + /** * {@inheritdoc} */ @@ -36,17 +37,17 @@ public function getInfo() { * contains an identifier ("contextual id"), which allows the JavaScript of the * drupal.contextual-links library to dynamically render contextual links. * - * @param $element + * @param array $element * A structured array with #id containing a "contextual id". * - * @return + * @return array * The passed-in element with a contextual link placeholder in '#markup'. * * @see _contextual_links_to_id() - * @see contextual_element_info() */ - public static function preRenderPlaceholder($element) { + public static function preRenderPlaceholder(array $element) { $element['#markup'] = ' $element['#id'])) . '>'; return $element; } + }