diff --git a/core/modules/contact/src/Access/ContactPageAccess.php b/core/modules/contact/src/Access/ContactPageAccess.php
index b0574da..ba870d2 100644
--- a/core/modules/contact/src/Access/ContactPageAccess.php
+++ b/core/modules/contact/src/Access/ContactPageAccess.php
@@ -91,7 +91,7 @@ public function access(UserInterface $user, AccountInterface $account) {
     }
     // If the requested user did not save a preference yet, deny access if the
     // configured default is disabled.
-    else if (!$this->configFactory->get('contact.settings')->get('user_default_enabled')) {
+    elseif (!$this->configFactory->get('contact.settings')->get('user_default_enabled')) {
       return $access;
     }
 
diff --git a/core/modules/contact/src/ContactFormInterface.php b/core/modules/contact/src/ContactFormInterface.php
index 6aeb6a6..d38c79b 100644
--- a/core/modules/contact/src/ContactFormInterface.php
+++ b/core/modules/contact/src/ContactFormInterface.php
@@ -27,7 +27,7 @@ public function getRecipients();
    * Returns an auto-reply message to send to the message author.
    *
    * @return string
-   *  An auto-reply message
+   *   An auto-reply message
    */
   public function getReply();
 
@@ -47,7 +47,7 @@ public function getWeight();
    *
    * @return $this
    */
-  public function setRecipients($recipients);
+  public function setRecipients(array $recipients);
 
   /**
    * Sets an auto-reply message to send to the message author.
diff --git a/core/modules/contact/src/Entity/ContactForm.php b/core/modules/contact/src/Entity/ContactForm.php
index 2dd7ce3..2ffa380 100644
--- a/core/modules/contact/src/Entity/ContactForm.php
+++ b/core/modules/contact/src/Entity/ContactForm.php
@@ -88,7 +88,7 @@ public function getRecipients() {
   /**
    * {@inheritdoc}
    */
-  public function setRecipients($recipients) {
+  public function setRecipients(array $recipients) {
     $this->recipients = $recipients;
     return $this;
   }
diff --git a/core/modules/contact/src/Entity/Message.php b/core/modules/contact/src/Entity/Message.php
index 20be2e8..14fa6b4 100644
--- a/core/modules/contact/src/Entity/Message.php
+++ b/core/modules/contact/src/Entity/Message.php
@@ -109,7 +109,7 @@ public function setMessage($message) {
    * {@inheritdoc}
    */
   public function copySender() {
-    return (bool)$this->get('copy')->value;
+    return (bool) $this->get('copy')->value;
   }
 
   /**
diff --git a/core/modules/contact/src/Plugin/views/field/ContactLink.php b/core/modules/contact/src/Plugin/views/field/ContactLink.php
index 118380d..8826ae5 100644
--- a/core/modules/contact/src/Plugin/views/field/ContactLink.php
+++ b/core/modules/contact/src/Plugin/views/field/ContactLink.php
@@ -45,6 +45,7 @@ class ContactLink extends Link {
    *   \Drupal\Core\Plugin\PluginBase instead.
    *
    * @return \Drupal\Core\Session\AccountInterface
+   *   returns the current active user.
    */
   protected function currentUser() {
     if (!$this->currentUser) {
diff --git a/core/modules/contact/src/Tests/ContactAuthenticatedUserTest.php b/core/modules/contact/src/Tests/ContactAuthenticatedUserTest.php
index d88ba5a..841d843 100644
--- a/core/modules/contact/src/Tests/ContactAuthenticatedUserTest.php
+++ b/core/modules/contact/src/Tests/ContactAuthenticatedUserTest.php
@@ -26,7 +26,7 @@ class ContactAuthenticatedUserTest extends WebTestBase {
   /**
    * Tests that name and email fields are not present for authenticated users.
    */
-  function testContactSiteWideTextfieldsLoggedInTestCase() {
+  public function testContactSiteWideTextfieldsLoggedInTestCase() {
     $this->drupalLogin($this->drupalCreateUser(array('access site-wide contact form')));
     $this->drupalGet('contact');
 
diff --git a/core/modules/contact/src/Tests/ContactPersonalTest.php b/core/modules/contact/src/Tests/ContactPersonalTest.php
index 51124c9..e32980d 100644
--- a/core/modules/contact/src/Tests/ContactPersonalTest.php
+++ b/core/modules/contact/src/Tests/ContactPersonalTest.php
@@ -30,67 +30,75 @@ class ContactPersonalTest extends WebTestBase {
    *
    * @var object
    */
-  private $admin_user;
+  private $adminUser;
 
   /**
    * A user with 'access user contact forms' permission.
    *
    * @var object
    */
-  private $web_user;
+  private $webUser;
 
   /**
    * A user without any permissions.
    *
    * @var object
    */
-  private $contact_user;
+  private $contactUser;
 
+  /**
+   * {@inheritdoc}
+   */
   protected function setUp() {
     parent::setUp();
 
     // Create an admin user.
-    $this->admin_user = $this->drupalCreateUser(array('administer contact forms', 'administer users', 'administer account settings', 'access site reports'));
+    $this->adminUser = $this->drupalCreateUser(array(
+      'administer contact forms',
+      'administer users',
+      'administer account settings',
+      'access site reports',
+    ));
 
     // Create some normal users with their contact forms enabled by default.
     \Drupal::config('contact.settings')->set('user_default_enabled', TRUE)->save();
-    $this->web_user = $this->drupalCreateUser(array('access user contact forms'));
-    $this->contact_user = $this->drupalCreateUser();
+    $this->webUser = $this->drupalCreateUser(array('access user contact forms'));
+    $this->contactUser = $this->drupalCreateUser();
   }
 
   /**
    * Tests that mails for contact messages are correctly sent.
    */
-  function testSendPersonalContactMessage() {
-    $this->drupalLogin($this->web_user);
+  public function testSendPersonalContactMessage() {
+    $this->drupalLogin($this->webUser);
 
-    $message = $this->submitPersonalContact($this->contact_user);
+    $message = $this->submitPersonalContact($this->contactUser);
     $mails = $this->drupalGetMails();
     $this->assertEqual(1, count($mails));
     $mail = $mails[0];
-    $this->assertEqual($mail['to'], $this->contact_user->getEmail());
+    $this->assertEqual($mail['to'], $this->contactUser->getEmail());
     $this->assertEqual($mail['from'], \Drupal::config('system.site')->get('mail'));
-    $this->assertEqual($mail['reply-to'], $this->web_user->getEmail());
+    $this->assertEqual($mail['reply-to'], $this->webUser->getEmail());
     $this->assertEqual($mail['key'], 'user_mail');
     $variables = array(
       '!site-name' => \Drupal::config('system.site')->get('name'),
       '!subject' => $message['subject[0][value]'],
-      '!recipient-name' => $this->contact_user->getUsername(),
+      '!recipient-name' => $this->contactUser->getUsername(),
     );
     $this->assertEqual($mail['subject'], t('[!site-name] !subject', $variables), 'Subject is in sent message.');
     $this->assertTrue(strpos($mail['body'], t('Hello !recipient-name,', $variables)) !== FALSE, 'Recipient name is in sent message.');
-    $this->assertTrue(strpos($mail['body'], $this->web_user->getUsername()) !== FALSE, 'Sender name is in sent message.');
+    $this->assertTrue(strpos($mail['body'], $this->webUser->getUsername()) !== FALSE, 'Sender name is in sent message.');
     $this->assertTrue(strpos($mail['body'], $message['message[0][value]']) !== FALSE, 'Message body is in sent message.');
 
     // Check there was no problems raised during sending.
     $this->drupalLogout();
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     // Verify that the correct watchdog message has been logged.
     $this->drupalGet('/admin/reports/dblog');
     $placeholders = array(
-      '@sender_name' => $this->web_user->username,
-      '@sender_email' => $this->web_user->getEmail(),
-      '@recipient_name' => $this->contact_user->getUsername()
+      '@sender_name' => $this->webUser->username,
+      '@sender_email' => $this->webUser->getEmail(),
+      '@recipient_name' => $this->contactUser->getUsername(),
     );
     $this->assertText(String::format('@sender_name (@sender_email) sent @recipient_name an email.', $placeholders));
   }
@@ -98,27 +106,27 @@ function testSendPersonalContactMessage() {
   /**
    * Tests access to the personal contact form.
    */
-  function testPersonalContactAccess() {
+  public function testPersonalContactAccess() {
     // Test allowed access to admin user's contact form.
-    $this->drupalLogin($this->web_user);
-    $this->drupalGet('user/' . $this->admin_user->id() . '/contact');
+    $this->drupalLogin($this->webUser);
+    $this->drupalGet('user/' . $this->adminUser->id() . '/contact');
     $this->assertResponse(200);
     // Check the page title is properly displayed.
-    $this->assertRaw(t('Contact @username', array('@username' => $this->admin_user->getUsername())));
+    $this->assertRaw(t('Contact @username', array('@username' => $this->adminUser->getUsername())));
 
     // Test denied access to admin user's own contact form.
     $this->drupalLogout();
-    $this->drupalLogin($this->admin_user);
-    $this->drupalGet('user/' . $this->admin_user->id() . '/contact');
+    $this->drupalLogin($this->adminUser);
+    $this->drupalGet('user/' . $this->adminUser->id() . '/contact');
     $this->assertResponse(403);
 
     // Test allowed access to user with contact form enabled.
-    $this->drupalLogin($this->web_user);
-    $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
+    $this->drupalLogin($this->webUser);
+    $this->drupalGet('user/' . $this->contactUser->id() . '/contact');
     $this->assertResponse(200);
 
     // Test denied access to the user's own contact form.
-    $this->drupalGet('user/' . $this->web_user->id() . '/contact');
+    $this->drupalGet('user/' . $this->webUser->id() . '/contact');
     $this->assertResponse(403);
 
     // Test always denied access to the anonymous user contact form.
@@ -128,22 +136,22 @@ function testPersonalContactAccess() {
     // Test that anonymous users can access the contact form.
     $this->drupalLogout();
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms'));
-    $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
+    $this->drupalGet('user/' . $this->contactUser->id() . '/contact');
     $this->assertResponse(200);
 
     // Test that anonymous users can access admin user's contact form.
-    $this->drupalGet('user/' . $this->admin_user->id() . '/contact');
+    $this->drupalGet('user/' . $this->adminUser->id() . '/contact');
     $this->assertResponse(200);
 
     // Revoke the personal contact permission for the anonymous user.
     user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms'));
-    $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
+    $this->drupalGet('user/' . $this->contactUser->id() . '/contact');
     $this->assertResponse(403);
-    $this->drupalGet('user/' . $this->admin_user->id() . '/contact');
+    $this->drupalGet('user/' . $this->adminUser->id() . '/contact');
     $this->assertResponse(403);
 
     // Disable the personal contact form.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $edit = array('contact_default_status' => FALSE);
     $this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), 'Setting successfully saved.');
@@ -151,76 +159,77 @@ function testPersonalContactAccess() {
 
     // Re-create our contacted user with personal contact forms disabled by
     // default.
-    $this->contact_user = $this->drupalCreateUser();
+    $this->contactUser = $this->drupalCreateUser();
 
     // Test denied access to a user with contact form disabled.
-    $this->drupalLogin($this->web_user);
-    $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
+    $this->drupalLogin($this->webUser);
+    $this->drupalGet('user/' . $this->contactUser->id() . '/contact');
     $this->assertResponse(403);
 
     // Test allowed access for admin user to a user with contact form disabled.
-    $this->drupalLogin($this->admin_user);
-    $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
+    $this->drupalLogin($this->adminUser);
+    $this->drupalGet('user/' . $this->contactUser->id() . '/contact');
     $this->assertResponse(200);
 
     // Re-create our contacted user as a blocked user.
-    $this->contact_user = $this->drupalCreateUser();
-    $this->contact_user->block();
-    $this->contact_user->save();
+    $this->contactUser = $this->drupalCreateUser();
+    $this->contactUser->block();
+    $this->contactUser->save();
 
     // Test that blocked users can still be contacted by admin.
-    $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
+    $this->drupalGet('user/' . $this->contactUser->id() . '/contact');
     $this->assertResponse(200);
 
     // Test that blocked users cannot be contacted by non-admins.
-    $this->drupalLogin($this->web_user);
-    $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
+    $this->drupalLogin($this->webUser);
+    $this->drupalGet('user/' . $this->contactUser->id() . '/contact');
     $this->assertResponse(403);
 
     // Test enabling and disabling the contact page through the user profile
     // form.
-    $this->drupalGet('user/' . $this->web_user->id() . '/edit');
+    $this->drupalGet('user/' . $this->webUser->id() . '/edit');
     $this->assertNoFieldChecked('edit-contact--2');
-    $this->assertFalse(\Drupal::service('user.data')->get('contact', $this->web_user->id(), 'enabled'), 'Personal contact form disabled');
+    $this->assertFalse(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form disabled');
     $this->drupalPostForm(NULL, array('contact' => TRUE), t('Save'));
     $this->assertFieldChecked('edit-contact--2');
-    $this->assertTrue(\Drupal::service('user.data')->get('contact', $this->web_user->id(), 'enabled'), 'Personal contact form enabled');
+    $this->assertTrue(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form enabled');
   }
 
   /**
    * Tests the personal contact form flood protection.
    */
-  function testPersonalContactFlood() {
+  public function testPersonalContactFlood() {
     $flood_limit = 3;
     \Drupal::config('contact.settings')->set('flood.limit', $flood_limit)->save();
 
-    // Clear flood table in preparation for flood test and allow other checks to complete.
+    // Clear flood table in preparation for flood test and
+    // allow other checks to complete.
     db_delete('flood')->execute();
     $num_records_flood = db_query("SELECT COUNT(*) FROM {flood}")->fetchField();
     $this->assertIdentical($num_records_flood, '0', 'Flood table emptied.');
 
-    $this->drupalLogin($this->web_user);
+    $this->drupalLogin($this->webUser);
 
     // Submit contact form with correct values and check flood interval.
     for ($i = 0; $i < $flood_limit; $i++) {
-      $this->submitPersonalContact($this->contact_user);
+      $this->submitPersonalContact($this->contactUser);
       $this->assertText(t('Your message has been sent.'), 'Message sent.');
     }
 
     // Submit contact form one over limit.
-    $this->drupalGet('user/' . $this->contact_user->id(). '/contact');
+    $this->drupalGet('user/' . $this->contactUser->id() . '/contact');
     $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => \Drupal::service('date.formatter')->formatInterval(\Drupal::config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.');
 
     // Test that the admin user can still access the contact form even though
     // the flood limit was reached.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->assertNoText('Try again later.', 'Admin user not denied access to flooded contact form.');
   }
 
   /**
    * Tests the personal contact form based access when an admin adds users.
    */
-  function testAdminContact() {
+  public function testAdminContact() {
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms'));
     $this->checkContactAccess(200);
     $this->checkContactAccess(403, FALSE);
@@ -233,13 +242,13 @@ function testAdminContact() {
   /**
    * Creates a user and then checks contact form access.
    *
-   * @param integer $response
+   * @param int $response
    *   The expected response code.
-   * @param boolean $contact_value
+   * @param bool $contact_value
    *   (optional) The value the contact field should be set too.
    */
   protected function checkContactAccess($response, $contact_value = NULL) {
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/people/create');
     if (\Drupal::config('contact.settings')->get('user_default_enabled', TRUE)) {
       $this->assertFieldChecked('edit-contact--2');
diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php
index beee430..2b2cef6 100644
--- a/core/modules/contact/src/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/src/Tests/ContactSitewideTest.php
@@ -28,7 +28,7 @@ class ContactSitewideTest extends WebTestBase {
   /**
    * Tests configuration options and the site-wide contact form.
    */
-  function testSiteWideContact() {
+  public function testSiteWideContact() {
     // Create and login administrative user.
     $admin_user = $this->drupalCreateUser(array(
       'access site-wide contact form',
@@ -57,9 +57,9 @@ function testSiteWideContact() {
     // User form could not be changed or deleted.
     // Cannot use ::assertNoLinkByHref as it does partial url matching and with
     // field_ui enabled admin/structure/contact/manage/personal/fields exists.
-    // @todo: See https://drupal.org/node/2031223 for the above
+    // @todo: See https://drupal.org/node/2031223 for the above.
     $edit_link = $this->xpath('//a[@href=:href]', array(
-      ':href' => \Drupal::url('entity.contact_form.edit_form', array('contact_form' => 'personal'))
+      ':href' => \Drupal::url('entity.contact_form.edit_form', array('contact_form' => 'personal')),
     ));
     $this->assertTrue(empty($edit_link), format_string('No link containing href %href found.',
       array('%href' => 'admin/structure/contact/manage/personal')
@@ -91,7 +91,13 @@ function testSiteWideContact() {
 
     // Add forms.
     // Test invalid recipients.
-    $invalid_recipients = array('invalid', 'invalid@', 'invalid@site.', '@site.', '@site.com');
+    $invalid_recipients = array(
+      'invalid',
+      'invalid@',
+      'invalid@site.',
+      '@site.',
+      '@site.com',
+    );
     foreach ($invalid_recipients as $invalid_recipient) {
       $this->addContactForm($this->randomMachineName(16), $this->randomMachineName(16), $invalid_recipient, '', FALSE);
       $this->assertRaw(t('%recipient is an invalid email address.', array('%recipient' => $invalid_recipient)));
@@ -104,7 +110,11 @@ function testSiteWideContact() {
     $this->assertText(t('Recipients field is required.'));
 
     // Test validation of max_length machine name.
-    $recipients = array('simpletest@example.com', 'simpletest2@example.com', 'simpletest3@example.com');
+    $recipients = array(
+      'simpletest@example.com',
+      'simpletest2@example.com',
+      'simpletest3@example.com',
+    );
     $max_length = EntityTypeInterface::BUNDLE_MAX_LENGTH;
     $max_length_exceeded = $max_length + 1;
     $this->addContactForm($id = drupal_strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', array($recipients[0])), '', TRUE);
@@ -151,7 +161,8 @@ function testSiteWideContact() {
     $this->addContactForm(drupal_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0], $recipients[1])), '', FALSE);
     $this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
 
-    $this->addContactForm($name = drupal_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0], $recipients[1], $recipients[2])), '', FALSE);
+    $this->addContactForm($name = drupal_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array(
+      $recipients[0], $recipients[1], $recipients[2])), '', FALSE);
     $this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
 
     // Try adding a form that already exists.
@@ -159,13 +170,15 @@ function testSiteWideContact() {
     $this->assertNoRaw(t('Contact form %label has been added.', array('%label' => $label)));
     $this->assertRaw(t('The machine-readable name is already in use. It must be unique.'));
 
-    // Clear flood table in preparation for flood test and allow other checks to complete.
+    // Clear flood table in preparation for flood test and
+    // allow other checks to complete.
     db_delete('flood')->execute();
     $num_records_after = db_query("SELECT COUNT(*) FROM {flood}")->fetchField();
     $this->assertIdentical($num_records_after, '0', 'Flood table emptied.');
     $this->drupalLogout();
 
-    // Check to see that anonymous user cannot see contact page without permission.
+    // Check to see that anonymous user cannot see
+    // contact page without permission.
     user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
     $this->drupalGet('contact');
     $this->assertResponse(403);
@@ -220,7 +233,11 @@ function testSiteWideContact() {
     $this->deleteContactForms();
 
     $label = $this->randomMachineName(16);
-    $recipients = implode(',', array($recipients[0], $recipients[1], $recipients[2]));
+    $recipients = implode(',', array(
+      $recipients[0],
+      $recipients[1],
+      $recipients[2],
+    ));
     $contact_form = drupal_strtolower($this->randomMachineName(16));
     $this->addContactForm($contact_form, $label, $recipients, '', FALSE);
     $this->drupalGet('admin/structure/contact');
@@ -233,8 +250,8 @@ function testSiteWideContact() {
 
     // Find out in which row the form we want to add a field to is.
     $i = 0;
-    foreach($this->xpath('//table/tbody/tr') as $row) {
-      if (((string)$row->td[0]) == $label) {
+    foreach ($this->xpath('//table/tbody/tr') as $row) {
+      if (((string) $row->td[0]) == $label) {
         break;
       }
       $i++;
@@ -275,9 +292,14 @@ function testSiteWideContact() {
   /**
    * Tests auto-reply on the site-wide contact form.
    */
-  function testAutoReply() {
+  public function testAutoReply() {
     // Create and login administrative user.
-    $admin_user = $this->drupalCreateUser(array('access site-wide contact form', 'administer contact forms', 'administer permissions', 'administer users'));
+    $admin_user = $this->drupalCreateUser(array(
+      'access site-wide contact form',
+      'administer contact forms',
+      'administer permissions',
+      'administer users',
+    ));
     $this->drupalLogin($admin_user);
 
     // Set up three forms, 2 with an auto-reply and one without.
@@ -296,7 +318,8 @@ function testAutoReply() {
     $subject = $this->randomMachineName(64);
     $this->submitContact($this->randomMachineName(16), $email, $subject, 'foo', $this->randomString(128));
 
-    // We are testing the auto-reply, so there should be one email going to the sender.
+    // We are testing the auto-reply, so there should be one email going to the
+    // sender.
     $captured_emails = $this->drupalGetMails(array('id' => 'contact_page_autoreply', 'to' => $email));
     $this->assertEqual(count($captured_emails), 1);
     $this->assertEqual(trim($captured_emails[0]['body']), trim(drupal_html_to_text($foo_autoreply)));
@@ -305,12 +328,14 @@ function testAutoReply() {
     $email = $this->randomMachineName(32) . '@example.com';
     $this->submitContact($this->randomMachineName(16), $email, $this->randomString(64), 'bar', $this->randomString(128));
 
-    // Auto-reply for form 'bar' should result in one auto-reply email to the sender.
+    // Auto-reply for form 'bar' should result in one auto-reply email to the
+    // sender.
     $captured_emails = $this->drupalGetMails(array('id' => 'contact_page_autoreply', 'to' => $email));
     $this->assertEqual(count($captured_emails), 1);
     $this->assertEqual(trim($captured_emails[0]['body']), trim(drupal_html_to_text($bar_autoreply)));
 
-    // Verify that no auto-reply is sent when the auto-reply field is left blank.
+    // Verify that no auto-reply is sent when the auto-reply field is left
+    // blank.
     $email = $this->randomMachineName(32) . '@example.com';
     $this->submitContact($this->randomMachineName(16), $email, $this->randomString(64), 'no_autoreply', $this->randomString(128));
     $captured_emails = $this->drupalGetMails(array('id' => 'contact_page_autoreply', 'to' => $email));
@@ -329,12 +354,12 @@ function testAutoReply() {
    * @param string $reply
    *   The auto-reply text that is sent to a user upon completing the contact
    *   form.
-   * @param boolean $selected
+   * @param bool $selected
    *   A Boolean indicating whether the form should be selected by default.
    * @param array $third_party_settings
    *   Array of third party settings to be added to the posted form data.
    */
-  function addContactForm($id, $label, $recipients, $reply, $selected, $third_party_settings = []) {
+  public function addContactForm($id, $label, $recipients, $reply, $selected, $third_party_settings = []) {
     $edit = array();
     $edit['label'] = $label;
     $edit['id'] = $id;
@@ -357,10 +382,10 @@ function addContactForm($id, $label, $recipients, $reply, $selected, $third_part
    * @param string $reply
    *   The auto-reply text that is sent to a user upon completing the contact
    *   form.
-   * @param boolean $selected
+   * @param bool $selected
    *   A Boolean indicating whether the form should be selected by default.
    */
-  function updateContactForm($id, $label, $recipients, $reply, $selected) {
+  public function updateContactForm($id, $label, $recipients, $reply, $selected) {
     $edit = array();
     $edit['label'] = $label;
     $edit['recipients'] = $recipients;
@@ -383,7 +408,7 @@ function updateContactForm($id, $label, $recipients, $reply, $selected) {
    * @param string $message
    *   The message body.
    */
-  function submitContact($name, $mail, $subject, $id, $message) {
+  public function submitContact($name, $mail, $subject, $id, $message) {
     $edit = array();
     $edit['name'] = $name;
     $edit['mail'] = $mail;
@@ -400,7 +425,7 @@ function submitContact($name, $mail, $subject, $id, $message) {
   /**
    * Deletes all forms.
    */
-  function deleteContactForms() {
+  public function deleteContactForms() {
     $contact_forms = entity_load_multiple('contact_form');
     foreach ($contact_forms as $id => $contact_form) {
       if ($id == 'personal') {
diff --git a/core/modules/contact/src/Tests/ContactStorageTest.php b/core/modules/contact/src/Tests/ContactStorageTest.php
index 741e6b5..f32a34d 100644
--- a/core/modules/contact/src/Tests/ContactStorageTest.php
+++ b/core/modules/contact/src/Tests/ContactStorageTest.php
@@ -30,6 +30,9 @@ class ContactStorageTest extends ContactSitewideTest {
     'contact_test',
   );
 
+  /**
+   * {@inheritdoc}
+   */
   public static function getInfo() {
     return array(
       'name' => 'Contact Storage',
diff --git a/core/modules/contact/src/Tests/MessageEntityTest.php b/core/modules/contact/src/Tests/MessageEntityTest.php
index f888345..cd04644 100644
--- a/core/modules/contact/src/Tests/MessageEntityTest.php
+++ b/core/modules/contact/src/Tests/MessageEntityTest.php
@@ -30,6 +30,9 @@ class MessageEntityTest extends KernelTestBase {
     'contact_test',
   );
 
+  /**
+   * {@inheritdoc}
+   */
   protected function setUp() {
     parent::setUp();
     $this->installConfig(array('contact'));
diff --git a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
index 5441526..527981d 100644
--- a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
+++ b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
@@ -28,17 +28,20 @@ class ContactFieldsTest extends ViewTestBase {
    *
    * @var \Drupal\field\Entity\FieldStorageConfig
    */
-  protected $field_storage;
+  protected $fieldStorage;
 
+  /**
+   * {@inheritdoc}
+   */
   protected function setUp() {
     parent::setUp();
 
-    $this->field_storage = entity_create('field_storage_config', array(
+    $this->fieldStorage = entity_create('field_storage_config', array(
       'field_name' => strtolower($this->randomMachineName()),
       'entity_type' => 'contact_message',
-      'type' => 'text'
+      'type' => 'text',
     ));
-    $this->field_storage->save();
+    $this->fieldStorage->save();
 
     entity_create('contact_form', array(
       'id' => 'contact_message',
@@ -46,7 +49,7 @@ protected function setUp() {
     ))->save();
 
     entity_create('field_config', array(
-      'field_storage' => $this->field_storage,
+      'field_storage' => $this->fieldStorage,
       'bundle' => 'contact_message',
     ))->save();
 
@@ -59,7 +62,7 @@ protected function setUp() {
   public function testViewsData() {
     // Test that the field is not exposed to views, since contact_message
     // entities have no storage.
-    $table_name = 'contact_message__' .  $this->field_storage->getName();
+    $table_name = 'contact_message__' .  $this->fieldStorage->getName();
     $data = $this->container->get('views.views_data')->get($table_name);
     $this->assertFalse($data, 'The field is not exposed to Views.');
   }
diff --git a/core/modules/contact/tests/drupal-7.contact.database.php b/core/modules/contact/tests/drupal-7.contact.database.php
index ed8e5ba..f823ed3 100644
--- a/core/modules/contact/tests/drupal-7.contact.database.php
+++ b/core/modules/contact/tests/drupal-7.contact.database.php
@@ -21,11 +21,11 @@
   'recipients',
   'reply',
   'weight',
-  'selected'
+  'selected',
 ))
 ->values(array(
   'category' => 'Upgrade test',
-  'recipients'=> 'test1@example.com,test2@example.com',
+  'recipients' => 'test1@example.com,test2@example.com',
   'reply' => 'Test reply',
   'weight' => 1,
   'selected' => 1,
diff --git a/core/modules/contact/tests/src/Unit/MailHandlerTest.php b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
index 97d22b9..a43d555 100644
--- a/core/modules/contact/tests/src/Unit/MailHandlerTest.php
+++ b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
@@ -240,7 +240,7 @@ public function getSendMailMessages() {
     $results[] = $result + $default_result;
     $data[] = array($message, $sender, $results);
 
-    //For authenticated user.
+    // For authenticated user.
     $results = array();
     $message = $this->getAuthenticatedMockMessage();
     $sender = $this->getMockSender(FALSE, 'user@drupal.org');
@@ -332,7 +332,7 @@ protected function getMockSender($anonymous = TRUE, $mail_address = 'anonymous@d
    * @return \Drupal\contact\MessageInterface|\PHPUnit_Framework_MockObject_MockObject
    *   Mock message for testing.
    */
-  protected function getAnonymousMockMessage($recipients, $auto_reply, $copy_sender = FALSE) {
+  protected function getAnonymousMockMessage(array $recipients, $auto_reply, $copy_sender = FALSE) {
     $message = $this->getMock('\Drupal\contact\MessageInterface');
     $message->expects($this->any())
       ->method('getSenderName')
@@ -369,7 +369,7 @@ protected function getAuthenticatedMockMessage($copy_sender = FALSE) {
     $message->expects($this->once())
       ->method('copySender')
       ->willReturn($copy_sender);
-    $recipient =$this->getMock('\Drupal\user\UserInterface');
+    $recipient = $this->getMock('\Drupal\user\UserInterface');
     $recipient->expects($this->once())
       ->method('getEmail')
       ->willReturn('user2@drupal.org');
@@ -399,7 +399,7 @@ protected function getAuthenticatedMockMessage($copy_sender = FALSE) {
    * @return \Drupal\contact\ContactFormInterface|\PHPUnit_Framework_MockObject_MockObject
    *   Mock message for testing.
    */
-  protected function getMockContactForm($recipients, $auto_reply) {
+  protected function getMockContactForm(array $recipients, $auto_reply) {
     $contact_form = $this->getMock('\Drupal\contact\ContactFormInterface');
     $contact_form->expects($this->once())
       ->method('getRecipients')
