withAuditorPHIDs($phids) ->withStatus(PhabricatorAuditQuery::STATUS_OPEN) ->withAwaitingUser($user) ->execute(); $count = count($audits); $type = $count ? PhabricatorApplicationStatusView::TYPE_INFO : PhabricatorApplicationStatusView::TYPE_EMPTY; $status[] = id(new PhabricatorApplicationStatusView()) ->setType($type) ->setText(pht('%d Commit(s) Awaiting Audit', $count)) ->setCount($count); $commits = id(new PhabricatorAuditCommitQuery()) ->withAuthorPHIDs($phids) ->withStatus(PhabricatorAuditQuery::STATUS_OPEN) ->execute(); $count = count($commits); $type = $count ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION : PhabricatorApplicationStatusView::TYPE_EMPTY; $status[] = id(new PhabricatorApplicationStatusView()) ->setType($type) ->setText(pht('%d Problem Commit(s)', $count)) ->setCount($count); return $status; } }