public function SiteAuditCheckExtensionsUnrecommended::calculateScore in Site Audit 8.2
Same name and namespace in other branches
- 7 Check/Extensions/Unrecommended.php \SiteAuditCheckExtensionsUnrecommended::calculateScore()
Implements \SiteAudit\Check\Abstract\calculateScore().
Overrides SiteAuditCheckAbstract::calculateScore
File
- Check/
Extensions/ Unrecommended.php, line 87 - Contains \SiteAudit\Check\Extensions\Unrecommended.
Class
- SiteAuditCheckExtensionsUnrecommended
- Class SiteAuditCheckExtensionsUnrecommended.
Code
public function calculateScore() {
$this->registry['extensions_unrec'] = array();
$extension_info = $this->registry['extensions'];
uasort($extension_info, '_drush_pm_sort_extensions');
$unrecommended_extensions = $this
->getExtensions();
foreach ($extension_info as $extension) {
$row = array();
$machine_name = $extension
->getName();
// Not in the list of known unrecommended modules.
if (!array_key_exists($machine_name, $unrecommended_extensions)) {
continue;
}
// Name.
$row[] = $extension->label;
// Reason.
$row[] = $unrecommended_extensions[$machine_name];
$this->registry['extensions_unrec'][$machine_name] = $row;
}
if (!empty($this->registry['extensions_unrec'])) {
return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL;
}
return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS;
}