TASK: Cleanup code

Use get and use an try catch. Receiving null through ifExists will
result in an php error.
This commit is contained in:
Daniel Siepmann 2017-07-27 13:00:51 +02:00
parent 7722c37ea5
commit 334bb34625
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -21,6 +21,7 @@ namespace Codappix\SearchCore\Domain\Index;
*/
use Codappix\SearchCore\Configuration\ConfigurationContainerInterface;
use Codappix\SearchCore\Configuration\InvalidArgumentException;
use Codappix\SearchCore\Connection\ConnectionInterface;
use \TYPO3\CMS\Core\Utility\GeneralUtility;
@ -125,9 +126,10 @@ abstract class AbstractIndexer implements IndexerInterface
{
$record['search_abstract'] = '';
try {
$fieldsToUse = GeneralUtility::trimExplode(
',',
$this->configuration->getIfExists('indexing.' . $this->identifier . '.abstractFields')
$this->configuration->get('indexing.' . $this->identifier . '.abstractFields')
);
if (!$fieldsToUse) {
return;
@ -138,6 +140,9 @@ abstract class AbstractIndexer implements IndexerInterface
break;
}
}
} catch (InvalidArgumentException $e) {
return;
}
}
/**