<commit_before><?php

final class PhabricatorFeedStoryDifferential extends PhabricatorFeedStory {

  public function getPrimaryObjectPHID() {
    return $this->getValue('revision_phid');
  }

  public function renderView() {
    $data = $this->getStoryData();

    $view = $this->newStoryView();
    $view->setAppIcon('differential-dark');

    $line = $this->getLineForData($data);
    $view->setTitle($line);

    $href = $this->getHandle($data->getValue('revision_phid'))->getURI();
    $view->setHref($href);

    $action = $data->getValue('action');

    switch ($action) {
      case DifferentialAction::ACTION_CREATE:
      case DifferentialAction::ACTION_CLOSE:
        $full_size = true;
        break;
      default:
        $full_size = false;
        break;
    }

    $view->setImage($this->getHandle($data->getAuthorPHID())->getImageURI());
    if ($full_size) {
      $content = $this->renderSummary($data->getValue('feedback_content'));
      $view->appendChild($content);
    }

    return $view;
  }

  private function getLineForData($data) {
    $actor_phid = $data->getAuthorPHID();
    $revision_phid = $data->getValue('revision_phid');
    $action = $data->getValue('action');

    $actor_link = $this->linkTo($actor_phid);
    $revision_link = $this->linkTo($revision_phid);

    $verb = DifferentialAction::getActionPastTenseVerb($action);

    $one_line = hsprintf(
      '%s %s revision %s',
      $actor_link,<commit_msg>Add differential comments to feed.<commit_after><?php

final class PhabricatorFeedStoryDifferential extends PhabricatorFeedStory {

  public function getPrimaryObjectPHID() {
    return $this->getValue('revision_phid');
  }

  public function renderView() {
    $data = $this->getStoryData();

    $view = $this->newStoryView();
    $view->setAppIcon('differential-dark');

    $line = $this->getLineForData($data);
    $view->setTitle($line);

    $href = $this->getHandle($data->getValue('revision_phid'))->getURI();
    $view->setHref($href);

    $action = $data->getValue('action');

    switch ($action) {
      case DifferentialAction::ACTION_CREATE:
      case DifferentialAction::ACTION_CLOSE:
      case DifferentialAction::ACTION_COMMENT:
        $full_size = true;
        break;
      default:
        $full_size = false;
        break;
    }

    $view->setImage($this->getHandle($data->getAuthorPHID())->getImageURI());
    if ($full_size) {
      $content = $this->renderSummary($data->getValue('feedback_content'));
      $view->appendChild($content);
    }

    return $view;
  }

  private function getLineForData($data) {
    $actor_phid = $data->getAuthorPHID();
    $revision_phid = $data->getValue('revision_phid');
    $action = $data->getValue('action');

    $actor_link = $this->linkTo($actor_phid);
    $revision_link = $this->linkTo($revision_phid);

    $verb = DifferentialAction::getActionPastTenseVerb($action);

    $one_line = hsprintf(
      '%s %s revision %s',
      $actor_link,
{'fraction_non_alphanumeric': 0.16115981119352663, 'fraction_numerical': 0.0, 'mean_word_length': 3.770096463022508, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4669556', 'n_tokens_mistral': 980, 'n_tokens_neox': 929, 'n_words': 145}