You are here

public function SiteAuditCheckAbstract::getOptions in Site Audit 8.2

Returns the values of the valid options for a command.

This function is used by the codebase report where it needs to get the value of options for different tools it uses. The function takes an array of valid options to check and a prefix for those options.

Parameters

array $options: An array containing the options to be checked and their default values.

string $option_prefix: Prefix for the options.

Return value

array An associative array containing the value of the options indexed by option name.

5 calls to SiteAuditCheckAbstract::getOptions()
SiteAuditCheckCodebasePhpCodeSniffer::calculateScore in Check/Codebase/PhpCodeSniffer.php
Implements \SiteAudit\Check\Abstract\calculateScore().
SiteAuditCheckCodebasePhpCopyPasteDetection::calculateScore in Check/Codebase/PhpCopyPasteDetection.php
Implements \SiteAudit\Check\Abstract\calculateScore().
SiteAuditCheckCodebasePhpDeadCodeDetection::calculateScore in Check/Codebase/PhpDeadCodeDetection.php
Implements \SiteAudit\Check\Abstract\calculateScore().
SiteAuditCheckCodebasePhpLOC::calculateScore in Check/Codebase/PhpLOC.php
Implements \SiteAudit\Check\Abstract\calculateScore().
SiteAuditCheckCodebasePhpMessDetection::calculateScore in Check/Codebase/PhpMessDetection.php
Implements \SiteAudit\Check\Abstract\calculateScore().

File

Check/Abstract.php, line 305
Contains \SiteAudit\Check\Abstract.

Class

SiteAuditCheckAbstract
Class SiteAuditCheckAbstract.

Code

public function getOptions(array $options, $option_prefix) {
  $values = array();
  foreach ($options as $option => $default) {
    $value = drush_get_option($option_prefix . $option, $default);
    if ($value !== NULL) {
      $values[$option] = $value;
    }
  }
  return $values;
}