From 7ca998c03abeb812f6cd0a89ae1fec6cdc1de103 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 24 Oct 2017 14:06:56 +0200 Subject: [PATCH] TASK: Fix PR issues --- Classes/DataProcessing/CopyToProcessor.php | 2 +- Classes/Domain/Index/IndexerFactory.php | 2 -- Classes/Domain/Index/TcaIndexer/PagesIndexer.php | 10 ++++++---- Classes/Domain/Index/TcaIndexer/RelationResolver.php | 2 +- Classes/Domain/Search/QueryFactory.php | 1 - Classes/Domain/Service/DataHandler.php | 1 - Classes/Hook/DataHandler.php | 1 - 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Classes/DataProcessing/CopyToProcessor.php b/Classes/DataProcessing/CopyToProcessor.php index bac60d0..e9eb8cf 100644 --- a/Classes/DataProcessing/CopyToProcessor.php +++ b/Classes/DataProcessing/CopyToProcessor.php @@ -44,7 +44,7 @@ class CopyToProcessor implements ProcessorInterface { foreach ($from as $property => $value) { if (is_array($value)) { - $this->addArray($to, $value, $exclude); + $this->addArray($to, $value); continue; } diff --git a/Classes/Domain/Index/IndexerFactory.php b/Classes/Domain/Index/IndexerFactory.php index dbae818..e228780 100644 --- a/Classes/Domain/Index/IndexerFactory.php +++ b/Classes/Domain/Index/IndexerFactory.php @@ -22,8 +22,6 @@ namespace Codappix\SearchCore\Domain\Index; use Codappix\SearchCore\Configuration\ConfigurationContainerInterface; use Codappix\SearchCore\Configuration\InvalidArgumentException; -use Codappix\SearchCore\Domain\Index\IndexerInterface; -use Codappix\SearchCore\Domain\Index\TcaIndexer; use Codappix\SearchCore\Domain\Index\TcaIndexer\TcaTableService; use TYPO3\CMS\Core\SingletonInterface as Singleton; use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; diff --git a/Classes/Domain/Index/TcaIndexer/PagesIndexer.php b/Classes/Domain/Index/TcaIndexer/PagesIndexer.php index ebf2b49..558af09 100644 --- a/Classes/Domain/Index/TcaIndexer/PagesIndexer.php +++ b/Classes/Domain/Index/TcaIndexer/PagesIndexer.php @@ -72,14 +72,16 @@ class PagesIndexer extends TcaIndexer } $content = $this->fetchContentForPage($record['uid']); - $record['content'] = $content['content']; - $record['media'] = array_unique(array_merge($record['media'], $content['images'])); + if ($content !== []) { + $record['content'] = $content['content']; + $record['media'] = array_unique(array_merge($record['media'], $content['images'])); + } parent::prepareRecord($record); } /** * @param int $uid - * @return string + * @return [] */ protected function fetchContentForPage($uid) { @@ -92,7 +94,7 @@ class PagesIndexer extends TcaIndexer if ($contentElements === null) { $this->logger->debug('No content for page ' . $uid); - return ''; + return []; } $this->logger->debug('Fetched content for page ' . $uid); diff --git a/Classes/Domain/Index/TcaIndexer/RelationResolver.php b/Classes/Domain/Index/TcaIndexer/RelationResolver.php index 42dafc1..9b4fcf8 100644 --- a/Classes/Domain/Index/TcaIndexer/RelationResolver.php +++ b/Classes/Domain/Index/TcaIndexer/RelationResolver.php @@ -117,7 +117,7 @@ class RelationResolver implements Singleton } /** - * @param array Column config. + * @param array $config Column config. * @return bool */ protected function isRelation(array &$config) diff --git a/Classes/Domain/Search/QueryFactory.php b/Classes/Domain/Search/QueryFactory.php index b30fcbf..c4b66c9 100644 --- a/Classes/Domain/Search/QueryFactory.php +++ b/Classes/Domain/Search/QueryFactory.php @@ -22,7 +22,6 @@ namespace Codappix\SearchCore\Domain\Search; use Codappix\SearchCore\Configuration\ConfigurationContainerInterface; use Codappix\SearchCore\Configuration\InvalidArgumentException; -use Codappix\SearchCore\Connection\ConnectionInterface; use Codappix\SearchCore\Connection\Elasticsearch\Query; use Codappix\SearchCore\Connection\SearchRequestInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Domain/Service/DataHandler.php b/Classes/Domain/Service/DataHandler.php index 6ac8069..4b0386e 100644 --- a/Classes/Domain/Service/DataHandler.php +++ b/Classes/Domain/Service/DataHandler.php @@ -23,7 +23,6 @@ namespace Codappix\SearchCore\Domain\Service; use Codappix\SearchCore\Configuration\ConfigurationContainerInterface; use Codappix\SearchCore\Domain\Index\IndexerFactory; use Codappix\SearchCore\Domain\Index\NoMatchingIndexerException; -use Codappix\SearchCore\Domain\Index\TcaIndexer; use TYPO3\CMS\Core\SingletonInterface as Singleton; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Hook/DataHandler.php b/Classes/Hook/DataHandler.php index d0eb1ba..3c4902a 100644 --- a/Classes/Hook/DataHandler.php +++ b/Classes/Hook/DataHandler.php @@ -21,7 +21,6 @@ namespace Codappix\SearchCore\Hook; */ use Codappix\SearchCore\Configuration\NoConfigurationException; -use Codappix\SearchCore\Domain\Index\NoMatchingIndexerException; use Codappix\SearchCore\Domain\Service\DataHandler as OwnDataHandler; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\DataHandling\DataHandler as CoreDataHandler;