mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-24 05:36:10 +01:00
TASK: Fix scurtinizer issues
This commit is contained in:
parent
560597dcff
commit
8d930448e0
5 changed files with 14 additions and 9 deletions
|
@ -38,6 +38,9 @@ interface SearchRequestInterface extends QueryInterface
|
|||
|
||||
public function setFilter(array $filter);
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function addFacet(FacetRequestInterface $facet);
|
||||
|
||||
/**
|
||||
|
@ -48,12 +51,16 @@ interface SearchRequestInterface extends QueryInterface
|
|||
/**
|
||||
* Workaround for paginate widget support which will
|
||||
* use the request to build another search.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setConnection(ConnectionInterface $connection);
|
||||
|
||||
/**
|
||||
* Workaround for paginate widget support which will
|
||||
* use the request to build another search.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSearchService(SearchService $searchService);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ class GeoPointProcessor implements ProcessorInterface
|
|||
{
|
||||
public function processData(array $record, array $configuration) : array
|
||||
{
|
||||
if (! $this->canApply($record, $configuration)) {
|
||||
if (! $this->isApplyable($record, $configuration)) {
|
||||
return $record;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ class GeoPointProcessor implements ProcessorInterface
|
|||
return $record;
|
||||
}
|
||||
|
||||
protected function canApply(array $record, array $configuration) : bool
|
||||
protected function isApplyable(array $record, array $configuration) : bool
|
||||
{
|
||||
if (!isset($record[$configuration['lat']])
|
||||
|| !is_numeric($record[$configuration['lat']])
|
||||
|
|
|
@ -152,7 +152,7 @@ abstract class AbstractIndexer implements IndexerInterface
|
|||
',',
|
||||
$this->configuration->get('indexing.' . $this->identifier . '.abstractFields')
|
||||
);
|
||||
if (!$fieldsToUse) {
|
||||
if ($fieldsToUse === []) {
|
||||
return;
|
||||
}
|
||||
foreach ($fieldsToUse as $fieldToUse) {
|
||||
|
|
|
@ -104,7 +104,7 @@ class DataHandler implements Singleton
|
|||
return $this->indexerFactory->getIndexer($table);
|
||||
}
|
||||
|
||||
public function canHandle(string $table) : bool
|
||||
public function supportsTable(string $table) : bool
|
||||
{
|
||||
try {
|
||||
$this->getIndexer($table);
|
||||
|
@ -112,7 +112,5 @@ class DataHandler implements Singleton
|
|||
} catch (NoMatchingIndexerException $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,8 +90,8 @@ class DataHandler implements Singleton
|
|||
$uid = key($record);
|
||||
$fieldData = current($record);
|
||||
|
||||
if (isset($fieldArray['uid'])) {
|
||||
$uid = $fieldArray['uid'];
|
||||
if (isset($fieldData['uid'])) {
|
||||
$uid = $fieldData['uid'];
|
||||
} elseif (isset($dataHandler->substNEWwithIDs[$uid])) {
|
||||
$uid = $dataHandler->substNEWwithIDs[$uid];
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ class DataHandler implements Singleton
|
|||
$this->logger->debug('Datahandler could not be setup.');
|
||||
return false;
|
||||
}
|
||||
if (! $this->dataHandler->canHandle($table)) {
|
||||
if (! $this->dataHandler->supportsTable($table)) {
|
||||
$this->logger->debug('Table is not allowed.', [$table]);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue