diff --git a/src/ConnectionTester/ConnectionTester.php b/src/ConnectionTester/ConnectionTester.php
index 229a34b..300427e 100644
--- a/src/ConnectionTester/ConnectionTester.php
+++ b/src/ConnectionTester/ConnectionTester.php
@@ -13,10 +13,8 @@ class ConnectionTester {
 
   use StringTranslationTrait;
 
-  /**
-   * These constants de not seem to be available outside of the .install file
-   * so we need to declare them here.
-   */
+  // These constants de not seem to be available outside of the .install file
+  // so we need to declare them here.
   const REQUIREMENT_OK = 0;
   const REQUIREMENT_ERROR = 2;
 
@@ -44,6 +42,9 @@ class ConnectionTester {
     $this->testConnection();
   }
 
+  /**
+   * Test SMTP connection.
+   */
   public function testConnection() {
     $mailer = $this->phpMailer();
 
@@ -59,11 +60,9 @@ class ConnectionTester {
         $this->value = $this->t('SMTP module is enabled, turned on, and connection is valid.');
         return;
       }
-      else {
-        $this->severity = self::REQUIREMENT_ERROR;
-        $this->value = $this->t('SMTP module is enabled, turned on, but SmtpConnect() returned FALSE.');
-        return;
-      }
+      $this->severity = REQUIREMENT_ERROR;
+      $this->value = $this->t('SMTP module is enabled, turned on, but SmtpConnect() returned FALSE.');
+      return;
     }
     catch (PHPMailerException $e) {
       $this->value = $this->t('SMTP module is enabled, turned on, but SmtpConnect() threw exception @e', [
@@ -104,11 +103,11 @@ class ConnectionTester {
   public function hookRequirements(string $phase) {
     $requirements = [];
     if ($phase == 'runtime') {
-      $requirements['smtp_connection'] = array(
+      $requirements['smtp_connection'] = [
         'title' => $this->t('SMTP connection'),
         'value' => $this->getValue(),
         'severity' => $this->getSeverity(),
-      );
+      ];
     }
     return $requirements;
   }
@@ -129,7 +128,8 @@ class ConnectionTester {
       $mailer->SMTPDebug = FALSE;
       $mailer->Host = $this->configGet('smtp_host') . ';' . $this->configGet('smtp_hostbackup');
       $mailer->Port = $this->configGet('smtp_port');
-      $mailer->SMTPSecure = in_array($this->configGet('smtp_protocol'), ['ssl', 'tls']) ? $this->configGet('smtp_protocol') : '';
+      $protocol = $this->configGet('smtp_protocol');
+      $mailer->SMTPSecure = in_array($protocol, ['ssl', 'tls'], TRUE) ? $protocol : '';
       if ($helo = $this->configGet('smtp_client_helo')) {
         $mailer->Helo = $helo;
       }
