diff --git a/core/modules/contextual/contextual.api.php b/core/modules/contextual/contextual.api.php
index d972045..2122d2c 100644
--- a/core/modules/contextual/contextual.api.php
+++ b/core/modules/contextual/contextual.api.php
@@ -18,12 +18,13 @@
  * 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(),
+ *   \Drupal\Core\Menu\ContextualLinkManagerInterface
+ *    ::getContextualLinksArrayByGroup(),
  *   which were used to build $element['#links'].
  *
  * @see hook_contextual_links_alter()
diff --git a/core/modules/contextual/css/contextual.toolbar.css b/core/modules/contextual/css/contextual.toolbar.css
index bda844c..a21e0b4 100644
--- a/core/modules/contextual/css/contextual.toolbar.css
+++ b/core/modules/contextual/css/contextual.toolbar.css
@@ -20,8 +20,8 @@
   padding-right: 1.3333em;
 }
 .toolbar .toolbar-bar .contextual-toolbar-tab .toolbar-item.active {
-  background-image:-webkit-linear-gradient(rgb(78,159,234) 0%, rgb(69,132,221) 100%);
-  background-image:linear-gradient(rgb(78,159,234) 0%,rgb(69,132,221) 100%);
+  background-image: -webkit-linear-gradient(rgb(78,159,234) 0%, rgb(69,132,221) 100%);
+  background-image: linear-gradient(rgb(78,159,234) 0%,rgb(69,132,221) 100%);
 }
 
 /* @todo get rid of this declaration by making toolbar.module's CSS less specific */
diff --git a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
index b0affe8..aa27e25 100644
--- a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
+++ b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
@@ -29,6 +29,9 @@ public function usesGroupBy() {
     return FALSE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   protected function defineOptions() {
     $options = parent::defineOptions();
 
@@ -38,6 +41,9 @@ protected function defineOptions() {
     return $options;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function buildOptionsForm(&$form, FormStateInterface $form_state) {
     $all_fields = $this->view->display_handler->getFieldLabels();
     // Offer to include only those fields that follow this one.
@@ -61,6 +67,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
     );
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function preRender(&$values) {
     // Add a row plugin css class for the contextual link.
     $class = 'contextual-region';
@@ -118,8 +127,8 @@ public function render(ResultRow $values) {
           array(),
           array(
             'contextual-views-field-links' => UrlHelper::encodePath(Json::encode($links)),
-          )
-        )
+          ),
+        ),
       );
 
       $element = array(
@@ -133,6 +142,9 @@ public function render(ResultRow $values) {
     }
   }
 
-  public function query() { }
+  /**
+   * {@inheritdoc}
+   */
+ public function query() {}
 
 }
diff --git a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
index 61fa85e..64111fd 100644
--- a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
@@ -26,13 +26,20 @@ class ContextualDynamicContextTest extends WebTestBase {
    */
   public static $modules = array('contextual', 'node', 'views', 'views_ui');
 
+  /**
+   * {@inheritdoc}
+   */
   protected function setUp() {
     parent::setUp();
 
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
     $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
 
-    $this->editor_user = $this->drupalCreateUser(array('access content', 'access contextual links', 'edit any article content'));
+    $this->editor_user = $this->drupalCreateUser(array(
+      'access content',
+      'access contextual links',
+      'edit any article content',
+    ));
     $this->authenticated_user = $this->drupalCreateUser(array('access content', 'access contextual links'));
     $this->anonymous_user = $this->drupalCreateUser(array('access content'));
   }
@@ -43,7 +50,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->editor_user);
 
     // Create three nodes in the following order:
@@ -113,20 +120,16 @@ 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)));
   }
 
   /**
-   * Asserts that a contextual link placeholder with the given id does not exist.
+   * Asserts that a contextual link placeholder with given id does not exist.
    *
    * @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)));
diff --git a/core/modules/contextual/src/Tests/ContextualUnitTest.php b/core/modules/contextual/src/Tests/ContextualUnitTest.php
index bd145f6..3d3fc62 100644
--- a/core/modules/contextual/src/Tests/ContextualUnitTest.php
+++ b/core/modules/contextual/src/Tests/ContextualUnitTest.php
@@ -25,9 +25,9 @@ class ContextualUnitTest extends KernelTestBase {
   public static $modules = array('contextual');
 
   /**
-   * Provides testcases for testContextualLinksToId() and
+   * Provides testcases for testContextualLinksToId() and.
    */
-  function _contextual_links_id_testcases() {
+  public function runContextualLinksIdTestcases() {
     // Test branch conditions:
     // - one group.
     // - one dynamic path argument.
@@ -38,7 +38,7 @@ function _contextual_links_id_testcases() {
           'route_parameters' => array(
             'node' => '14031991',
           ),
-          'metadata' => array()
+          'metadata' => array(),
         ),
       ),
       'id' => 'node:node=14031991:',
@@ -51,10 +51,10 @@ function _contextual_links_id_testcases() {
     $tests[] = array(
       'links' => array(
         'foo' => array(
-          'route_parameters'=> array(
-            'bar',
+          'route_parameters' => array(
+            0 => 'bar',
             'key' => 'baz',
-            'qux',
+            1 => 'qux',
           ),
           'metadata' => array(),
         ),
@@ -70,7 +70,7 @@ function _contextual_links_id_testcases() {
       'links' => array(
         'views_ui_edit' => array(
           'route_parameters' => array(
-            'view' => 'frontpage'
+            'view' => 'frontpage',
           ),
           'metadata' => array(
             'location' => 'page',
@@ -94,9 +94,9 @@ function _contextual_links_id_testcases() {
         ),
         'foo' => array(
           'route_parameters' => array(
-            'bar',
+            0 => 'bar',
             'key' => 'baz',
-            'qux',
+            1 => 'qux',
           ),
           'metadata' => array(),
         ),
@@ -114,8 +114,8 @@ function _contextual_links_id_testcases() {
   /**
    * Tests _contextual_links_to_id().
    */
-  function testContextualLinksToId() {
-    $tests = $this->_contextual_links_id_testcases();
+  public function testContextualLinksToId() {
+    $tests = $this->runContextualLinksIdTestcases();
     foreach ($tests as $test) {
       $this->assertIdentical(_contextual_links_to_id($test['links']), $test['id']);
     }
@@ -124,8 +124,8 @@ function testContextualLinksToId() {
   /**
    * Tests _contextual_id_to_links().
    */
-  function testContextualIdToLinks() {
-    $tests = $this->_contextual_links_id_testcases();
+  public function testContextualIdToLinks() {
+    $tests = $this->runContextualLinksIdTestcases();
     foreach ($tests as $test) {
       $this->assertIdentical(_contextual_id_to_links($test['id']), $test['links']);
     }
