/** * Get consistency errors * @param CommandSet $cmdset * @return mixed[] */ private function getConsistencyErrors(CommandSet $cmdset) { $consistencyErrors = array(); // if null, array_merge fails ! $cerrList = $cmdset->getConsistencyErrors(); if (count($cerrList) > 0) { foreach ($cerrList as $cerr) { if (!is_null($cerr->userId)) { $user = UserCache::getInstance()->getUser($cerr->userId); } else { $user = NULL; } if (Issue::exists($cerr->bugId)) { $issue = IssueCache::getInstance()->getIssue($cerr->bugId); $projName = $issue->getProjectName(); $summary = $issue->getSummary(); } else { $projName = ''; $summary = ''; } $titleAttr = array(T_('Project') => $projName, T_('Summary') => $summary); $consistencyErrors[] = array('issueURL' => Tools::issueInfoURL($cerr->bugId, $titleAttr), 'issueStatus' => Constants::$statusNames[$cerr->status], 'user' => isset($user) ? $user->getName() : '', 'severity' => $cerr->getLiteralSeverity(), 'severityColor' => $cerr->getSeverityColor(), 'desc' => $cerr->desc); } } return $consistencyErrors; }