Skip to content

Commit

Permalink
Merge branch 'release/3.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed Jul 10, 2021
2 parents 80858ff + f4c6b9a commit 671d6c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions classes/RssFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace Vdlp\RssFetcher\Classes;

use Carbon\Carbon;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Collection;
use Laminas\Feed\Reader\Entry\EntryInterface;
use Laminas\Feed\Reader\Entry\Rss;
use Laminas\Feed\Reader\Feed\FeedInterface;
use Laminas\Feed\Reader\Reader;
use October\Rain\Support\Facades\Event;
use October\Rain\Support\Traits\Singleton;
use Psr\Log\LoggerInterface;
use stdClass;
Expand All @@ -23,10 +23,12 @@ final class RssFetcher
use Singleton;

private LoggerInterface $log;
private Dispatcher $dispatcher;

protected function init(): void
{
$this->log = resolve(LoggerInterface::class);
$this->dispatcher = resolve(Dispatcher::class);
}

public function fetch(?int $sourceId = null): void
Expand Down Expand Up @@ -56,13 +58,13 @@ private function fetchSource(Source $source): void
$dateCreated = $item->getDateCreated();

$title = $item->getTitle();
Event::dispatch('vdlp.rssfetcher.item.processTitle', [&$title]);
$this->dispatcher->dispatch('vdlp.rssfetcher.item.processTitle', [&$title]);

$content = $item->getContent();
Event::dispatch('vdlp.rssfetcher.item.processContent', [&$content]);
$this->dispatcher->dispatch('vdlp.rssfetcher.item.processContent', [&$content]);

$link = $item->getLink();
Event::dispatch('vdlp.rssfetcher.item.processLink', [&$link]);
$this->dispatcher->dispatch('vdlp.rssfetcher.item.processLink', [&$link]);

$attributes = [
'item_id' => $item->getId(),
Expand Down
1 change: 1 addition & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
3.0.0: Drop support for PHP 7.4 (minimum required PHP version 7.4)
3.0.1: "Fix type in Sources component (Sources::$sources)"
3.0.2: "Fix type in Items component (Items::$items)"
3.0.3: "Replace the use of Event facade with Event dispatcher"

0 comments on commit 671d6c7

Please sign in to comment.