You are here

public function SiteAuditCheckRolesRolesPermissions::getResultInfo in Site Audit 7

Implements \SiteAudit\Check\Abstract\getResultInfo().

Overrides SiteAuditCheckAbstract::getResultInfo

File

Check/Roles/RolesPermissions.php, line 34
Contains \SiteAudit\Check\Users\RolesPermissions.

Class

SiteAuditCheckRolesRolesPermissions
Class SiteAuditCheckRolesRolesPermissions.

Code

public function getResultInfo() {
  $roles = array();
  $total = array_sum($this->registry['roles']);
  foreach ($this->registry['roles'] as $name => $count_permissions) {
    $percentage = number_format($count_permissions / $total * 100, 0);
    $roles[] = "{$name}: {$count_permissions} ({$percentage}%)";
  }
  return implode(', ', $roles);
}