diff --git a/core/modules/contextual/contextual.api.php b/core/modules/contextual/contextual.api.php
index d972045..220a288 100644
--- a/core/modules/contextual/contextual.api.php
+++ b/core/modules/contextual/contextual.api.php
@@ -18,9 +18,9 @@
  * is passed in by reference. Further links may be added or existing links can
  * be altered.
  *
- * @param $element
+ * @param array $element
  *   A renderable array representing the contextual links.
- * @param $items
+ * @param array $items
  *   An associative array containing the original contextual link items, as
  *   generated by
  *   \Drupal\Core\Menu\ContextualLinkManagerInterface::getContextualLinksArrayByGroup(),
@@ -31,7 +31,7 @@
  * @see contextual_pre_render_links()
  * @see contextual_element_info()
  */
-function hook_contextual_links_view_alter(&$element, $items) {
+function hook_contextual_links_view_alter(array &$element, array $items) {
   // Add another class to all contextual link lists to facilitate custom
   // styling.
   $element['#attributes']['class'][] = 'custom-class';
diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module
index b7e8ef2..1d173bb 100644
--- a/core/modules/contextual/contextual.module
+++ b/core/modules/contextual/contextual.module
@@ -153,7 +153,7 @@ function contextual_contextual_links_view_alter(&$element, $items) {
  *   A serialized representation of a #contextual_links property value array for
  *   use in a data- attribute.
  */
-function _contextual_links_to_id($contextual_links) {
+function _contextual_links_to_id(array $contextual_links) {
   $ids = array();
   foreach ($contextual_links as $group => $args) {
     $route_parameters = UrlHelper::buildQuery($args['route_parameters']);
@@ -166,13 +166,13 @@ function _contextual_links_to_id($contextual_links) {
 /**
  * Unserializes the result of _contextual_links_to_id().
  *
- * @see _contextual_links_to_id
- *
  * @param string $id
  *   A serialized representation of a #contextual_links property value array.
  *
  * @return array
  *   The value for a #contextual_links property.
+ *
+ * @see _contextual_links_to_id
  */
 function _contextual_id_to_links($id) {
   $contextual_links = array();
diff --git a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
index 8701087..24cf11c 100644
--- a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
@@ -47,6 +47,9 @@ class ContextualDynamicContextTest extends WebTestBase {
    */
   public static $modules = array('contextual', 'node', 'views', 'views_ui');
 
+  /**
+   * {@inheritdoc}
+   */
   protected function setUp() {
     parent::setUp();
 
@@ -64,7 +67,7 @@ protected function setUp() {
    * Ensures that contextual link placeholders always exist, even if the user is
    * not allowed to use contextual links.
    */
-  function testDifferentPermissions() {
+  public function testDifferentPermissions() {
     $this->drupalLogin($this->editorUser);
 
     // Create three nodes in the following order:
@@ -134,8 +137,6 @@ function testDifferentPermissions() {
    *
    * @param string $id
    *   A contextual link id.
-   *
-   * @return bool
    */
   protected function assertContextualLinkPlaceHolder($id) {
     $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
@@ -146,8 +147,6 @@ protected function assertContextualLinkPlaceHolder($id) {
    *
    * @param string $id
    *   A contextual link id.
-   *
-   * @return bool
    */
   protected function assertNoContextualLinkPlaceHolder($id) {
     $this->assertNoRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id does not exist.', array('@id' => $id)));
@@ -164,7 +163,7 @@ protected function assertNoContextualLinkPlaceHolder($id) {
    * @return string
    *   The response body.
    */
-  protected function renderContextualLinks($ids, $current_path) {
+  protected function renderContextualLinks(array $ids, $current_path) {
     $post = array();
     for ($i = 0; $i < count($ids); $i++) {
       $post['ids[' . $i . ']'] = $ids[$i];
