diff --git a/src/FeedImportHandler.php b/src/FeedImportHandler.php index 43b161cf..0a74f8ac 100644 --- a/src/FeedImportHandler.php +++ b/src/FeedImportHandler.php @@ -78,8 +78,8 @@ class FeedImportHandler extends FeedHandlerBase { $this->getExecutable(FeedsQueueExecutable::class) ->processItem($feed, FeedsQueueExecutable::PARSE, [ - 'fetcher_result' => $fetcher_result, - ]); + 'fetcher_result' => $fetcher_result, + ]); } /** diff --git a/src/FeedsExecutable.php b/src/FeedsExecutable.php index c02f979e..4be1b1c5 100644 --- a/src/FeedsExecutable.php +++ b/src/FeedsExecutable.php @@ -165,8 +165,8 @@ class FeedsExecutable implements FeedsExecutableInterface, ContainerInjectionInt protected function handleException(FeedInterface $feed, Exception $exception) { $feed->finishImport(); - if (!$exception instanceof EmptyFeedException) { - throw $exception; + if ($exception instanceof EmptyFeedException) { + return; } if ($exception instanceof RuntimeException) { // @todo not for queue. diff --git a/tests/src/Unit/FeedImportHandlerTest.php b/tests/src/Unit/FeedImportHandlerTest.php index a1c0c7b4..f298d2de 100644 --- a/tests/src/Unit/FeedImportHandlerTest.php +++ b/tests/src/Unit/FeedImportHandlerTest.php @@ -3,16 +3,9 @@ namespace Drupal\Tests\feeds\Unit; use Drupal\Core\File\FileSystemInterface; -use Drupal\feeds\Event\FeedsEvents; -use Drupal\feeds\Event\FetchEvent; -use Drupal\feeds\Event\ParseEvent; -use Drupal\feeds\Event\ProcessEvent; use Drupal\feeds\FeedInterface; use Drupal\feeds\FeedImportHandler; use Drupal\feeds\FeedsExecutableInterface; -use Drupal\feeds\Feeds\Item\ItemInterface; -use Drupal\feeds\Result\FetcherResultInterface; -use Drupal\feeds\Result\ParserResultInterface; use Symfony\Component\EventDispatcher\EventDispatcher; /** diff --git a/tests/src/Unit/FeedsExecutableTest.php b/tests/src/Unit/FeedsExecutableTest.php index bf4a6e09..3bed95d8 100644 --- a/tests/src/Unit/FeedsExecutableTest.php +++ b/tests/src/Unit/FeedsExecutableTest.php @@ -10,7 +10,6 @@ use Drupal\feeds\Event\FetchEvent; use Drupal\feeds\Event\ParseEvent; use Drupal\feeds\Event\ProcessEvent; use Drupal\feeds\FeedInterface; -use Drupal\feeds\FeedImportHandler; use Drupal\feeds\Feeds\Item\ItemInterface; use Drupal\feeds\Result\FetcherResultInterface; use Drupal\feeds\Result\ParserResult; diff --git a/tests/src/Unit/Plugin/QueueWorker/FeedRefreshTest.php b/tests/src/Unit/Plugin/QueueWorker/FeedRefreshTest.php index 21b8e078..537a459f 100644 --- a/tests/src/Unit/Plugin/QueueWorker/FeedRefreshTest.php +++ b/tests/src/Unit/Plugin/QueueWorker/FeedRefreshTest.php @@ -92,7 +92,11 @@ class FeedRefreshTest extends FeedsUnitTestCase { */ public function testBeginStage() { $this->plugin->processItem(NULL); - $this->plugin->processItem([$this->feed, FeedsExecutableInterface::BEGIN, []]); + $this->plugin->processItem([ + $this->feed, + FeedsExecutableInterface::BEGIN, + [], + ]); } /** @@ -102,7 +106,11 @@ class FeedRefreshTest extends FeedsUnitTestCase { $this->feed->expects($this->once()) ->method('lock') ->will($this->throwException(new LockException())); - $this->plugin->processItem([$this->feed, FeedsExecutableInterface::BEGIN, []]); + $this->plugin->processItem([ + $this->feed, + FeedsExecutableInterface::BEGIN, + [], + ]); } /** @@ -114,7 +122,11 @@ class FeedRefreshTest extends FeedsUnitTestCase { }); $this->setExpectedException(\RuntimeException::class); - $this->plugin->processItem([$this->feed, FeedsExecutableInterface::FETCH, []]); + $this->plugin->processItem([ + $this->feed, + FeedsExecutableInterface::FETCH, + [], + ]); } /**