You are here

public function TrustedHosts::getMessage in Security Review 8

Converts a result integer to a human-readable result message.

Parameters

int $result_const: The result integer.

Return value

string The human-readable result message.

Overrides Check::getMessage

File

src/Checks/TrustedHosts.php, line 154

Class

TrustedHosts
Checks for base_url and trusted_host_patterns settings in settings.php.

Namespace

Drupal\security_review\Checks

Code

public function getMessage($result_const) {
  switch ($result_const) {
    case CheckResult::SUCCESS:
      return $this
        ->t('Either $base_url or trusted_host_patterns is set.');
    case CheckResult::FAIL:
      return $this
        ->t('Neither $base_url nor trusted_host_patterns is set.');
    default:
      return $this
        ->t('Unexpected result.');
  }
}