private function handleHovercardEvent($event)
 {
     $viewer = $event->getUser();
     $hovercard = $event->getValue('hovercard');
     $object_handle = $event->getValue('handle');
     $phid = $object_handle->getPHID();
     $rev = $event->getValue('object');
     if (!$rev instanceof DifferentialRevision) {
         return;
     }
     $rev->loadRelationships();
     $reviewer_phids = $rev->getReviewers();
     $e_task = DifferentialRevisionHasTaskEdgeType::EDGECONST;
     $edge_query = id(new PhabricatorEdgeQuery())->withSourcePHIDs(array($phid))->withEdgeTypes(array($e_task));
     $edge_query->execute();
     $tasks = $edge_query->getDestinationPHIDs();
     $hovercard->setTitle('D' . $rev->getID());
     $hovercard->setDetail($rev->getTitle());
     $hovercard->addField(pht('Author'), $viewer->renderHandle($rev->getAuthorPHID()));
     $hovercard->addField(pht('Reviewers'), $viewer->renderHandleList($reviewer_phids)->setAsInline(true));
     if ($tasks) {
         $hovercard->addField(pht('Tasks'), $viewer->renderHandleList($tasks)->setAsInline(true));
     }
     if ($rev->getSummary()) {
         $hovercard->addField(pht('Summary'), id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(120)->truncateString($rev->getSummary()));
     }
     $hovercard->addTag(DifferentialRevisionDetailView::renderTagForRevision($rev));
     $event->setValue('hovercard', $hovercard);
 }
 private function handleHovercardEvent($event)
 {
     $viewer = $event->getUser();
     $hovercard = $event->getValue('hovercard');
     $object_handle = $event->getValue('handle');
     $phid = $object_handle->getPHID();
     $rev = $event->getValue('object');
     if (!$rev instanceof DifferentialRevision) {
         return;
     }
     $rev->loadRelationships();
     $reviewer_phids = $rev->getReviewers();
     $e_task = DifferentialRevisionHasTaskEdgeType::EDGECONST;
     $edge_query = id(new PhabricatorEdgeQuery())->withSourcePHIDs(array($phid))->withEdgeTypes(array($e_task));
     $edge_query->execute();
     $tasks = $edge_query->getDestinationPHIDs();
     $phids = array_merge(array($rev->getAuthorPHID()), $reviewer_phids, $tasks);
     $handles = id(new PhabricatorHandleQuery())->setViewer($viewer)->withPHIDs($phids)->execute();
     $hovercard->setTitle('D' . $rev->getID());
     $hovercard->setDetail($rev->getTitle());
     $hovercard->addField(pht('Author'), $handles[$rev->getAuthorPHID()]->renderLink());
     $hovercard->addField(pht('Date'), phabricator_datetime($rev->getDateModified(), $viewer));
     $hovercard->addField(pht('Reviewers'), implode_selected_handle_links(', ', $handles, $reviewer_phids));
     if ($tasks) {
         $hovercard->addField(pht('Task(s)', count($tasks)), implode_selected_handle_links(', ', $handles, $tasks));
     }
     if ($rev->getSummary()) {
         $hovercard->addField(pht('Summary'), id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(120)->truncateString($rev->getSummary()));
     }
     $hovercard->addTag(DifferentialRevisionDetailView::renderTagForRevision($rev));
     $event->setValue('hovercard', $hovercard);
 }
 public function renderHovercard(PhabricatorHovercardView $hovercard, PhabricatorObjectHandle $handle, $object, $data)
 {
     $viewer = $this->getViewer();
     $revision = idx($data['revisions'], $object->getPHID());
     if (!$revision) {
         return;
     }
     $hovercard->setTitle('D' . $revision->getID());
     $hovercard->setDetail($revision->getTitle());
     $hovercard->addField(pht('Author'), $viewer->renderHandle($revision->getAuthorPHID()));
     $reviewer_phids = $revision->getReviewerStatus();
     $reviewer_phids = mpull($reviewer_phids, 'getReviewerPHID');
     $hovercard->addField(pht('Reviewers'), $viewer->renderHandleList($reviewer_phids)->setAsInline(true));
     $summary = $revision->getSummary();
     if (strlen($summary)) {
         $summary = id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(120)->truncateString($summary);
         $hovercard->addField(pht('Summary'), $summary);
     }
     $tag = DifferentialRevisionDetailView::renderTagForRevision($revision);
     $hovercard->addTag($tag);
 }