<commit_before><?php

/**
 * @concrete-extensible
 */
class PhabricatorApplicationTransactionFeedStory
  extends PhabricatorFeedStory {

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

  public function getRequiredObjectPHIDs() {
    return array(
      $this->getPrimaryTransactionPHID(),
    );
  }

  public function getRequiredHandlePHIDs() {
    $phids = array();
    $phids[] = array($this->getValue('objectPHID'));
    $phids[] = $this->getPrimaryTransaction()->getRequiredHandlePHIDs();
    return array_mergev($phids);
  }

  protected function getPrimaryTransactionPHID() {
    return head($this->getValue('transactionPHIDs'));
  }

  protected function getPrimaryTransaction() {
    return $this->getObject($this->getPrimaryTransactionPHID());
  }

  public function renderView() {
    $view = $this->newStoryView();

    $handle = $this->getHandle($this->getPrimaryObjectPHID());
    $view->setHref($handle->getURI());

    $view->setAppIconFromPHID($handle->getPHID());

    $xaction_phids = $this->getValue('transactionPHIDs');
    $xaction = $this->getObject(head($xaction_phids));

    $xaction->setHandles($this->getHandles());
    $view->setTitle($xaction->getTitleForFeed($this));
    $body = $xaction->getBodyForFeed($this);
    if (nonempty($body)) {
      $view->appendChild($body);
    }

    $view->setImage(
      $this->getHandle(
        $this->getPrimaryTransaction()->getAuthorPHID())->getImageURI());

    return $view;
  }
<commit_msg>Select all available bodies when rendering a feed story<commit_after><?php

/**
 * @concrete-extensible
 */
class PhabricatorApplicationTransactionFeedStory
  extends PhabricatorFeedStory {

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

  public function getRequiredObjectPHIDs() {
    return $this->getValue('transactionPHIDs');
  }

  public function getRequiredHandlePHIDs() {
    $phids = array();
    $phids[] = $this->getValue('objectPHID');
    foreach ($this->getValue('transactionPHIDs') as $xaction_phid) {
      $xaction = $this->getObject($xaction_phid);
      foreach ($xaction->getRequiredHandlePHIDs() as $handle_phid) {
        $phids[] = $handle_phid;
      }
    }
    return $phids;
  }

  protected function getPrimaryTransactionPHID() {
    return head($this->getValue('transactionPHIDs'));
  }

  protected function getPrimaryTransaction() {
    return $this->getObject($this->getPrimaryTransactionPHID());
  }

  public function renderView() {
    $view = $this->newStoryView();

    $handle = $this->getHandle($this->getPrimaryObjectPHID());
    $view->setHref($handle->getURI());

    $view->setAppIconFromPHID($handle->getPHID());

    $xaction_phids = $this->getValue('transactionPHIDs');
    $xaction = $this->getPrimaryTransaction();

    $xaction->setHandles($this->getHandles());
    $view->setTitle($xaction->getTitleForFeed($this));

    foreach ($xaction_phids as $xaction_phid) {
      $secondary_xaction = $this->getObject($xaction_phid);
      $secondary_xaction->setHandles($this->getHandles());

      $body = $secondary_xaction->getBodyForFeed($this);
      if (nonempty($body)) {
        $view->appendChild($body);
      }
    }

    $view->setImage(
      $this->getHandle($xaction->getAuthorPHID())->getImageURI());

    return $view;
  }

{'fraction_non_alphanumeric': 0.16046790641871625, 'fraction_numerical': 0.0, 'mean_word_length': 4.310509554140127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 62, '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': '1222944', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1013, 'n_words': 149}