From ee63558e194396d0635b1444c53d8aadefc6d4d5 Mon Sep 17 00:00:00 2001 From: Markus Friedrich Date: Thu, 8 Sep 2022 09:48:08 +0200 Subject: [PATCH] !!![TASK:BP:11.6] Introduce specific EXT:solr exceptions Existing exceptions are now based on the recently introduced generic EXT:solr exception. Additionally based on the new generic EXT:solr exception a further exception is introduced, allowing more targeted handling of exceptions: InvalidIndexQueueInitizalizationPostProcessorException This is a breaking change as the base excepion changed and the new exception is no longer based on \UnexpectedValueException. Ports: #3764 Resolves: #3763 --- .../Access/RootlineElementFormatException.php | 4 ++- Classes/ConnectionManager.php | 2 +- Classes/ContentObject/Classification.php | 2 +- .../Search/AbstractModuleController.php | 2 +- .../Queue/GarbageRemover/AbstractStrategy.php | 2 +- .../Queue/QueueInitializationService.php | 10 ++++--- .../RecordMonitor/Helper/RootPageResolver.php | 2 +- .../Queue/UpdateHandler/DataUpdateHandler.php | 2 +- .../AbstractBaseEventListener.php | 2 +- .../LastSearches/LastSearchesRepository.php | 2 +- .../Query/ParameterBuilder/Operator.php | 2 +- .../Search/ResultSet/Facets/FacetRegistry.php | 2 +- .../Facets/InvalidFacetPackageException.php | 4 ++- .../Facets/InvalidFacetParserException.php | 4 ++- .../Facets/InvalidQueryBuilderException.php | 4 ++- .../Facets/InvalidUrlDecoderException.php | 2 +- .../NumericRange/NumericRangeUrlDecoder.php | 2 +- .../ResultSet/Facets/RequirementsService.php | 4 ++- .../Result/Parser/ResultParserRegistry.php | 2 +- .../ResultSet/Result/SearchResultBuilder.php | 2 +- .../Search/ResultSet/Sorting/Sorting.php | 2 +- .../ResultSet/Sorting/SortingHelper.php | 2 +- ...dSiteConfigurationCombinationException.php | 2 +- .../InvalidSiteRootPageException.php | 24 +++++++++++++++++ Classes/Domain/Site/SiteRepository.php | 2 +- Classes/Domain/Variants/IdBuilder.php | 2 +- ...eInitizalizationPostProcessorException.php | 27 +++++++++++++++++++ .../Exception/InvalidArgumentException.php | 27 +++++++++++++++++++ .../Exception/Exception.php | 4 ++- .../Exception/IllegalStateException.php | 4 ++- .../Exception/IndexingException.php | 4 ++- Classes/IndexQueue/Indexer.php | 2 +- Classes/IndexQueue/Item.php | 2 +- Classes/IndexQueue/NoPidException.php | 4 ++- Classes/IndexQueue/Queue.php | 2 +- Classes/LanguageFileUnavailableException.php | 2 +- Classes/NoSolrConnectionFoundException.php | 2 -- Classes/PingFailedException.php | 2 -- Classes/Query/Modifier/Faceting.php | 2 +- Classes/Search/SearchComponentManager.php | 2 +- .../Configuration/TypoScriptConfiguration.php | 4 +-- .../WebRootAllReadyDefinedException.php | 4 ++- .../System/Object/AbstractClassRegistry.php | 2 +- Classes/System/Records/AbstractRepository.php | 2 +- .../System/Records/Pages/PagesRepository.php | 2 +- Classes/System/Solr/Parser/StopWordParser.php | 2 +- .../System/Solr/Service/SolrAdminService.php | 2 +- Classes/System/Url/UrlHelper.php | 2 +- Classes/Task/AbstractSolrTask.php | 2 +- Classes/Task/EventQueueWorkerTask.php | 2 +- Classes/Utility/ManagedResourcesUtility.php | 2 +- ...AbstractSolrFrontendTagBasedViewHelper.php | 2 +- .../AbstractSolrFrontendViewHelper.php | 2 +- .../IfHasAccessToModuleViewHelper.php | 2 +- .../ViewHelpers/Uri/AbstractUriViewHelper.php | 2 +- .../Uri/Facet/AbstractValueViewHelper.php | 13 ++++----- .../Uri/Facet/AddFacetItemViewHelper.php | 3 ++- .../Uri/Facet/RemoveAllFacetsViewHelper.php | 3 ++- .../Uri/Facet/RemoveFacetItemViewHelper.php | 3 ++- .../Uri/Facet/RemoveFacetViewHelper.php | 3 ++- .../Uri/Facet/SetFacetItemViewHelper.php | 3 ++- .../Domain/Site/SiteRepositoryTest.php | 2 +- Tests/Integration/Domain/Site/SiteTest.php | 2 +- Tests/Integration/IndexQueue/IndexerTest.php | 5 ++-- Tests/Integration/IntegrationTest.php | 2 +- .../Helper/RootPageResolverTest.php | 2 +- .../ResultSet/Facets/FacetRegistryTest.php | 2 +- .../NumericRangeUrlDecoderTest.php | 2 +- .../Facets/RequirementsServiceTest.php | 3 ++- .../ResultSet/Sorting/SortingHelperTest.php | 3 ++- .../Search/ResultSet/Sorting/SortingTest.php | 3 ++- Tests/Unit/IndexQueue/IndexerTest.php | 2 +- 72 files changed, 188 insertions(+), 80 deletions(-) create mode 100644 Classes/Domain/Site/Exception/InvalidSiteRootPageException.php create mode 100644 Classes/Exception/Index/Queue/InvalidIndexQueueInitizalizationPostProcessorException.php create mode 100644 Classes/Exception/InvalidArgumentException.php diff --git a/Classes/Access/RootlineElementFormatException.php b/Classes/Access/RootlineElementFormatException.php index 5bf6f69174..3a0ce0e23b 100644 --- a/Classes/Access/RootlineElementFormatException.php +++ b/Classes/Access/RootlineElementFormatException.php @@ -15,11 +15,13 @@ namespace ApacheSolrForTypo3\Solr\Access; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; + /** * Signals a wrong format for the access definition of a page or the content. * * @author Ingo Renner */ -class RootlineElementFormatException extends \InvalidArgumentException +class RootlineElementFormatException extends InvalidArgumentException { } diff --git a/Classes/ConnectionManager.php b/Classes/ConnectionManager.php index 34f14dd051..c59f87769b 100644 --- a/Classes/ConnectionManager.php +++ b/Classes/ConnectionManager.php @@ -19,13 +19,13 @@ use ApacheSolrForTypo3\Solr\Domain\Site\Site; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Records\Pages\PagesRepository as PagesRepositoryAtExtSolr; use ApacheSolrForTypo3\Solr\System\Records\SystemLanguage\SystemLanguageRepository; use ApacheSolrForTypo3\Solr\System\Solr\Node; use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection; use ApacheSolrForTypo3\Solr\System\Util\SiteUtility; use Doctrine\DBAL\Driver\Exception as DBALDriverException; -use InvalidArgumentException; use function json_encode; use Throwable; use TYPO3\CMS\Core\SingletonInterface; diff --git a/Classes/ContentObject/Classification.php b/Classes/ContentObject/Classification.php index 0e26b154ad..8750b90f5e 100644 --- a/Classes/ContentObject/Classification.php +++ b/Classes/ContentObject/Classification.php @@ -17,7 +17,7 @@ use ApacheSolrForTypo3\Solr\Domain\Index\Classification\Classification as ClassificationItem; use ApacheSolrForTypo3\Solr\Domain\Index\Classification\ClassificationService; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\ContentObject\AbstractContentObject; diff --git a/Classes/Controller/Backend/Search/AbstractModuleController.php b/Classes/Controller/Backend/Search/AbstractModuleController.php index b6221809a6..89d3e28309 100644 --- a/Classes/Controller/Backend/Search/AbstractModuleController.php +++ b/Classes/Controller/Backend/Search/AbstractModuleController.php @@ -18,12 +18,12 @@ use ApacheSolrForTypo3\Solr\ConnectionManager; use ApacheSolrForTypo3\Solr\Domain\Site\Site; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\IndexQueue\Queue; use ApacheSolrForTypo3\Solr\IndexQueue\QueueInterface; use ApacheSolrForTypo3\Solr\System\Mvc\Backend\Service\ModuleDataStorageService; use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection as SolrCoreConnection; use Doctrine\DBAL\Driver\Exception as DBALDriverException; -use InvalidArgumentException; use Psr\Http\Message\ResponseInterface; use Throwable; use TYPO3\CMS\Backend\Template\Components\Menu\Menu; diff --git a/Classes/Domain/Index/Queue/GarbageRemover/AbstractStrategy.php b/Classes/Domain/Index/Queue/GarbageRemover/AbstractStrategy.php index 293529ef13..a460d2bbd8 100644 --- a/Classes/Domain/Index/Queue/GarbageRemover/AbstractStrategy.php +++ b/Classes/Domain/Index/Queue/GarbageRemover/AbstractStrategy.php @@ -16,12 +16,12 @@ namespace ApacheSolrForTypo3\Solr\Domain\Index\Queue\GarbageRemover; use ApacheSolrForTypo3\Solr\ConnectionManager; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\GarbageCollectorPostProcessor; use ApacheSolrForTypo3\Solr\IndexQueue\Queue; use ApacheSolrForTypo3\Solr\IndexQueue\QueueInterface; use ApacheSolrForTypo3\Solr\System\Logging\SolrLogManager; use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection; -use InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; /** diff --git a/Classes/Domain/Index/Queue/QueueInitializationService.php b/Classes/Domain/Index/Queue/QueueInitializationService.php index 52c7bc1cc3..afe3a8347a 100644 --- a/Classes/Domain/Index/Queue/QueueInitializationService.php +++ b/Classes/Domain/Index/Queue/QueueInitializationService.php @@ -18,15 +18,15 @@ namespace ApacheSolrForTypo3\Solr\Domain\Index\Queue; use ApacheSolrForTypo3\Solr\Domain\Site\Site; +use ApacheSolrForTypo3\Solr\Exception\Index\Queue\InvalidIndexQueueInitizalizationPostProcessorException; use ApacheSolrForTypo3\Solr\IndexQueue\InitializationPostProcessor; use ApacheSolrForTypo3\Solr\IndexQueue\Initializer\AbstractInitializer; +use ApacheSolrForTypo3\Solr\IndexQueue\QueueInitializationServiceAwareInterface; use ApacheSolrForTypo3\Solr\IndexQueue\QueueInterface; use Doctrine\DBAL\ConnectionException; use Doctrine\DBAL\Exception as DBALException; use Throwable; use TYPO3\CMS\Core\Utility\GeneralUtility; -use UnexpectedValueException; -use ApacheSolrForTypo3\Solr\IndexQueue\QueueInitializationServiceAwareInterface; /** * The queue initialization service is responsible to run the initialization of the index queue for a combination of sites @@ -96,6 +96,7 @@ public function initializeBySitesAndConfigurations(array $sites, array $indexing * @throws ConnectionException * @throws Throwable * @throws DBALException + * @throws InvalidIndexQueueInitizalizationPostProcessorException */ public function initializeBySiteAndIndexConfigurations(Site $site, array $indexingConfigurationNames): array { @@ -116,7 +117,10 @@ public function initializeBySiteAndIndexConfigurations(Site $site, array $indexi if ($indexQueueInitializationPostProcessor instanceof InitializationPostProcessor) { $indexQueueInitializationPostProcessor->postProcessIndexQueueInitialization($site, $indexingConfigurationNames, $initializationStatus); } else { - throw new UnexpectedValueException(get_class($indexQueueInitializationPostProcessor) . ' must implement interface ' . InitializationPostProcessor::class, 1345815561); + throw new InvalidIndexQueueInitizalizationPostProcessorException( + get_class($indexQueueInitializationPostProcessor) . ' must implement interface ' . InitializationPostProcessor::class, + 1345815561 + ); } } diff --git a/Classes/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolver.php b/Classes/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolver.php index f89ef3e65a..9f6f1a75ef 100644 --- a/Classes/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolver.php +++ b/Classes/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolver.php @@ -19,11 +19,11 @@ use ApacheSolrForTypo3\Solr\Domain\Site\Site; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Cache\TwoLevelCache; use ApacheSolrForTypo3\Solr\System\Configuration\ExtensionConfiguration; use ApacheSolrForTypo3\Solr\System\Page\Rootline; use Doctrine\DBAL\Driver\Exception as DBALDriverException; -use InvalidArgumentException; use RuntimeException; use Throwable; use TYPO3\CMS\Backend\Utility\BackendUtility; diff --git a/Classes/Domain/Index/Queue/UpdateHandler/DataUpdateHandler.php b/Classes/Domain/Index/Queue/UpdateHandler/DataUpdateHandler.php index 92def0e31f..8db8dabd2f 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/DataUpdateHandler.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/DataUpdateHandler.php @@ -22,6 +22,7 @@ use ApacheSolrForTypo3\Solr\Domain\Index\Queue\RecordMonitor\Helper\RootPageResolver; use ApacheSolrForTypo3\Solr\Domain\Site\SiteInterface; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\FrontendEnvironment; use ApacheSolrForTypo3\Solr\IndexQueue\Queue; use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; @@ -31,7 +32,6 @@ use ApacheSolrForTypo3\Solr\Util; use Doctrine\DBAL\Driver\Exception as DBALDriverException; use Doctrine\DBAL\Exception as DBALException; -use InvalidArgumentException; use Throwable; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException; diff --git a/Classes/Domain/Index/Queue/UpdateHandler/EventListener/AbstractBaseEventListener.php b/Classes/Domain/Index/Queue/UpdateHandler/EventListener/AbstractBaseEventListener.php index a0abef917c..a042b8caff 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/EventListener/AbstractBaseEventListener.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/EventListener/AbstractBaseEventListener.php @@ -21,8 +21,8 @@ use ApacheSolrForTypo3\Solr\Domain\Index\Queue\UpdateHandler\EventListener\Events\ProcessingFinishedEventInterface; use ApacheSolrForTypo3\Solr\Domain\Index\Queue\UpdateHandler\Events\DataUpdateEventInterface; use ApacheSolrForTypo3\Solr\Domain\Index\Queue\UpdateHandler\GarbageHandler; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Configuration\ExtensionConfiguration; -use InvalidArgumentException; use Psr\EventDispatcher\EventDispatcherInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Domain/Search/LastSearches/LastSearchesRepository.php b/Classes/Domain/Search/LastSearches/LastSearchesRepository.php index d6c07e8d33..dd494b2a18 100644 --- a/Classes/Domain/Search/LastSearches/LastSearchesRepository.php +++ b/Classes/Domain/Search/LastSearches/LastSearchesRepository.php @@ -15,10 +15,10 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\LastSearches; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Records\AbstractRepository; use Doctrine\DBAL\Driver\Exception as DBALDriverException; use Doctrine\DBAL\Exception as DBALException; -use InvalidArgumentException; use function json_encode; class LastSearchesRepository extends AbstractRepository diff --git a/Classes/Domain/Search/Query/ParameterBuilder/Operator.php b/Classes/Domain/Search/Query/ParameterBuilder/Operator.php index e05f84d1a7..50b18b71cb 100644 --- a/Classes/Domain/Search/Query/ParameterBuilder/Operator.php +++ b/Classes/Domain/Search/Query/ParameterBuilder/Operator.php @@ -15,7 +15,7 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\Query\ParameterBuilder; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; /** * The Operator ParameterProvider is responsible to build the solr query parameters diff --git a/Classes/Domain/Search/ResultSet/Facets/FacetRegistry.php b/Classes/Domain/Search/ResultSet/Facets/FacetRegistry.php index f755e4264a..e1e5e7bbbb 100644 --- a/Classes/Domain/Search/ResultSet/Facets/FacetRegistry.php +++ b/Classes/Domain/Search/ResultSet/Facets/FacetRegistry.php @@ -22,8 +22,8 @@ use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionBased\QueryGroup\QueryGroupPackage; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\RangeBased\DateRange\DateRangePackage; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\RangeBased\NumericRange\NumericRangePackage; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Object\AbstractClassRegistry; -use InvalidArgumentException; /** * Class FacetRegistry diff --git a/Classes/Domain/Search/ResultSet/Facets/InvalidFacetPackageException.php b/Classes/Domain/Search/ResultSet/Facets/InvalidFacetPackageException.php index 0c3b804088..fa5269346e 100644 --- a/Classes/Domain/Search/ResultSet/Facets/InvalidFacetPackageException.php +++ b/Classes/Domain/Search/ResultSet/Facets/InvalidFacetPackageException.php @@ -15,6 +15,8 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets; -class InvalidFacetPackageException extends \Exception +use ApacheSolrForTypo3\Solr\Exception; + +class InvalidFacetPackageException extends Exception { } diff --git a/Classes/Domain/Search/ResultSet/Facets/InvalidFacetParserException.php b/Classes/Domain/Search/ResultSet/Facets/InvalidFacetParserException.php index b0509491c0..623eff19bc 100644 --- a/Classes/Domain/Search/ResultSet/Facets/InvalidFacetParserException.php +++ b/Classes/Domain/Search/ResultSet/Facets/InvalidFacetParserException.php @@ -15,6 +15,8 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets; -class InvalidFacetParserException extends \Exception +use ApacheSolrForTypo3\Solr\Exception; + +class InvalidFacetParserException extends Exception { } diff --git a/Classes/Domain/Search/ResultSet/Facets/InvalidQueryBuilderException.php b/Classes/Domain/Search/ResultSet/Facets/InvalidQueryBuilderException.php index 4022e23fa1..242c37263b 100644 --- a/Classes/Domain/Search/ResultSet/Facets/InvalidQueryBuilderException.php +++ b/Classes/Domain/Search/ResultSet/Facets/InvalidQueryBuilderException.php @@ -15,6 +15,8 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets; -class InvalidQueryBuilderException extends \Exception +use ApacheSolrForTypo3\Solr\Exception; + +class InvalidQueryBuilderException extends Exception { } diff --git a/Classes/Domain/Search/ResultSet/Facets/InvalidUrlDecoderException.php b/Classes/Domain/Search/ResultSet/Facets/InvalidUrlDecoderException.php index 58d27d7a00..0c8992f20a 100644 --- a/Classes/Domain/Search/ResultSet/Facets/InvalidUrlDecoderException.php +++ b/Classes/Domain/Search/ResultSet/Facets/InvalidUrlDecoderException.php @@ -17,7 +17,7 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets; -use Exception; +use ApacheSolrForTypo3\Solr\Exception; class InvalidUrlDecoderException extends Exception { diff --git a/Classes/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeUrlDecoder.php b/Classes/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeUrlDecoder.php index 79706bcfb1..95381e1153 100644 --- a/Classes/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeUrlDecoder.php +++ b/Classes/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeUrlDecoder.php @@ -18,7 +18,7 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\RangeBased\NumericRange; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\FacetUrlDecoderInterface; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; /** * Parser to build Solr range queries from tx_solr[filter] diff --git a/Classes/Domain/Search/ResultSet/Facets/RequirementsService.php b/Classes/Domain/Search/ResultSet/Facets/RequirementsService.php index fad625e941..24cb7abb47 100644 --- a/Classes/Domain/Search/ResultSet/Facets/RequirementsService.php +++ b/Classes/Domain/Search/ResultSet/Facets/RequirementsService.php @@ -15,6 +15,7 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -83,12 +84,13 @@ protected function getRequirementMet(AbstractFacet $facet, $requirement = []) * * @param string $facetNameToCheckRequirementsOn * @return AbstractFacetItem[] + * @throws InvalidArgumentException */ protected function getSelectedItemValues(AbstractFacet $facet, $facetNameToCheckRequirementsOn) { $facetToCheckRequirements = $facet->getResultSet()->getFacets()->getByName($facetNameToCheckRequirementsOn)->getByPosition(0); if (!$facetToCheckRequirements instanceof AbstractFacet) { - throw new \InvalidArgumentException('Requirement for unexisting facet configured'); + throw new InvalidArgumentException('Requirement for unexisting facet configured'); } if (!$facetToCheckRequirements->getIsUsed()) { diff --git a/Classes/Domain/Search/ResultSet/Result/Parser/ResultParserRegistry.php b/Classes/Domain/Search/ResultSet/Result/Parser/ResultParserRegistry.php index 3109abf8c5..0c21251fd7 100644 --- a/Classes/Domain/Search/ResultSet/Result/Parser/ResultParserRegistry.php +++ b/Classes/Domain/Search/ResultSet/Result/Parser/ResultParserRegistry.php @@ -18,7 +18,7 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Result\Parser; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Domain/Search/ResultSet/Result/SearchResultBuilder.php b/Classes/Domain/Search/ResultSet/Result/SearchResultBuilder.php index 5c35c4ada5..d6ecb59c5f 100644 --- a/Classes/Domain/Search/ResultSet/Result/SearchResultBuilder.php +++ b/Classes/Domain/Search/ResultSet/Result/SearchResultBuilder.php @@ -17,8 +17,8 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Result; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Solr\Document\Document; -use InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; /** diff --git a/Classes/Domain/Search/ResultSet/Sorting/Sorting.php b/Classes/Domain/Search/ResultSet/Sorting/Sorting.php index 27e750f0d8..1304b1ba0c 100644 --- a/Classes/Domain/Search/ResultSet/Sorting/Sorting.php +++ b/Classes/Domain/Search/ResultSet/Sorting/Sorting.php @@ -18,7 +18,7 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Sorting; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; /** * Class Sorting diff --git a/Classes/Domain/Search/ResultSet/Sorting/SortingHelper.php b/Classes/Domain/Search/ResultSet/Sorting/SortingHelper.php index 64935d3e3c..86d8ecb8f3 100644 --- a/Classes/Domain/Search/ResultSet/Sorting/SortingHelper.php +++ b/Classes/Domain/Search/ResultSet/Sorting/SortingHelper.php @@ -17,7 +17,7 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Sorting; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; /** diff --git a/Classes/Domain/Site/Exception/InvalidSiteConfigurationCombinationException.php b/Classes/Domain/Site/Exception/InvalidSiteConfigurationCombinationException.php index 3b43b5217e..cf95df0dc1 100644 --- a/Classes/Domain/Site/Exception/InvalidSiteConfigurationCombinationException.php +++ b/Classes/Domain/Site/Exception/InvalidSiteConfigurationCombinationException.php @@ -17,7 +17,7 @@ namespace ApacheSolrForTypo3\Solr\Domain\Site\Exception; -use Exception; +use ApacheSolrForTypo3\Solr\Exception; class InvalidSiteConfigurationCombinationException extends Exception { diff --git a/Classes/Domain/Site/Exception/InvalidSiteRootPageException.php b/Classes/Domain/Site/Exception/InvalidSiteRootPageException.php new file mode 100644 index 0000000000..143cd468b3 --- /dev/null +++ b/Classes/Domain/Site/Exception/InvalidSiteRootPageException.php @@ -0,0 +1,24 @@ + */ -class NoPidException extends \Exception +class NoPidException extends Exception { } diff --git a/Classes/IndexQueue/Queue.php b/Classes/IndexQueue/Queue.php index e261202bea..765f943f04 100644 --- a/Classes/IndexQueue/Queue.php +++ b/Classes/IndexQueue/Queue.php @@ -25,13 +25,13 @@ use ApacheSolrForTypo3\Solr\Domain\Index\Queue\Statistic\QueueStatisticsRepository; use ApacheSolrForTypo3\Solr\Domain\Site\Site; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\FrontendEnvironment; use ApacheSolrForTypo3\Solr\System\Cache\TwoLevelCache; use ApacheSolrForTypo3\Solr\System\Logging\SolrLogManager; use Doctrine\DBAL\ConnectionException; use Doctrine\DBAL\Driver\Exception as DBALDriverException; use Doctrine\DBAL\Exception as DBALException; -use InvalidArgumentException; use Throwable; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/LanguageFileUnavailableException.php b/Classes/LanguageFileUnavailableException.php index 18a5ce59d0..96a8800497 100644 --- a/Classes/LanguageFileUnavailableException.php +++ b/Classes/LanguageFileUnavailableException.php @@ -20,6 +20,6 @@ * * @author Ingo Renner */ -class LanguageFileUnavailableException extends \Exception +class LanguageFileUnavailableException extends Exception { } diff --git a/Classes/NoSolrConnectionFoundException.php b/Classes/NoSolrConnectionFoundException.php index cc71030a0d..73879b22eb 100644 --- a/Classes/NoSolrConnectionFoundException.php +++ b/Classes/NoSolrConnectionFoundException.php @@ -17,8 +17,6 @@ namespace ApacheSolrForTypo3\Solr; -use Exception; - /** * Exception that is thrown when no Solr connection could be found. * diff --git a/Classes/PingFailedException.php b/Classes/PingFailedException.php index 8576b798ea..6e38070944 100644 --- a/Classes/PingFailedException.php +++ b/Classes/PingFailedException.php @@ -17,8 +17,6 @@ namespace ApacheSolrForTypo3\Solr; -use Exception; - /** * Exception that is thrown when a ping fails * diff --git a/Classes/Query/Modifier/Faceting.php b/Classes/Query/Modifier/Faceting.php index b80415f5a9..e412417477 100644 --- a/Classes/Query/Modifier/Faceting.php +++ b/Classes/Query/Modifier/Faceting.php @@ -27,8 +27,8 @@ use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\UrlFacetContainer; use ApacheSolrForTypo3\Solr\Domain\Search\SearchRequest; use ApacheSolrForTypo3\Solr\Domain\Search\SearchRequestAware; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; -use InvalidArgumentException; use TYPO3\CMS\Core\Log\LogManager; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Search/SearchComponentManager.php b/Classes/Search/SearchComponentManager.php index bc97357949..4de4aa7912 100644 --- a/Classes/Search/SearchComponentManager.php +++ b/Classes/Search/SearchComponentManager.php @@ -17,7 +17,7 @@ namespace ApacheSolrForTypo3\Solr\Search; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use RuntimeException; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/System/Configuration/TypoScriptConfiguration.php b/Classes/System/Configuration/TypoScriptConfiguration.php index 90244fda94..26877017c8 100644 --- a/Classes/System/Configuration/TypoScriptConfiguration.php +++ b/Classes/System/Configuration/TypoScriptConfiguration.php @@ -15,12 +15,12 @@ namespace ApacheSolrForTypo3\Solr\System\Configuration; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\IndexQueue\Indexer; -use ApacheSolrForTypo3\Solr\IndexQueue\Queue; use ApacheSolrForTypo3\Solr\IndexQueue\Initializer\Record; +use ApacheSolrForTypo3\Solr\IndexQueue\Queue; use ApacheSolrForTypo3\Solr\System\ContentObject\ContentObjectService; use ApacheSolrForTypo3\Solr\System\Util\ArrayAccessor; -use InvalidArgumentException; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/System/Environment/WebRootAllReadyDefinedException.php b/Classes/System/Environment/WebRootAllReadyDefinedException.php index 727c532f1e..1788c5ee02 100644 --- a/Classes/System/Environment/WebRootAllReadyDefinedException.php +++ b/Classes/System/Environment/WebRootAllReadyDefinedException.php @@ -15,11 +15,13 @@ namespace ApacheSolrForTypo3\Solr\System\Environment; +use ApacheSolrForTypo3\Solr\Exception; + /** * Exception that is thrown when a language file is needed, but not available. * * @author Timo Hund */ -class WebRootAllReadyDefinedException extends \Exception +class WebRootAllReadyDefinedException extends Exception { } diff --git a/Classes/System/Object/AbstractClassRegistry.php b/Classes/System/Object/AbstractClassRegistry.php index da6e1a8778..0da477d498 100644 --- a/Classes/System/Object/AbstractClassRegistry.php +++ b/Classes/System/Object/AbstractClassRegistry.php @@ -17,7 +17,7 @@ namespace ApacheSolrForTypo3\Solr\System\Object; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use stdClass; use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; diff --git a/Classes/System/Records/AbstractRepository.php b/Classes/System/Records/AbstractRepository.php index 5d0440c306..5cbc437545 100644 --- a/Classes/System/Records/AbstractRepository.php +++ b/Classes/System/Records/AbstractRepository.php @@ -17,9 +17,9 @@ namespace ApacheSolrForTypo3\Solr\System\Records; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use Doctrine\DBAL\Driver\Exception as DBALDriverException; use Doctrine\DBAL\Exception as DBALException; -use InvalidArgumentException; use RuntimeException; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; diff --git a/Classes/System/Records/Pages/PagesRepository.php b/Classes/System/Records/Pages/PagesRepository.php index 80e6d081cb..30fc61af66 100644 --- a/Classes/System/Records/Pages/PagesRepository.php +++ b/Classes/System/Records/Pages/PagesRepository.php @@ -17,11 +17,11 @@ namespace ApacheSolrForTypo3\Solr\System\Records\Pages; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Cache\TwoLevelCache; use ApacheSolrForTypo3\Solr\System\Records\AbstractRepository; use Doctrine\DBAL\Driver\Exception as DBALDriverException; use Doctrine\DBAL\Exception as DBALException; -use InvalidArgumentException; use PDO; use Throwable; use TYPO3\CMS\Backend\Utility\BackendUtility; diff --git a/Classes/System/Solr/Parser/StopWordParser.php b/Classes/System/Solr/Parser/StopWordParser.php index 836dcb92e5..b6f379f7a2 100644 --- a/Classes/System/Solr/Parser/StopWordParser.php +++ b/Classes/System/Solr/Parser/StopWordParser.php @@ -15,7 +15,7 @@ namespace ApacheSolrForTypo3\Solr\System\Solr\Parser; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; /** * Class to parse the stopwords from a solr response. diff --git a/Classes/System/Solr/Service/SolrAdminService.php b/Classes/System/Solr/Service/SolrAdminService.php index 8a2c4dd466..aff776bab3 100644 --- a/Classes/System/Solr/Service/SolrAdminService.php +++ b/Classes/System/Solr/Service/SolrAdminService.php @@ -17,6 +17,7 @@ namespace ApacheSolrForTypo3\Solr\System\Solr\Service; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; use ApacheSolrForTypo3\Solr\System\Logging\SolrLogManager; use ApacheSolrForTypo3\Solr\System\Solr\Parser\SchemaParser; @@ -24,7 +25,6 @@ use ApacheSolrForTypo3\Solr\System\Solr\Parser\SynonymParser; use ApacheSolrForTypo3\Solr\System\Solr\ResponseAdapter; use ApacheSolrForTypo3\Solr\System\Solr\Schema\Schema; -use InvalidArgumentException; use function simplexml_load_string; use Solarium\Client; use stdClass; diff --git a/Classes/System/Url/UrlHelper.php b/Classes/System/Url/UrlHelper.php index 1c090ea397..e89a9051f9 100644 --- a/Classes/System/Url/UrlHelper.php +++ b/Classes/System/Url/UrlHelper.php @@ -15,7 +15,7 @@ namespace ApacheSolrForTypo3\Solr\System\Url; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3\CMS\Core\Http\Uri; /** diff --git a/Classes/Task/AbstractSolrTask.php b/Classes/Task/AbstractSolrTask.php index 1a62446129..0d5477574b 100644 --- a/Classes/Task/AbstractSolrTask.php +++ b/Classes/Task/AbstractSolrTask.php @@ -19,9 +19,9 @@ use ApacheSolrForTypo3\Solr\Domain\Site\Site; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Logging\SolrLogManager; use Doctrine\DBAL\Driver\Exception as DBALDriverException; -use InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Scheduler\Task\AbstractTask; diff --git a/Classes/Task/EventQueueWorkerTask.php b/Classes/Task/EventQueueWorkerTask.php index aa135dd81b..655d5befb2 100644 --- a/Classes/Task/EventQueueWorkerTask.php +++ b/Classes/Task/EventQueueWorkerTask.php @@ -19,11 +19,11 @@ use ApacheSolrForTypo3\Solr\Domain\Index\Queue\UpdateHandler\EventListener\Events\DelayedProcessingFinishedEvent; use ApacheSolrForTypo3\Solr\Domain\Index\Queue\UpdateHandler\Events\DataUpdateEventInterface; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Logging\SolrLogManager; use ApacheSolrForTypo3\Solr\System\Records\Queue\EventQueueItemRepository; use Doctrine\DBAL\Driver\Exception as DBALDriverException; use Doctrine\DBAL\Exception as DBALException; -use InvalidArgumentException; use Psr\EventDispatcher\EventDispatcherInterface; use Throwable; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Utility/ManagedResourcesUtility.php b/Classes/Utility/ManagedResourcesUtility.php index f83abf03df..132ed771bd 100644 --- a/Classes/Utility/ManagedResourcesUtility.php +++ b/Classes/Utility/ManagedResourcesUtility.php @@ -17,7 +17,7 @@ namespace ApacheSolrForTypo3\Solr\Utility; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3\CMS\Core\Http\Stream; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/ViewHelpers/AbstractSolrFrontendTagBasedViewHelper.php b/Classes/ViewHelpers/AbstractSolrFrontendTagBasedViewHelper.php index 0d84f74192..d7f35f2274 100644 --- a/Classes/ViewHelpers/AbstractSolrFrontendTagBasedViewHelper.php +++ b/Classes/ViewHelpers/AbstractSolrFrontendTagBasedViewHelper.php @@ -18,9 +18,9 @@ namespace ApacheSolrForTypo3\Solr\ViewHelpers; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Mvc\Controller\SolrControllerContext; use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; -use InvalidArgumentException; use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext; /** diff --git a/Classes/ViewHelpers/AbstractSolrFrontendViewHelper.php b/Classes/ViewHelpers/AbstractSolrFrontendViewHelper.php index 9876a10a53..6178102e35 100644 --- a/Classes/ViewHelpers/AbstractSolrFrontendViewHelper.php +++ b/Classes/ViewHelpers/AbstractSolrFrontendViewHelper.php @@ -19,9 +19,9 @@ use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Grouping\GroupItem; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Mvc\Controller\SolrControllerContext; use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; -use InvalidArgumentException; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; /** diff --git a/Classes/ViewHelpers/Backend/Security/IfHasAccessToModuleViewHelper.php b/Classes/ViewHelpers/Backend/Security/IfHasAccessToModuleViewHelper.php index 3ec80a9d01..d9f3e957b2 100644 --- a/Classes/ViewHelpers/Backend/Security/IfHasAccessToModuleViewHelper.php +++ b/Classes/ViewHelpers/Backend/Security/IfHasAccessToModuleViewHelper.php @@ -17,7 +17,7 @@ namespace ApacheSolrForTypo3\Solr\ViewHelpers\Backend\Security; -use InvalidArgumentException; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use RuntimeException; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/ViewHelpers/Uri/AbstractUriViewHelper.php b/Classes/ViewHelpers/Uri/AbstractUriViewHelper.php index c26b36c135..4dfe374bdc 100644 --- a/Classes/ViewHelpers/Uri/AbstractUriViewHelper.php +++ b/Classes/ViewHelpers/Uri/AbstractUriViewHelper.php @@ -20,8 +20,8 @@ use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; use ApacheSolrForTypo3\Solr\Domain\Search\SearchRequest; use ApacheSolrForTypo3\Solr\Domain\Search\Uri\SearchUriBuilder; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\ViewHelpers\AbstractSolrFrontendViewHelper; -use InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Object\Exception as ExtbaseObjectException; use TYPO3\CMS\Extbase\Object\ObjectManager; diff --git a/Classes/ViewHelpers/Uri/Facet/AbstractValueViewHelper.php b/Classes/ViewHelpers/Uri/Facet/AbstractValueViewHelper.php index 218334c51c..9d3269d037 100644 --- a/Classes/ViewHelpers/Uri/Facet/AbstractValueViewHelper.php +++ b/Classes/ViewHelpers/Uri/Facet/AbstractValueViewHelper.php @@ -18,6 +18,7 @@ use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\AbstractFacet; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\AbstractFacetItem; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\ViewHelpers\Uri\AbstractUriViewHelper; /** @@ -44,7 +45,7 @@ public function initializeArguments() /** * @param $arguments * @return string - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ protected static function getValueFromArguments($arguments) { @@ -55,7 +56,7 @@ protected static function getValueFromArguments($arguments) } elseif (isset($arguments['facetItemValue'])) { $facetValue = $arguments['facetItemValue']; } else { - throw new \InvalidArgumentException('No facetItem was passed, please pass either facetItem or facetItemValue'); + throw new InvalidArgumentException('No facetItem was passed, please pass either facetItem or facetItemValue'); } return $facetValue; @@ -64,7 +65,7 @@ protected static function getValueFromArguments($arguments) /** * @param $arguments * @return string - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ protected static function getNameFromArguments($arguments) { @@ -75,7 +76,7 @@ protected static function getNameFromArguments($arguments) } elseif (isset($arguments['facetName'])) { $facetName = $arguments['facetName']; } else { - throw new \InvalidArgumentException('No facet was passed, please pass either facet or facetName'); + throw new InvalidArgumentException('No facet was passed, please pass either facet or facetName'); } return $facetName; @@ -84,7 +85,7 @@ protected static function getNameFromArguments($arguments) /** * @param $arguments * @return string - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ protected static function getResultSetFromArguments($arguments) { @@ -95,7 +96,7 @@ protected static function getResultSetFromArguments($arguments) } elseif (isset($arguments['facetName'])) { $resultSet = $arguments['resultSet']; } else { - throw new \InvalidArgumentException('No facet was passed, please pass either facet or resultSet'); + throw new InvalidArgumentException('No facet was passed, please pass either facet or resultSet'); } return $resultSet; diff --git a/Classes/ViewHelpers/Uri/Facet/AddFacetItemViewHelper.php b/Classes/ViewHelpers/Uri/Facet/AddFacetItemViewHelper.php index d53276ea19..e0b47a9341 100644 --- a/Classes/ViewHelpers/Uri/Facet/AddFacetItemViewHelper.php +++ b/Classes/ViewHelpers/Uri/Facet/AddFacetItemViewHelper.php @@ -16,6 +16,7 @@ namespace ApacheSolrForTypo3\Solr\ViewHelpers\Uri\Facet; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; /** @@ -31,7 +32,7 @@ class AddFacetItemViewHelper extends AbstractValueViewHelper * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { diff --git a/Classes/ViewHelpers/Uri/Facet/RemoveAllFacetsViewHelper.php b/Classes/ViewHelpers/Uri/Facet/RemoveAllFacetsViewHelper.php index a6aeac858e..f18dc066ba 100644 --- a/Classes/ViewHelpers/Uri/Facet/RemoveAllFacetsViewHelper.php +++ b/Classes/ViewHelpers/Uri/Facet/RemoveAllFacetsViewHelper.php @@ -15,6 +15,7 @@ namespace ApacheSolrForTypo3\Solr\ViewHelpers\Uri\Facet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\ViewHelpers\Uri\AbstractUriViewHelper; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; @@ -31,7 +32,7 @@ class RemoveAllFacetsViewHelper extends AbstractUriViewHelper * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { diff --git a/Classes/ViewHelpers/Uri/Facet/RemoveFacetItemViewHelper.php b/Classes/ViewHelpers/Uri/Facet/RemoveFacetItemViewHelper.php index 345e623eb5..5de0367d56 100644 --- a/Classes/ViewHelpers/Uri/Facet/RemoveFacetItemViewHelper.php +++ b/Classes/ViewHelpers/Uri/Facet/RemoveFacetItemViewHelper.php @@ -16,6 +16,7 @@ namespace ApacheSolrForTypo3\Solr\ViewHelpers\Uri\Facet; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; /** @@ -31,7 +32,7 @@ class RemoveFacetItemViewHelper extends AbstractValueViewHelper * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { diff --git a/Classes/ViewHelpers/Uri/Facet/RemoveFacetViewHelper.php b/Classes/ViewHelpers/Uri/Facet/RemoveFacetViewHelper.php index bd2d14678c..2093738236 100644 --- a/Classes/ViewHelpers/Uri/Facet/RemoveFacetViewHelper.php +++ b/Classes/ViewHelpers/Uri/Facet/RemoveFacetViewHelper.php @@ -16,6 +16,7 @@ namespace ApacheSolrForTypo3\Solr\ViewHelpers\Uri\Facet; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\AbstractFacet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\ViewHelpers\Uri\AbstractUriViewHelper; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; @@ -41,7 +42,7 @@ public function initializeArguments() * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { diff --git a/Classes/ViewHelpers/Uri/Facet/SetFacetItemViewHelper.php b/Classes/ViewHelpers/Uri/Facet/SetFacetItemViewHelper.php index 8cad9f2604..116f594151 100644 --- a/Classes/ViewHelpers/Uri/Facet/SetFacetItemViewHelper.php +++ b/Classes/ViewHelpers/Uri/Facet/SetFacetItemViewHelper.php @@ -16,6 +16,7 @@ namespace ApacheSolrForTypo3\Solr\ViewHelpers\Uri\Facet; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; /** @@ -31,7 +32,7 @@ class SetFacetItemViewHelper extends AbstractValueViewHelper * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { diff --git a/Tests/Integration/Domain/Site/SiteRepositoryTest.php b/Tests/Integration/Domain/Site/SiteRepositoryTest.php index c92ebf59af..c7f7ad18f0 100644 --- a/Tests/Integration/Domain/Site/SiteRepositoryTest.php +++ b/Tests/Integration/Domain/Site/SiteRepositoryTest.php @@ -17,10 +17,10 @@ use ApacheSolrForTypo3\Solr\Domain\Site\Site; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Tests\Integration\IntegrationTest; use Doctrine\DBAL\DBALException; use Exception; -use InvalidArgumentException; use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\TestingFramework\Core\Exception as TestingFrameworkCoreException; diff --git a/Tests/Integration/Domain/Site/SiteTest.php b/Tests/Integration/Domain/Site/SiteTest.php index 51df7ae976..8c0300eefa 100644 --- a/Tests/Integration/Domain/Site/SiteTest.php +++ b/Tests/Integration/Domain/Site/SiteTest.php @@ -17,8 +17,8 @@ use ApacheSolrForTypo3\Solr\Domain\Site\Site; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Tests\Integration\IntegrationTest; -use InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; /** diff --git a/Tests/Integration/IndexQueue/IndexerTest.php b/Tests/Integration/IndexQueue/IndexerTest.php index e73dfcdd49..c07c668ccf 100644 --- a/Tests/Integration/IndexQueue/IndexerTest.php +++ b/Tests/Integration/IndexQueue/IndexerTest.php @@ -15,6 +15,7 @@ namespace ApacheSolrForTypo3\Solr\Tests\Integration\IndexQueue; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\IndexQueue\AdditionalIndexQueueItemIndexer; use ApacheSolrForTypo3\Solr\IndexQueue\Indexer; use ApacheSolrForTypo3\Solr\IndexQueue\Item; @@ -471,7 +472,7 @@ public function canUseConfigurationFromTemplateInRootLine() */ public function canGetAdditionalDocumentsInterfaceOnly() { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']['indexItemAddDocuments'][] = AdditionalIndexQueueItemIndexer::class; $document = new Document(); $metaData = ['item_type' => 'pages']; @@ -499,7 +500,7 @@ public function canGetAdditionalDocumentsNotImplementingInterface() */ public function canGetAdditionalDocumentsNonExistingClass() { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']['indexItemAddDocuments'][] = 'NonExistingClass'; $document = new Document(); $metaData = ['item_type' => 'pages']; diff --git a/Tests/Integration/IntegrationTest.php b/Tests/Integration/IntegrationTest.php index 80e2dcbe88..d35009eab1 100644 --- a/Tests/Integration/IntegrationTest.php +++ b/Tests/Integration/IntegrationTest.php @@ -16,6 +16,7 @@ namespace ApacheSolrForTypo3\Solr\Tests\Integration; use ApacheSolrForTypo3\Solr\Access\Rootline; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\IndexQueue\Item; use ApacheSolrForTypo3\Solr\Tests\Unit\Helper\FakeObjectManager; use ApacheSolrForTypo3\Solr\Typo3PageIndexer; @@ -24,7 +25,6 @@ use Doctrine\DBAL\Exception as DoctrineDBALException; use Doctrine\DBAL\Schema\SchemaException; use function getenv; -use InvalidArgumentException; use ReflectionClass; use ReflectionException; use ReflectionObject; diff --git a/Tests/Unit/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolverTest.php b/Tests/Unit/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolverTest.php index ae50fdba63..3ee11e2e0d 100644 --- a/Tests/Unit/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolverTest.php +++ b/Tests/Unit/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolverTest.php @@ -17,9 +17,9 @@ use ApacheSolrForTypo3\Solr\Domain\Index\Queue\RecordMonitor\Helper\ConfigurationAwareRecordService; use ApacheSolrForTypo3\Solr\Domain\Index\Queue\RecordMonitor\Helper\RootPageResolver; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\System\Cache\TwoLevelCache; use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; -use InvalidArgumentException; use PHPUnit\Framework\MockObject\MockObject; /** diff --git a/Tests/Unit/Domain/Search/ResultSet/Facets/FacetRegistryTest.php b/Tests/Unit/Domain/Search/ResultSet/Facets/FacetRegistryTest.php index 12a04ea32d..c94e614ad4 100644 --- a/Tests/Unit/Domain/Search/ResultSet/Facets/FacetRegistryTest.php +++ b/Tests/Unit/Domain/Search/ResultSet/Facets/FacetRegistryTest.php @@ -17,9 +17,9 @@ use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\FacetRegistry; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionBased\Options\OptionsPackage; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Tests\Unit\Domain\Search\ResultSet\Facets\TestPackage\TestPackage; use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; -use InvalidArgumentException; use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; diff --git a/Tests/Unit/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeUrlDecoderTest.php b/Tests/Unit/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeUrlDecoderTest.php index 977042111b..5eca1eda1e 100644 --- a/Tests/Unit/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeUrlDecoderTest.php +++ b/Tests/Unit/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeUrlDecoderTest.php @@ -16,8 +16,8 @@ namespace ApacheSolrForTypo3\Solr\Tests\Unit\Domain\Search\ResultSet\Facets\RangeBased\NumericRange; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\RangeBased\NumericRange\NumericRangeUrlDecoder; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; -use InvalidArgumentException; use TYPO3\CMS\Core\Utility\GeneralUtility; /** diff --git a/Tests/Unit/Domain/Search/ResultSet/Facets/RequirementsServiceTest.php b/Tests/Unit/Domain/Search/ResultSet/Facets/RequirementsServiceTest.php index a623fcfd63..6f194f0a80 100644 --- a/Tests/Unit/Domain/Search/ResultSet/Facets/RequirementsServiceTest.php +++ b/Tests/Unit/Domain/Search/ResultSet/Facets/RequirementsServiceTest.php @@ -19,6 +19,7 @@ use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionBased\Options\OptionsFacet; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\RequirementsService; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Object\ObjectManager; @@ -236,7 +237,7 @@ public function getAllRequirementsMetIsReturnsFalseIfRequiredFacetValueIsNotSele */ public function exceptionIsThrownForRequirementWithNotExistingFacet() { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Requirement for unexisting facet configured'); $resultSet = new SearchResultSet(); diff --git a/Tests/Unit/Domain/Search/ResultSet/Sorting/SortingHelperTest.php b/Tests/Unit/Domain/Search/ResultSet/Sorting/SortingHelperTest.php index 42b837ef68..a56c885380 100644 --- a/Tests/Unit/Domain/Search/ResultSet/Sorting/SortingHelperTest.php +++ b/Tests/Unit/Domain/Search/ResultSet/Sorting/SortingHelperTest.php @@ -16,6 +16,7 @@ namespace ApacheSolrForTypo3\Solr\Tests\Unit\Domain\Search\ResultSet\Sorting; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Sorting\SortingHelper; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; /** @@ -49,7 +50,7 @@ public function canGetSortFieldFromUrlParameter() */ public function canThrowExceptionForUnconfiguredSorting() { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('No sorting configuration found for option name unconfigured'); $sorting = new SortingHelper([]); $sorting->getSortFieldFromUrlParameter('unconfigured asc'); diff --git a/Tests/Unit/Domain/Search/ResultSet/Sorting/SortingTest.php b/Tests/Unit/Domain/Search/ResultSet/Sorting/SortingTest.php index 114cb65e56..f72af4b321 100644 --- a/Tests/Unit/Domain/Search/ResultSet/Sorting/SortingTest.php +++ b/Tests/Unit/Domain/Search/ResultSet/Sorting/SortingTest.php @@ -17,6 +17,7 @@ use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Sorting\Sorting; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; /** @@ -55,7 +56,7 @@ protected function setUp(): void */ public function canNotCreateWhenInvalidDirectionIsPassed() { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); new Sorting($this->resultSetMock, 'Color', 'color_s', 'invalid direction', 'the color', false, false); } diff --git a/Tests/Unit/IndexQueue/IndexerTest.php b/Tests/Unit/IndexQueue/IndexerTest.php index 4e4146e4ef..b30a33529e 100644 --- a/Tests/Unit/IndexQueue/IndexerTest.php +++ b/Tests/Unit/IndexQueue/IndexerTest.php @@ -17,6 +17,7 @@ use ApacheSolrForTypo3\Solr\ConnectionManager; use ApacheSolrForTypo3\Solr\Domain\Search\ApacheSolrDocument\Builder; +use ApacheSolrForTypo3\Solr\Exception\InvalidArgumentException; use ApacheSolrForTypo3\Solr\FrontendEnvironment; use ApacheSolrForTypo3\Solr\IndexQueue\AdditionalIndexQueueItemIndexer; use ApacheSolrForTypo3\Solr\IndexQueue\Exception\IndexingException; @@ -30,7 +31,6 @@ use ApacheSolrForTypo3\Solr\System\Solr\Service\SolrWriteService; use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection; use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; -use InvalidArgumentException; use PHPUnit\Framework\MockObject\MockBuilder; use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\Prophecy\ObjectProphecy;