You are here

public function ExecutablePhp::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/ExecutablePhp.php, line 209

Class

ExecutablePhp
Checks if PHP files written to the files directory can be executed.

Namespace

Drupal\security_review\Checks

Code

public function getMessage($result_const) {
  switch ($result_const) {
    case CheckResult::SUCCESS:
      return $this
        ->t('PHP files in the Drupal files directory cannot be executed.');
    case CheckResult::FAIL:
      return $this
        ->t('PHP files in the Drupal files directory can be executed.');
    case CheckResult::WARN:
      return $this
        ->t('The .htaccess file in the files directory is writable.');
    default:
      return $this
        ->t('Unexpected result.');
  }
}