TASK: Use a single array utility

Instead of only adding a new class for one static method, we extend the
existing class to only import a single class.

This way we extend the original array utility function collection.
This commit is contained in:
Daniel Siepmann 2018-12-30 14:00:22 +01:00
parent 689f293194
commit 7f2249e3ff
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
6 changed files with 9 additions and 8 deletions

View file

@ -21,7 +21,7 @@ namespace Codappix\SearchCore\Configuration;
* 02110-1301, USA.
*/
use TYPO3\CMS\Core\Utility\ArrayUtility;
use Codappix\SearchCore\Utility\ArrayUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
/**

View file

@ -26,8 +26,7 @@ use Codappix\SearchCore\Connection\FacetRequestInterface;
use Codappix\SearchCore\Connection\SearchRequestInterface;
use Codappix\SearchCore\Connection\SearchResultInterface;
use Codappix\SearchCore\Domain\Search\SearchServiceInterface;
use Codappix\SearchCore\Utility\ArrayUtility as CustomArrayUtility;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use Codappix\SearchCore\Utility\ArrayUtility;
/**
* Represents a search request used to process an actual search.
@ -99,7 +98,7 @@ class SearchRequest implements SearchRequestInterface
public function setFilter(array $filter)
{
$filter = ArrayUtility::removeArrayEntryByValue($filter, '');
$this->filter = CustomArrayUtility::removeEmptyElementsRecursively($filter);
$this->filter = ArrayUtility::removeEmptyElementsRecursively($filter);
}
public function hasFilter(): bool

View file

@ -25,7 +25,7 @@ use Codappix\SearchCore\Configuration\ConfigurationContainerInterface;
use Codappix\SearchCore\Configuration\ConfigurationUtility;
use Codappix\SearchCore\Configuration\InvalidArgumentException;
use Codappix\SearchCore\Connection\SearchRequestInterface;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use Codappix\SearchCore\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;

View file

@ -29,7 +29,7 @@ use Codappix\SearchCore\Connection\SearchResultInterface;
use Codappix\SearchCore\DataProcessing\Service as DataProcessorService;
use Codappix\SearchCore\Domain\Model\FacetRequest;
use Codappix\SearchCore\Domain\Model\SearchResult;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use Codappix\SearchCore\Utility\ArrayUtility;
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
/**

View file

@ -21,7 +21,9 @@ namespace Codappix\SearchCore\Utility;
* 02110-1301, USA.
*/
class ArrayUtility
use TYPO3\CMS\Core\Utility\ArrayUtility as Typo3ArrayUtility;
class ArrayUtility extends Typo3ArrayUtility
{
/**
* Recursively removes empty array elements.

View file

@ -25,7 +25,7 @@ SearchCoreConfigurationContainer.php::
use Codappix\SearchCore\Configuration\ConfigurationContainer;
use Codappix\SearchCore\Configuration\NoConfigurationException;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use Codappix\SearchCore\Utility\ArrayUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
/**