TASK: Fix scurtinizer issues

This commit is contained in:
Daniel Siepmann 2018-03-06 17:58:19 +01:00
parent 560597dcff
commit 8d930448e0
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
5 changed files with 14 additions and 9 deletions

View file

@ -38,6 +38,9 @@ interface SearchRequestInterface extends QueryInterface
public function setFilter(array $filter); public function setFilter(array $filter);
/**
* @return void
*/
public function addFacet(FacetRequestInterface $facet); public function addFacet(FacetRequestInterface $facet);
/** /**
@ -48,12 +51,16 @@ interface SearchRequestInterface extends QueryInterface
/** /**
* Workaround for paginate widget support which will * Workaround for paginate widget support which will
* use the request to build another search. * use the request to build another search.
*
* @return void
*/ */
public function setConnection(ConnectionInterface $connection); public function setConnection(ConnectionInterface $connection);
/** /**
* Workaround for paginate widget support which will * Workaround for paginate widget support which will
* use the request to build another search. * use the request to build another search.
*
* @return void
*/ */
public function setSearchService(SearchService $searchService); public function setSearchService(SearchService $searchService);
} }

View file

@ -27,7 +27,7 @@ class GeoPointProcessor implements ProcessorInterface
{ {
public function processData(array $record, array $configuration) : array public function processData(array $record, array $configuration) : array
{ {
if (! $this->canApply($record, $configuration)) { if (! $this->isApplyable($record, $configuration)) {
return $record; return $record;
} }
@ -39,7 +39,7 @@ class GeoPointProcessor implements ProcessorInterface
return $record; return $record;
} }
protected function canApply(array $record, array $configuration) : bool protected function isApplyable(array $record, array $configuration) : bool
{ {
if (!isset($record[$configuration['lat']]) if (!isset($record[$configuration['lat']])
|| !is_numeric($record[$configuration['lat']]) || !is_numeric($record[$configuration['lat']])

View file

@ -152,7 +152,7 @@ abstract class AbstractIndexer implements IndexerInterface
',', ',',
$this->configuration->get('indexing.' . $this->identifier . '.abstractFields') $this->configuration->get('indexing.' . $this->identifier . '.abstractFields')
); );
if (!$fieldsToUse) { if ($fieldsToUse === []) {
return; return;
} }
foreach ($fieldsToUse as $fieldToUse) { foreach ($fieldsToUse as $fieldToUse) {

View file

@ -104,7 +104,7 @@ class DataHandler implements Singleton
return $this->indexerFactory->getIndexer($table); return $this->indexerFactory->getIndexer($table);
} }
public function canHandle(string $table) : bool public function supportsTable(string $table) : bool
{ {
try { try {
$this->getIndexer($table); $this->getIndexer($table);
@ -112,7 +112,5 @@ class DataHandler implements Singleton
} catch (NoMatchingIndexerException $e) { } catch (NoMatchingIndexerException $e) {
return false; return false;
} }
return false;
} }
} }

View file

@ -90,8 +90,8 @@ class DataHandler implements Singleton
$uid = key($record); $uid = key($record);
$fieldData = current($record); $fieldData = current($record);
if (isset($fieldArray['uid'])) { if (isset($fieldData['uid'])) {
$uid = $fieldArray['uid']; $uid = $fieldData['uid'];
} elseif (isset($dataHandler->substNEWwithIDs[$uid])) { } elseif (isset($dataHandler->substNEWwithIDs[$uid])) {
$uid = $dataHandler->substNEWwithIDs[$uid]; $uid = $dataHandler->substNEWwithIDs[$uid];
} }
@ -123,7 +123,7 @@ class DataHandler implements Singleton
$this->logger->debug('Datahandler could not be setup.'); $this->logger->debug('Datahandler could not be setup.');
return false; return false;
} }
if (! $this->dataHandler->canHandle($table)) { if (! $this->dataHandler->supportsTable($table)) {
$this->logger->debug('Table is not allowed.', [$table]); $this->logger->debug('Table is not allowed.', [$table]);
return false; return false;
} }