From eb457628bbf49d87eab164c7f28b6979bd8a7e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20K=C3=A4hm?= Date: Mon, 18 Sep 2023 17:10:06 +0200 Subject: [PATCH 1/2] [TASK] Fix PHP-CS for `single_line_empty_body` rule --- Classes/Access/RootlineElementFormatException.php | 4 +--- Classes/Backend/SettingsPreviewOnPlugins.php | 3 +-- .../Exception/RootPageRecordNotFoundException.php | 4 +--- .../EventListener/Events/DelayedProcessingFinishedEvent.php | 4 +--- .../Events/DelayedProcessingQueuingFinishedEvent.php | 4 +--- .../EventListener/Events/ProcessingFinishedEvent.php | 4 +--- .../Index/Queue/UpdateHandler/Events/RecordDeletedEvent.php | 4 +--- .../Queue/UpdateHandler/Events/RecordGarbageCheckEvent.php | 4 +--- .../Index/Queue/UpdateHandler/Events/RecordMovedEvent.php | 4 +--- .../Index/Queue/UpdateHandler/Events/RecordUpdatedEvent.php | 4 +--- .../Index/Queue/UpdateHandler/Events/VersionSwappedEvent.php | 4 +--- Classes/Domain/Search/ApacheSolrDocument/Builder.php | 3 +-- Classes/Domain/Search/Query/SearchQuery.php | 4 +--- Classes/Domain/Search/ResultSet/Facets/AbstractFacet.php | 3 +-- Classes/Domain/Search/ResultSet/Facets/AbstractFacetItem.php | 3 +-- .../Search/ResultSet/Facets/InvalidFacetPackageException.php | 4 +--- .../Search/ResultSet/Facets/InvalidFacetParserException.php | 4 +--- .../Search/ResultSet/Facets/InvalidQueryBuilderException.php | 4 +--- .../Search/ResultSet/Facets/InvalidUrlDecoderException.php | 4 +--- .../ResultSet/Facets/OptionBased/Hierarchy/NodeCollection.php | 4 +--- .../Facets/RangeBased/NumericRange/NumericRangeCollection.php | 4 +--- .../Domain/Search/ResultSet/Grouping/GroupItemCollection.php | 4 +--- Classes/Domain/Search/Score/Score.php | 3 +-- .../InvalidSiteConfigurationCombinationException.php | 4 +--- .../Domain/Site/Exception/InvalidSiteRootPageException.php | 4 +--- .../Exception/UnexpectedTYPO3SiteInitializationException.php | 4 +--- Classes/Domain/Variants/IdBuilder.php | 3 +-- .../IndexQueue/AfterIndexQueueHasBeenInitializedEvent.php | 3 +-- .../AfterIndexQueueItemHasBeenMarkedForReindexingEvent.php | 3 +-- .../AfterRecordsForIndexQueueItemsHaveBeenRetrievedEvent.php | 3 +-- .../AfterFrontendPageUriForIndexingHasBeenGeneratedEvent.php | 3 +-- .../Indexing/AfterPageDocumentIsCreatedForIndexingEvent.php | 3 +-- Classes/Event/Indexing/BeforeDocumentsAreIndexedEvent.php | 3 +-- .../Search/AfterInitialSearchResultSetHasBeenCreatedEvent.php | 3 +-- Classes/Event/Search/AfterSearchHasBeenExecutedEvent.php | 3 +-- Classes/Event/Search/AfterSearchQueryHasBeenPreparedEvent.php | 3 +-- Classes/Event/Variants/AfterVariantIdWasBuiltEvent.php | 3 +-- Classes/Exception.php | 4 +--- Classes/Exception/InvalidArgumentException.php | 4 +--- Classes/FrontendEnvironment/Exception/Exception.php | 4 +--- Classes/IndexQueue/Exception/DocumentPreparationException.php | 4 +--- Classes/IndexQueue/Exception/IllegalStateException.php | 4 +--- Classes/IndexQueue/Exception/IndexingException.php | 4 +--- Classes/IndexQueue/Initializer/Page.php | 4 +--- Classes/IndexQueue/InvalidFieldNameException.php | 4 +--- Classes/IndexQueue/NoPidException.php | 4 +--- Classes/LanguageFileUnavailableException.php | 4 +--- Classes/Pagination/ResultsPaginator.php | 4 +--- Classes/PingFailedException.php | 4 +--- Classes/Routing/Enhancer/SolrRouteEnhancerInterface.php | 4 +--- Classes/Search/AccessComponent.php | 3 +-- Classes/Search/AnalysisComponent.php | 4 +--- Classes/Search/DebugComponent.php | 4 +--- Classes/Search/ElevationComponent.php | 4 +--- Classes/Search/GroupingComponent.php | 4 +--- Classes/Search/HighlightingComponent.php | 4 +--- Classes/Search/RelevanceComponent.php | 3 +-- Classes/Search/SortingComponent.php | 4 +--- Classes/Search/SpellcheckingComponent.php | 4 +--- Classes/Search/StatisticsComponent.php | 3 +-- .../System/Environment/WebRootAllReadyDefinedException.php | 4 +--- Classes/System/Language/FrontendOverlayService.php | 3 +-- .../Component/Exception/InvalidViewObjectNameException.php | 4 +--- Classes/System/Solr/SolrIncompleteResponseException.php | 4 +--- Classes/System/Solr/SolrInternalServerErrorException.php | 4 +--- Classes/System/Solr/SolrUnavailableException.php | 4 +--- Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php | 3 +-- Tests/Unit/IndexQueue/AbstractIndexerTest.php | 3 +-- Tests/Unit/IndexQueue/FrontendHelper/InvalidFakeHelper.php | 4 +--- Tests/Unit/IndexQueue/InvalidSerializedValueDetector.php | 4 +--- 70 files changed, 70 insertions(+), 188 deletions(-) diff --git a/Classes/Access/RootlineElementFormatException.php b/Classes/Access/RootlineElementFormatException.php index 3a0ce0e23b..ba93a4a4e6 100644 --- a/Classes/Access/RootlineElementFormatException.php +++ b/Classes/Access/RootlineElementFormatException.php @@ -22,6 +22,4 @@ * * @author Ingo Renner */ -class RootlineElementFormatException extends InvalidArgumentException -{ -} +class RootlineElementFormatException extends InvalidArgumentException {} diff --git a/Classes/Backend/SettingsPreviewOnPlugins.php b/Classes/Backend/SettingsPreviewOnPlugins.php index 1825411dbf..f44760fa5b 100644 --- a/Classes/Backend/SettingsPreviewOnPlugins.php +++ b/Classes/Backend/SettingsPreviewOnPlugins.php @@ -38,8 +38,7 @@ class SettingsPreviewOnPlugins public function __construct( protected FlexFormService $flexFormService - ) { - } + ) {} public function __invoke(PageContentPreviewRenderingEvent $event): void { diff --git a/Classes/Domain/Index/Queue/RecordMonitor/Exception/RootPageRecordNotFoundException.php b/Classes/Domain/Index/Queue/RecordMonitor/Exception/RootPageRecordNotFoundException.php index 98a38caeb2..f5927f2ebf 100644 --- a/Classes/Domain/Index/Queue/RecordMonitor/Exception/RootPageRecordNotFoundException.php +++ b/Classes/Domain/Index/Queue/RecordMonitor/Exception/RootPageRecordNotFoundException.php @@ -20,6 +20,4 @@ /** * Exception that is thrown if the record of the root page couldn't be found */ -class RootPageRecordNotFoundException extends Exception -{ -} +class RootPageRecordNotFoundException extends Exception {} diff --git a/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/DelayedProcessingFinishedEvent.php b/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/DelayedProcessingFinishedEvent.php index 587c8211f1..e0233f6ba1 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/DelayedProcessingFinishedEvent.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/DelayedProcessingFinishedEvent.php @@ -20,6 +20,4 @@ /** * Delayed processing finished event */ -class DelayedProcessingFinishedEvent extends AbstractProcessingFinishedEvent -{ -} +class DelayedProcessingFinishedEvent extends AbstractProcessingFinishedEvent {} diff --git a/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/DelayedProcessingQueuingFinishedEvent.php b/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/DelayedProcessingQueuingFinishedEvent.php index d63b8fe9c4..c70c3c05d8 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/DelayedProcessingQueuingFinishedEvent.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/DelayedProcessingQueuingFinishedEvent.php @@ -20,6 +20,4 @@ /** * Delayed processing queuing finished event */ -class DelayedProcessingQueuingFinishedEvent extends AbstractProcessingFinishedEvent -{ -} +class DelayedProcessingQueuingFinishedEvent extends AbstractProcessingFinishedEvent {} diff --git a/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/ProcessingFinishedEvent.php b/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/ProcessingFinishedEvent.php index 33c18c1dd4..939fee3019 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/ProcessingFinishedEvent.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/EventListener/Events/ProcessingFinishedEvent.php @@ -20,6 +20,4 @@ /** * Processing finished event */ -class ProcessingFinishedEvent extends AbstractProcessingFinishedEvent -{ -} +class ProcessingFinishedEvent extends AbstractProcessingFinishedEvent {} diff --git a/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordDeletedEvent.php b/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordDeletedEvent.php index 08a368080d..4405bd0701 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordDeletedEvent.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordDeletedEvent.php @@ -20,6 +20,4 @@ /** * Event fired if a record is deleted */ -class RecordDeletedEvent extends AbstractDataUpdateEvent -{ -} +class RecordDeletedEvent extends AbstractDataUpdateEvent {} diff --git a/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordGarbageCheckEvent.php b/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordGarbageCheckEvent.php index eb5ebb6c35..682066d9f1 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordGarbageCheckEvent.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordGarbageCheckEvent.php @@ -20,6 +20,4 @@ /** * Event fired if a record garbage check is triggered */ -class RecordGarbageCheckEvent extends AbstractDataUpdateEvent -{ -} +class RecordGarbageCheckEvent extends AbstractDataUpdateEvent {} diff --git a/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordMovedEvent.php b/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordMovedEvent.php index 74b8a988b2..577341f85c 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordMovedEvent.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordMovedEvent.php @@ -20,6 +20,4 @@ /** * Event fired if a record is moved */ -class RecordMovedEvent extends AbstractDataUpdateEvent -{ -} +class RecordMovedEvent extends AbstractDataUpdateEvent {} diff --git a/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordUpdatedEvent.php b/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordUpdatedEvent.php index 8c0e1bd01c..2ab4df5ded 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordUpdatedEvent.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/Events/RecordUpdatedEvent.php @@ -20,6 +20,4 @@ /** * Event fired if a record is created or updated */ -class RecordUpdatedEvent extends AbstractDataUpdateEvent -{ -} +class RecordUpdatedEvent extends AbstractDataUpdateEvent {} diff --git a/Classes/Domain/Index/Queue/UpdateHandler/Events/VersionSwappedEvent.php b/Classes/Domain/Index/Queue/UpdateHandler/Events/VersionSwappedEvent.php index 22d80ab81d..e01d0384dd 100644 --- a/Classes/Domain/Index/Queue/UpdateHandler/Events/VersionSwappedEvent.php +++ b/Classes/Domain/Index/Queue/UpdateHandler/Events/VersionSwappedEvent.php @@ -20,6 +20,4 @@ /** * Event fired if a version is swapped */ -class VersionSwappedEvent extends AbstractDataUpdateEvent -{ -} +class VersionSwappedEvent extends AbstractDataUpdateEvent {} diff --git a/Classes/Domain/Search/ApacheSolrDocument/Builder.php b/Classes/Domain/Search/ApacheSolrDocument/Builder.php index 9a910f24ce..029d6fab29 100644 --- a/Classes/Domain/Search/ApacheSolrDocument/Builder.php +++ b/Classes/Domain/Search/ApacheSolrDocument/Builder.php @@ -39,8 +39,7 @@ class Builder { public function __construct( protected readonly IdBuilder $variantIdBuilder - ) { - } + ) {} /** * This method can be used to build a Document from a TYPO3 page. diff --git a/Classes/Domain/Search/Query/SearchQuery.php b/Classes/Domain/Search/Query/SearchQuery.php index ad658b9fe2..3a86d963b6 100644 --- a/Classes/Domain/Search/Query/SearchQuery.php +++ b/Classes/Domain/Search/Query/SearchQuery.php @@ -17,6 +17,4 @@ namespace ApacheSolrForTypo3\Solr\Domain\Search\Query; -class SearchQuery extends Query -{ -} +class SearchQuery extends Query {} diff --git a/Classes/Domain/Search/ResultSet/Facets/AbstractFacet.php b/Classes/Domain/Search/ResultSet/Facets/AbstractFacet.php index ec019d68d9..d5372e997c 100644 --- a/Classes/Domain/Search/ResultSet/Facets/AbstractFacet.php +++ b/Classes/Domain/Search/ResultSet/Facets/AbstractFacet.php @@ -41,8 +41,7 @@ public function __construct( protected string $field, protected string $label = '', protected array $facetConfiguration = [] - ) { - } + ) {} /** * Returns facet name diff --git a/Classes/Domain/Search/ResultSet/Facets/AbstractFacetItem.php b/Classes/Domain/Search/ResultSet/Facets/AbstractFacetItem.php index 6109de7274..9c7458d8c6 100644 --- a/Classes/Domain/Search/ResultSet/Facets/AbstractFacetItem.php +++ b/Classes/Domain/Search/ResultSet/Facets/AbstractFacetItem.php @@ -31,8 +31,7 @@ public function __construct( protected int $documentCount = 0, protected bool $selected = false, protected array $metrics = [] - ) { - } + ) {} public function getDocumentCount(): int { diff --git a/Classes/Domain/Search/ResultSet/Facets/InvalidFacetPackageException.php b/Classes/Domain/Search/ResultSet/Facets/InvalidFacetPackageException.php index fa5269346e..36b358f1f6 100644 --- a/Classes/Domain/Search/ResultSet/Facets/InvalidFacetPackageException.php +++ b/Classes/Domain/Search/ResultSet/Facets/InvalidFacetPackageException.php @@ -17,6 +17,4 @@ use ApacheSolrForTypo3\Solr\Exception; -class InvalidFacetPackageException extends Exception -{ -} +class InvalidFacetPackageException extends Exception {} diff --git a/Classes/Domain/Search/ResultSet/Facets/InvalidFacetParserException.php b/Classes/Domain/Search/ResultSet/Facets/InvalidFacetParserException.php index 623eff19bc..f6f38029d4 100644 --- a/Classes/Domain/Search/ResultSet/Facets/InvalidFacetParserException.php +++ b/Classes/Domain/Search/ResultSet/Facets/InvalidFacetParserException.php @@ -17,6 +17,4 @@ use ApacheSolrForTypo3\Solr\Exception; -class InvalidFacetParserException extends Exception -{ -} +class InvalidFacetParserException extends Exception {} diff --git a/Classes/Domain/Search/ResultSet/Facets/InvalidQueryBuilderException.php b/Classes/Domain/Search/ResultSet/Facets/InvalidQueryBuilderException.php index 242c37263b..a5603029e7 100644 --- a/Classes/Domain/Search/ResultSet/Facets/InvalidQueryBuilderException.php +++ b/Classes/Domain/Search/ResultSet/Facets/InvalidQueryBuilderException.php @@ -17,6 +17,4 @@ use ApacheSolrForTypo3\Solr\Exception; -class InvalidQueryBuilderException extends Exception -{ -} +class InvalidQueryBuilderException extends Exception {} diff --git a/Classes/Domain/Search/ResultSet/Facets/InvalidUrlDecoderException.php b/Classes/Domain/Search/ResultSet/Facets/InvalidUrlDecoderException.php index 0c8992f20a..9423e6bb27 100644 --- a/Classes/Domain/Search/ResultSet/Facets/InvalidUrlDecoderException.php +++ b/Classes/Domain/Search/ResultSet/Facets/InvalidUrlDecoderException.php @@ -19,6 +19,4 @@ use ApacheSolrForTypo3\Solr\Exception; -class InvalidUrlDecoderException extends Exception -{ -} +class InvalidUrlDecoderException extends Exception {} diff --git a/Classes/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/NodeCollection.php b/Classes/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/NodeCollection.php index cfb96fff0d..c166020089 100644 --- a/Classes/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/NodeCollection.php +++ b/Classes/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/NodeCollection.php @@ -25,6 +25,4 @@ * @author Frans Saris * @author Timo Hund */ -class NodeCollection extends AbstractFacetItemCollection -{ -} +class NodeCollection extends AbstractFacetItemCollection {} diff --git a/Classes/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeCollection.php b/Classes/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeCollection.php index 0b1de43306..62be698792 100644 --- a/Classes/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeCollection.php +++ b/Classes/Domain/Search/ResultSet/Facets/RangeBased/NumericRange/NumericRangeCollection.php @@ -25,6 +25,4 @@ * @author Frans Saris * @author Timo Hund */ -class NumericRangeCollection extends AbstractFacetItemCollection -{ -} +class NumericRangeCollection extends AbstractFacetItemCollection {} diff --git a/Classes/Domain/Search/ResultSet/Grouping/GroupItemCollection.php b/Classes/Domain/Search/ResultSet/Grouping/GroupItemCollection.php index 1906278bc8..a9a7cb58f1 100644 --- a/Classes/Domain/Search/ResultSet/Grouping/GroupItemCollection.php +++ b/Classes/Domain/Search/ResultSet/Grouping/GroupItemCollection.php @@ -22,6 +22,4 @@ /** * The GroupItemCollection contains the GroupItem objects. */ -class GroupItemCollection extends AbstractCollection -{ -} +class GroupItemCollection extends AbstractCollection {} diff --git a/Classes/Domain/Search/Score/Score.php b/Classes/Domain/Search/Score/Score.php index 2965b5ef00..7838c49486 100644 --- a/Classes/Domain/Search/Score/Score.php +++ b/Classes/Domain/Search/Score/Score.php @@ -27,8 +27,7 @@ public function __construct( protected string $fieldName = '', protected float $score = 0.0, protected string $searchTerm = '', - ) { - } + ) {} public function getBoost(): float { diff --git a/Classes/Domain/Site/Exception/InvalidSiteConfigurationCombinationException.php b/Classes/Domain/Site/Exception/InvalidSiteConfigurationCombinationException.php index cf95df0dc1..b22b99b3c5 100644 --- a/Classes/Domain/Site/Exception/InvalidSiteConfigurationCombinationException.php +++ b/Classes/Domain/Site/Exception/InvalidSiteConfigurationCombinationException.php @@ -19,6 +19,4 @@ use ApacheSolrForTypo3\Solr\Exception; -class InvalidSiteConfigurationCombinationException extends Exception -{ -} +class InvalidSiteConfigurationCombinationException extends Exception {} diff --git a/Classes/Domain/Site/Exception/InvalidSiteRootPageException.php b/Classes/Domain/Site/Exception/InvalidSiteRootPageException.php index 143cd468b3..ed8baa17a6 100644 --- a/Classes/Domain/Site/Exception/InvalidSiteRootPageException.php +++ b/Classes/Domain/Site/Exception/InvalidSiteRootPageException.php @@ -19,6 +19,4 @@ use ApacheSolrForTypo3\Solr\Exception; -class InvalidSiteRootPageException extends Exception -{ -} +class InvalidSiteRootPageException extends Exception {} diff --git a/Classes/Domain/Site/Exception/UnexpectedTYPO3SiteInitializationException.php b/Classes/Domain/Site/Exception/UnexpectedTYPO3SiteInitializationException.php index c7b3e9c265..7a0a626eca 100644 --- a/Classes/Domain/Site/Exception/UnexpectedTYPO3SiteInitializationException.php +++ b/Classes/Domain/Site/Exception/UnexpectedTYPO3SiteInitializationException.php @@ -19,6 +19,4 @@ use ApacheSolrForTypo3\Solr\Exception; -class UnexpectedTYPO3SiteInitializationException extends Exception -{ -} +class UnexpectedTYPO3SiteInitializationException extends Exception {} diff --git a/Classes/Domain/Variants/IdBuilder.php b/Classes/Domain/Variants/IdBuilder.php index a5a5b48971..ad68d671b1 100644 --- a/Classes/Domain/Variants/IdBuilder.php +++ b/Classes/Domain/Variants/IdBuilder.php @@ -37,8 +37,7 @@ class IdBuilder { public function __construct( protected readonly EventDispatcherInterface $eventDispatcher - ) { - } + ) {} /** * This method is used to build a variantId. diff --git a/Classes/Event/IndexQueue/AfterIndexQueueHasBeenInitializedEvent.php b/Classes/Event/IndexQueue/AfterIndexQueueHasBeenInitializedEvent.php index 80fbe45648..9d4737c76a 100644 --- a/Classes/Event/IndexQueue/AfterIndexQueueHasBeenInitializedEvent.php +++ b/Classes/Event/IndexQueue/AfterIndexQueueHasBeenInitializedEvent.php @@ -35,8 +35,7 @@ public function __construct( private readonly string $type, private readonly array $indexingConfiguration, private bool $isInitialized - ) { - } + ) {} public function getInitializer(): AbstractInitializer { diff --git a/Classes/Event/IndexQueue/AfterIndexQueueItemHasBeenMarkedForReindexingEvent.php b/Classes/Event/IndexQueue/AfterIndexQueueItemHasBeenMarkedForReindexingEvent.php index a33e425a2c..04dce44309 100644 --- a/Classes/Event/IndexQueue/AfterIndexQueueItemHasBeenMarkedForReindexingEvent.php +++ b/Classes/Event/IndexQueue/AfterIndexQueueItemHasBeenMarkedForReindexingEvent.php @@ -31,8 +31,7 @@ public function __construct( private readonly int $forcedChangeTime, private int $updateCount, private ?array $validLanguageUids - ) { - } + ) {} public function getItemType(): string { diff --git a/Classes/Event/IndexQueue/AfterRecordsForIndexQueueItemsHaveBeenRetrievedEvent.php b/Classes/Event/IndexQueue/AfterRecordsForIndexQueueItemsHaveBeenRetrievedEvent.php index 71fa47555a..e5dcaca12d 100644 --- a/Classes/Event/IndexQueue/AfterRecordsForIndexQueueItemsHaveBeenRetrievedEvent.php +++ b/Classes/Event/IndexQueue/AfterRecordsForIndexQueueItemsHaveBeenRetrievedEvent.php @@ -28,8 +28,7 @@ public function __construct( private readonly string $table, private readonly array $uids, private array $records - ) { - } + ) {} public function getTable(): string { diff --git a/Classes/Event/Indexing/AfterFrontendPageUriForIndexingHasBeenGeneratedEvent.php b/Classes/Event/Indexing/AfterFrontendPageUriForIndexingHasBeenGeneratedEvent.php index a692ce1b38..0549b86596 100644 --- a/Classes/Event/Indexing/AfterFrontendPageUriForIndexingHasBeenGeneratedEvent.php +++ b/Classes/Event/Indexing/AfterFrontendPageUriForIndexingHasBeenGeneratedEvent.php @@ -34,8 +34,7 @@ public function __construct( protected readonly int $languageId, protected readonly string $mountPointParameter, protected readonly array $options - ) { - } + ) {} public function getItem(): Item { diff --git a/Classes/Event/Indexing/AfterPageDocumentIsCreatedForIndexingEvent.php b/Classes/Event/Indexing/AfterPageDocumentIsCreatedForIndexingEvent.php index 2a8922ad2a..278ae0d0f9 100644 --- a/Classes/Event/Indexing/AfterPageDocumentIsCreatedForIndexingEvent.php +++ b/Classes/Event/Indexing/AfterPageDocumentIsCreatedForIndexingEvent.php @@ -40,8 +40,7 @@ public function __construct( private readonly SiteLanguage $siteLanguage, private readonly array $record, private readonly TypoScriptConfiguration $configuration - ) { - } + ) {} public function getDocument(): Document { diff --git a/Classes/Event/Indexing/BeforeDocumentsAreIndexedEvent.php b/Classes/Event/Indexing/BeforeDocumentsAreIndexedEvent.php index 153f5d81d1..eba02659c9 100644 --- a/Classes/Event/Indexing/BeforeDocumentsAreIndexedEvent.php +++ b/Classes/Event/Indexing/BeforeDocumentsAreIndexedEvent.php @@ -37,8 +37,7 @@ public function __construct( private readonly Item $indexQueueItem, /** @var Document[] */ private array $documents, - ) { - } + ) {} public function getSite(): Site { diff --git a/Classes/Event/Search/AfterInitialSearchResultSetHasBeenCreatedEvent.php b/Classes/Event/Search/AfterInitialSearchResultSetHasBeenCreatedEvent.php index cf5cbdbde0..dc6bbd7118 100644 --- a/Classes/Event/Search/AfterInitialSearchResultSetHasBeenCreatedEvent.php +++ b/Classes/Event/Search/AfterInitialSearchResultSetHasBeenCreatedEvent.php @@ -35,8 +35,7 @@ public function __construct( private readonly SearchRequest $searchRequest, private readonly Search $search, private readonly TypoScriptConfiguration $typoScriptConfiguration - ) { - } + ) {} public function getSearchResultSet(): SearchResultSet { diff --git a/Classes/Event/Search/AfterSearchHasBeenExecutedEvent.php b/Classes/Event/Search/AfterSearchHasBeenExecutedEvent.php index b8304da49c..106fa3f8a3 100644 --- a/Classes/Event/Search/AfterSearchHasBeenExecutedEvent.php +++ b/Classes/Event/Search/AfterSearchHasBeenExecutedEvent.php @@ -39,8 +39,7 @@ public function __construct( private readonly SearchRequest $searchRequest, private readonly Search $search, private readonly TypoScriptConfiguration $typoScriptConfiguration - ) { - } + ) {} public function getSearchResultSet(): SearchResultSet { diff --git a/Classes/Event/Search/AfterSearchQueryHasBeenPreparedEvent.php b/Classes/Event/Search/AfterSearchQueryHasBeenPreparedEvent.php index 7a1f26f1d9..519614abbf 100644 --- a/Classes/Event/Search/AfterSearchQueryHasBeenPreparedEvent.php +++ b/Classes/Event/Search/AfterSearchQueryHasBeenPreparedEvent.php @@ -37,8 +37,7 @@ public function __construct( private readonly SearchRequest $searchRequest, private readonly Search $search, private readonly TypoScriptConfiguration $typoScriptConfiguration - ) { - } + ) {} public function getQuery(): Query { diff --git a/Classes/Event/Variants/AfterVariantIdWasBuiltEvent.php b/Classes/Event/Variants/AfterVariantIdWasBuiltEvent.php index 159125294e..bc1610a6c2 100644 --- a/Classes/Event/Variants/AfterVariantIdWasBuiltEvent.php +++ b/Classes/Event/Variants/AfterVariantIdWasBuiltEvent.php @@ -36,8 +36,7 @@ public function __construct( private readonly array $itemRecord, private readonly Site $site, private readonly Document $document - ) { - } + ) {} public function getVariantId(): string { diff --git a/Classes/Exception.php b/Classes/Exception.php index 14545934e0..2459fcf09d 100644 --- a/Classes/Exception.php +++ b/Classes/Exception.php @@ -20,6 +20,4 @@ /** * Generic Apache Solr for TYPO3 exception */ -class Exception extends \Exception -{ -} +class Exception extends \Exception {} diff --git a/Classes/Exception/InvalidArgumentException.php b/Classes/Exception/InvalidArgumentException.php index a13427d418..e8a5054db3 100644 --- a/Classes/Exception/InvalidArgumentException.php +++ b/Classes/Exception/InvalidArgumentException.php @@ -22,6 +22,4 @@ /** * Exception that is thrown if a given argument is invalid. */ -class InvalidArgumentException extends Exception -{ -} +class InvalidArgumentException extends Exception {} diff --git a/Classes/FrontendEnvironment/Exception/Exception.php b/Classes/FrontendEnvironment/Exception/Exception.php index 5332fea81d..15e9bb34d5 100644 --- a/Classes/FrontendEnvironment/Exception/Exception.php +++ b/Classes/FrontendEnvironment/Exception/Exception.php @@ -21,6 +21,4 @@ * Exception that is thrown on initialization of EXT:solr FrontendEnvironment. * This exception should be used for any errors on indexing . */ -class Exception extends ExtSolrException -{ -} +class Exception extends ExtSolrException {} diff --git a/Classes/IndexQueue/Exception/DocumentPreparationException.php b/Classes/IndexQueue/Exception/DocumentPreparationException.php index cbaf057e0f..6ea1f916c1 100644 --- a/Classes/IndexQueue/Exception/DocumentPreparationException.php +++ b/Classes/IndexQueue/Exception/DocumentPreparationException.php @@ -18,6 +18,4 @@ /** * Exception that is thrown on TYPO3 side in indexing process. */ -class DocumentPreparationException extends IndexingException -{ -} +class DocumentPreparationException extends IndexingException {} diff --git a/Classes/IndexQueue/Exception/IllegalStateException.php b/Classes/IndexQueue/Exception/IllegalStateException.php index cacf3a5af5..1b68f0f6df 100644 --- a/Classes/IndexQueue/Exception/IllegalStateException.php +++ b/Classes/IndexQueue/Exception/IllegalStateException.php @@ -20,6 +20,4 @@ /** * Exception that is thrown on indexing process and any potentially unusual state. */ -class IllegalStateException extends Exception -{ -} +class IllegalStateException extends Exception {} diff --git a/Classes/IndexQueue/Exception/IndexingException.php b/Classes/IndexQueue/Exception/IndexingException.php index 536e3d2b3d..2fb3232f75 100644 --- a/Classes/IndexQueue/Exception/IndexingException.php +++ b/Classes/IndexQueue/Exception/IndexingException.php @@ -21,6 +21,4 @@ * Exception that is thrown on indexing process. Does not matter on which side, TYPO3 or Apache. * This exception should be used for any errors on indexing process. */ -class IndexingException extends Exception -{ -} +class IndexingException extends Exception {} diff --git a/Classes/IndexQueue/Initializer/Page.php b/Classes/IndexQueue/Initializer/Page.php index c9ee2e4ebe..24b8f25fdb 100644 --- a/Classes/IndexQueue/Initializer/Page.php +++ b/Classes/IndexQueue/Initializer/Page.php @@ -47,9 +47,7 @@ class Page extends AbstractInitializer * * @param string $type Type to initialize (ignored). */ - public function setType(string $type): void - { - } + public function setType(string $type): void {} /** * Initializes Index Queue page items for a site. Includes regular pages diff --git a/Classes/IndexQueue/InvalidFieldNameException.php b/Classes/IndexQueue/InvalidFieldNameException.php index 23d6ca41d2..894854d487 100644 --- a/Classes/IndexQueue/InvalidFieldNameException.php +++ b/Classes/IndexQueue/InvalidFieldNameException.php @@ -23,6 +23,4 @@ * * @author Ingo Renner */ -class InvalidFieldNameException extends RuntimeException -{ -} +class InvalidFieldNameException extends RuntimeException {} diff --git a/Classes/IndexQueue/NoPidException.php b/Classes/IndexQueue/NoPidException.php index 533c0048aa..469e9f3822 100644 --- a/Classes/IndexQueue/NoPidException.php +++ b/Classes/IndexQueue/NoPidException.php @@ -22,6 +22,4 @@ * * @author Timo Hund */ -class NoPidException extends Exception -{ -} +class NoPidException extends Exception {} diff --git a/Classes/LanguageFileUnavailableException.php b/Classes/LanguageFileUnavailableException.php index 96a8800497..089ec27aad 100644 --- a/Classes/LanguageFileUnavailableException.php +++ b/Classes/LanguageFileUnavailableException.php @@ -20,6 +20,4 @@ * * @author Ingo Renner */ -class LanguageFileUnavailableException extends Exception -{ -} +class LanguageFileUnavailableException extends Exception {} diff --git a/Classes/Pagination/ResultsPaginator.php b/Classes/Pagination/ResultsPaginator.php index daecf1d816..78dfbe0779 100644 --- a/Classes/Pagination/ResultsPaginator.php +++ b/Classes/Pagination/ResultsPaginator.php @@ -52,9 +52,7 @@ public function getPaginatedItems(): iterable /** * Update paginated items */ - public function updatePaginatedItems(int $itemsPerPage, int $offset): void - { - } + public function updatePaginatedItems(int $itemsPerPage, int $offset): void {} /** * Get amount of items on current page diff --git a/Classes/PingFailedException.php b/Classes/PingFailedException.php index 6e38070944..19c89df645 100644 --- a/Classes/PingFailedException.php +++ b/Classes/PingFailedException.php @@ -22,6 +22,4 @@ * * @author Timo Schmidt */ -class PingFailedException extends Exception -{ -} +class PingFailedException extends Exception {} diff --git a/Classes/Routing/Enhancer/SolrRouteEnhancerInterface.php b/Classes/Routing/Enhancer/SolrRouteEnhancerInterface.php index 0179b333a9..bd47f29ff2 100644 --- a/Classes/Routing/Enhancer/SolrRouteEnhancerInterface.php +++ b/Classes/Routing/Enhancer/SolrRouteEnhancerInterface.php @@ -20,6 +20,4 @@ * * @author Lars Tode */ -interface SolrRouteEnhancerInterface -{ -} +interface SolrRouteEnhancerInterface {} diff --git a/Classes/Search/AccessComponent.php b/Classes/Search/AccessComponent.php index c8a52edd2a..972467f0b8 100644 --- a/Classes/Search/AccessComponent.php +++ b/Classes/Search/AccessComponent.php @@ -31,8 +31,7 @@ class AccessComponent { public function __construct( protected readonly QueryBuilder $queryBuilder - ) { - } + ) {} /** * Initializes the search component. diff --git a/Classes/Search/AnalysisComponent.php b/Classes/Search/AnalysisComponent.php index 301bccabf4..d1ae354564 100644 --- a/Classes/Search/AnalysisComponent.php +++ b/Classes/Search/AnalysisComponent.php @@ -27,9 +27,7 @@ */ class AnalysisComponent { - public function __construct(protected readonly QueryBuilder $queryBuilder) - { - } + public function __construct(protected readonly QueryBuilder $queryBuilder) {} /** * Initializes the search component. diff --git a/Classes/Search/DebugComponent.php b/Classes/Search/DebugComponent.php index 153bcbc420..08fdd9a3c5 100644 --- a/Classes/Search/DebugComponent.php +++ b/Classes/Search/DebugComponent.php @@ -27,9 +27,7 @@ */ class DebugComponent { - public function __construct(protected readonly QueryBuilder $queryBuilder) - { - } + public function __construct(protected readonly QueryBuilder $queryBuilder) {} /** * Initializes the search component. diff --git a/Classes/Search/ElevationComponent.php b/Classes/Search/ElevationComponent.php index 6760debb8d..e9b164fd07 100644 --- a/Classes/Search/ElevationComponent.php +++ b/Classes/Search/ElevationComponent.php @@ -27,9 +27,7 @@ */ class ElevationComponent { - public function __construct(protected readonly QueryBuilder $queryBuilder) - { - } + public function __construct(protected readonly QueryBuilder $queryBuilder) {} /** * Enables the query's elevation mode. diff --git a/Classes/Search/GroupingComponent.php b/Classes/Search/GroupingComponent.php index 0c05733d87..11b5a8847f 100644 --- a/Classes/Search/GroupingComponent.php +++ b/Classes/Search/GroupingComponent.php @@ -30,9 +30,7 @@ */ class GroupingComponent { - public function __construct(protected readonly QueryBuilder $queryBuilder) - { - } + public function __construct(protected readonly QueryBuilder $queryBuilder) {} /** * Triggers grouping if activated diff --git a/Classes/Search/HighlightingComponent.php b/Classes/Search/HighlightingComponent.php index 6ae22b74f3..bb3ee3be4a 100644 --- a/Classes/Search/HighlightingComponent.php +++ b/Classes/Search/HighlightingComponent.php @@ -27,9 +27,7 @@ */ class HighlightingComponent { - public function __construct(protected readonly QueryBuilder $queryBuilder) - { - } + public function __construct(protected readonly QueryBuilder $queryBuilder) {} /** * Initializes the search component. diff --git a/Classes/Search/RelevanceComponent.php b/Classes/Search/RelevanceComponent.php index abfd82b814..c95fdb155c 100644 --- a/Classes/Search/RelevanceComponent.php +++ b/Classes/Search/RelevanceComponent.php @@ -29,8 +29,7 @@ class RelevanceComponent { public function __construct( protected readonly QueryBuilder $queryBuilder - ) { - } + ) {} /** * Sets minimum match, boost function, boost query and tie-breaker. diff --git a/Classes/Search/SortingComponent.php b/Classes/Search/SortingComponent.php index cd1dc17f63..0e75308ad3 100644 --- a/Classes/Search/SortingComponent.php +++ b/Classes/Search/SortingComponent.php @@ -32,9 +32,7 @@ */ class SortingComponent { - public function __construct(protected readonly QueryBuilder $queryBuilder) - { - } + public function __construct(protected readonly QueryBuilder $queryBuilder) {} /** * Sets the sorting query parameters diff --git a/Classes/Search/SpellcheckingComponent.php b/Classes/Search/SpellcheckingComponent.php index 57645e7775..b583459d03 100644 --- a/Classes/Search/SpellcheckingComponent.php +++ b/Classes/Search/SpellcheckingComponent.php @@ -27,9 +27,7 @@ */ class SpellcheckingComponent { - public function __construct(protected readonly QueryBuilder $queryBuilder) - { - } + public function __construct(protected readonly QueryBuilder $queryBuilder) {} /** * Initializes the search component. diff --git a/Classes/Search/StatisticsComponent.php b/Classes/Search/StatisticsComponent.php index 59129e1170..893c751483 100644 --- a/Classes/Search/StatisticsComponent.php +++ b/Classes/Search/StatisticsComponent.php @@ -32,8 +32,7 @@ class StatisticsComponent public function __construct( protected readonly QueryBuilder $queryBuilder, protected readonly StatisticsWriterProcessor $statisticsWriterProcessor - ) { - } + ) {} /** * Enables the query's debug mode to get more detailed information. diff --git a/Classes/System/Environment/WebRootAllReadyDefinedException.php b/Classes/System/Environment/WebRootAllReadyDefinedException.php index 1788c5ee02..4d4b1a30c4 100644 --- a/Classes/System/Environment/WebRootAllReadyDefinedException.php +++ b/Classes/System/Environment/WebRootAllReadyDefinedException.php @@ -22,6 +22,4 @@ * * @author Timo Hund */ -class WebRootAllReadyDefinedException extends Exception -{ -} +class WebRootAllReadyDefinedException extends Exception {} diff --git a/Classes/System/Language/FrontendOverlayService.php b/Classes/System/Language/FrontendOverlayService.php index 192ff60c40..4c4968399e 100644 --- a/Classes/System/Language/FrontendOverlayService.php +++ b/Classes/System/Language/FrontendOverlayService.php @@ -37,8 +37,7 @@ class FrontendOverlayService public function __construct( protected readonly TCAService $tcaService, protected readonly TypoScriptFrontendController $tsfe - ) { - } + ) {} /** * Return the translated record diff --git a/Classes/System/Mvc/Backend/Component/Exception/InvalidViewObjectNameException.php b/Classes/System/Mvc/Backend/Component/Exception/InvalidViewObjectNameException.php index 1ecafde5f0..776b5dda9b 100644 --- a/Classes/System/Mvc/Backend/Component/Exception/InvalidViewObjectNameException.php +++ b/Classes/System/Mvc/Backend/Component/Exception/InvalidViewObjectNameException.php @@ -19,6 +19,4 @@ use TYPO3\CMS\Extbase\Mvc\Exception; -class InvalidViewObjectNameException extends Exception -{ -} +class InvalidViewObjectNameException extends Exception {} diff --git a/Classes/System/Solr/SolrIncompleteResponseException.php b/Classes/System/Solr/SolrIncompleteResponseException.php index cb11f28d53..45339df13f 100644 --- a/Classes/System/Solr/SolrIncompleteResponseException.php +++ b/Classes/System/Solr/SolrIncompleteResponseException.php @@ -20,6 +20,4 @@ /** * This exception should be thrown when the response from solr was incomplete */ -class SolrIncompleteResponseException extends SolrCommunicationException -{ -} +class SolrIncompleteResponseException extends SolrCommunicationException {} diff --git a/Classes/System/Solr/SolrInternalServerErrorException.php b/Classes/System/Solr/SolrInternalServerErrorException.php index a76696233a..955b8b7477 100644 --- a/Classes/System/Solr/SolrInternalServerErrorException.php +++ b/Classes/System/Solr/SolrInternalServerErrorException.php @@ -20,6 +20,4 @@ /** * This exception is used when the solr an 500 internal server error is thrown by the solr server */ -class SolrInternalServerErrorException extends SolrCommunicationException -{ -} +class SolrInternalServerErrorException extends SolrCommunicationException {} diff --git a/Classes/System/Solr/SolrUnavailableException.php b/Classes/System/Solr/SolrUnavailableException.php index 9acca04e29..8b23a2dc47 100644 --- a/Classes/System/Solr/SolrUnavailableException.php +++ b/Classes/System/Solr/SolrUnavailableException.php @@ -20,6 +20,4 @@ /** * This exception is used when the solr server is unavailable. */ -class SolrUnavailableException extends SolrCommunicationException -{ -} +class SolrUnavailableException extends SolrCommunicationException {} diff --git a/Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php b/Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php index 0a83e59b9a..9469856c25 100644 --- a/Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php +++ b/Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php @@ -37,8 +37,7 @@ class IndexQueueWorkerTaskAdditionalFieldProvider extends AbstractAdditionalFiel { public function __construct( protected readonly SiteRepository $siteRepository - ) { - } + ) {} /** * Used to define fields to provide the TYPO3 site to index and number of diff --git a/Tests/Unit/IndexQueue/AbstractIndexerTest.php b/Tests/Unit/IndexQueue/AbstractIndexerTest.php index ae76956bb8..3dffe696d5 100644 --- a/Tests/Unit/IndexQueue/AbstractIndexerTest.php +++ b/Tests/Unit/IndexQueue/AbstractIndexerTest.php @@ -103,8 +103,7 @@ public function isSerializedValueCanHandleCustomValidSerializedValueDetector(): */ public function resolveFieldValue(array $indexingConfiguration, string $solrFieldName, array $data, $expectedValue): void { - $subject = new class () extends AbstractIndexer { - }; + $subject = new class () extends AbstractIndexer {}; $tsfe = $this->createMock(TypoScriptFrontendController::class); self::assertEquals( $this->callInaccessibleMethod( diff --git a/Tests/Unit/IndexQueue/FrontendHelper/InvalidFakeHelper.php b/Tests/Unit/IndexQueue/FrontendHelper/InvalidFakeHelper.php index 4dd30b5f2f..230f9d7d53 100644 --- a/Tests/Unit/IndexQueue/FrontendHelper/InvalidFakeHelper.php +++ b/Tests/Unit/IndexQueue/FrontendHelper/InvalidFakeHelper.php @@ -2,6 +2,4 @@ namespace ApacheSolrForTypo3\Solr\Tests\Unit\IndexQueue\FrontendHelper; -class InvalidFakeHelper -{ -} +class InvalidFakeHelper {} diff --git a/Tests/Unit/IndexQueue/InvalidSerializedValueDetector.php b/Tests/Unit/IndexQueue/InvalidSerializedValueDetector.php index 62198f4c6c..55b859a046 100644 --- a/Tests/Unit/IndexQueue/InvalidSerializedValueDetector.php +++ b/Tests/Unit/IndexQueue/InvalidSerializedValueDetector.php @@ -15,6 +15,4 @@ namespace ApacheSolrForTypo3\Solr\Tests\Unit\IndexQueue; -class InvalidSerializedValueDetector -{ -} +class InvalidSerializedValueDetector {} From 5338cd14ea96172a73ba966aa8fe278bfdbd1578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Buchmann?= Date: Mon, 18 Sep 2023 13:42:16 +0200 Subject: [PATCH 2/2] [BUGFIX] Do not index translations on default language in languages free mode With fallbackType: free the index queue contains an entry for each available language. Without this check all the entries are additionally indexed in the default language. They should be only indexed for the language, the record has defined as sys_language_uid. Fixes #3560 --- Classes/IndexQueue/Indexer.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/IndexQueue/Indexer.php b/Classes/IndexQueue/Indexer.php index 2e7d34e68b..99b3d350b8 100644 --- a/Classes/IndexQueue/Indexer.php +++ b/Classes/IndexQueue/Indexer.php @@ -239,6 +239,14 @@ protected function getItemRecordOverlayed(Item $item, int $language): ?array ) { return null; } + // skip translated records for default language within "free content mode"-languages + if ($language === 0 + && isset($languageField) + && (int)($itemRecord[$languageField] ?? null) !== $language + && $this->isLanguageInAFreeContentMode($item, (int)($itemRecord[$languageField] ?? null)) + ) { + return null; + } $pidToUse = $this->getPageIdOfItem($item);