コード例 #1
0
 private function getImplicitComments(DifferentialRevision $revision, DifferentialDiff $diff)
 {
     $author_phid = nonempty($diff->getAuthorPHID(), $revision->getAuthorPHID());
     $template = new DifferentialComment();
     $template->setAuthorPHID($author_phid);
     $template->setRevisionID($revision->getID());
     $template->setDateCreated($revision->getDateCreated());
     $comments = array();
     if (strlen($revision->getSummary())) {
         $summary_comment = clone $template;
         $summary_comment->setContent($revision->getSummary());
         $summary_comment->setAction(DifferentialAction::ACTION_SUMMARIZE);
         $comments[] = $summary_comment;
     }
     if (strlen($revision->getTestPlan())) {
         $testplan_comment = clone $template;
         $testplan_comment->setContent($revision->getTestPlan());
         $testplan_comment->setAction(DifferentialAction::ACTION_TESTPLAN);
         $comments[] = $testplan_comment;
     }
     return $comments;
 }