<commit_before><?php
namespace SandersForPresident\Wordpress\Services\News;

use SandersForPresident\Wordpress\Models\News\LocalNewsArticle;

class NewsFeedService {
  private $remoteNewsFeedService;

  public function __construct() {
    $this->remoteNewsFeedService = new RemoteNewsFeedService();
  }

  /**
   * Fetches the local news feed.
   * Note: currently MUST utilize The Loop
   */
  private function getLocalNewsFeed() {
    global $post;
    $articles = array();
    while (have_posts()) {
      the_post();
      $articles[] = new LocalNewsArticle($post);
    }
    return $articles;
  }

  /**
   * Merges the remote and local news feed articles into a chronological series
   */
  public function getNewsFeed() {
    $remoteNewsFeed = $this->remoteNewsFeedService->getFeed();
    $localNewsFeed = $this->getLocalNewsFeed();
    $aggregatedNews = array_merge($remoteNewsFeed, $localNewsFeed);
    usort($aggregatedNews, array(self, 'aggregateNewsSort'));
    return $aggregatedNews;
  }<commit_msg>fixes news feed error "Use of undefined constant self - assumed 'self'"<commit_after><?php
namespace SandersForPresident\Wordpress\Services\News;

use SandersForPresident\Wordpress\Models\News\LocalNewsArticle;

class NewsFeedService {
  private $remoteNewsFeedService;

  public function __construct() {
    $this->remoteNewsFeedService = new RemoteNewsFeedService();
  }

  /**
   * Fetches the local news feed.
   * Note: currently MUST utilize The Loop
   */
  private function getLocalNewsFeed() {
    global $post;
    $articles = array();
    while (have_posts()) {
      the_post();
      $articles[] = new LocalNewsArticle($post);
    }
    return $articles;
  }

  /**
   * Merges the remote and local news feed articles into a chronological series
   */
  public function getNewsFeed() {
    $remoteNewsFeed = $this->remoteNewsFeedService->getFeed();
    $localNewsFeed = $this->getLocalNewsFeed();
    $aggregatedNews = array_merge($remoteNewsFeed, $localNewsFeed);
    usort($aggregatedNews, array(__CLASS__, 'aggregateNewsSort'));
    return $aggregatedNews;
  }
{'fraction_non_alphanumeric': 0.11249401627573001, 'fraction_numerical': 0.0, 'mean_word_length': 4.085158150851582, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '7367892', 'n_tokens_mistral': 628, 'n_tokens_neox': 594, 'n_words': 146}