From b15df830ef8495e2d607091b1d0e562b6a5c6448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20K=C3=A4hm?= Date: Mon, 14 Aug 2023 23:18:19 +0200 Subject: [PATCH] [TASK] Sync with EXT:solr addons :: fix old linter issues --- Classes/System/Solr/SolrConnection.php | 2 +- Classes/System/Util/SiteUtility.php | 6 +++--- Tests/Integration/Controller/SearchControllerTest.php | 4 ++-- .../Domain/Search/ResultSet/SearchResultSetServiceTest.php | 6 +++--- .../StatisticsRepository/StatisticsRepositoryTest.php | 2 +- .../System/Configuration/TypoScriptConfigurationTest.php | 2 +- .../Domain/Search/ResultSet/SearchResultSetServiceTest.php | 2 +- Tests/Unit/Domain/Site/SiteRepositoryTest.php | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Classes/System/Solr/SolrConnection.php b/Classes/System/Solr/SolrConnection.php index 33944a7ebe..ed9147bde5 100644 --- a/Classes/System/Solr/SolrConnection.php +++ b/Classes/System/Solr/SolrConnection.php @@ -45,7 +45,7 @@ class SolrConnection { protected ?SolrAdminService $adminService = null; - protected ?SolrReadService $readService= null; + protected ?SolrReadService $readService = null; protected ?SolrWriteService $writeService = null; diff --git a/Classes/System/Util/SiteUtility.php b/Classes/System/Util/SiteUtility.php index 96b86ffde6..3c7df7bcc1 100644 --- a/Classes/System/Util/SiteUtility.php +++ b/Classes/System/Util/SiteUtility.php @@ -150,9 +150,9 @@ public static function getAllSolrConnectionConfigurations( */ protected static function getConnectionPropertyOrFallback( CoreSite $typo3Site, - string $property, - int $languageId, - string $scope, + string $property, + int $languageId, + string $scope, ): string|int|bool|null { if ($scope === 'write' && !self::isWriteConnectionEnabled($typo3Site, $languageId)) { $scope = 'read'; diff --git a/Tests/Integration/Controller/SearchControllerTest.php b/Tests/Integration/Controller/SearchControllerTest.php index b14f1deef3..293f6bfc45 100644 --- a/Tests/Integration/Controller/SearchControllerTest.php +++ b/Tests/Integration/Controller/SearchControllerTest.php @@ -936,8 +936,8 @@ public function canSeeTheParsedQueryWhenABackendUserIsLoggedIn() public function frontendWillRenderErrorMessageIfSolrNotAvailableDataProvider(): array { return [ - ['action' => 'results', 'getArguments' =>['q' => '*']], - ['action' => 'detail', 'getArguments' =>['id' => 1]], + ['action' => 'results', 'getArguments' => ['q' => '*']], + ['action' => 'detail', 'getArguments' => ['id' => 1]], ]; } diff --git a/Tests/Integration/Domain/Search/ResultSet/SearchResultSetServiceTest.php b/Tests/Integration/Domain/Search/ResultSet/SearchResultSetServiceTest.php index bad32c5472..6e6b613430 100644 --- a/Tests/Integration/Domain/Search/ResultSet/SearchResultSetServiceTest.php +++ b/Tests/Integration/Domain/Search/ResultSet/SearchResultSetServiceTest.php @@ -82,7 +82,7 @@ public function canGetVariants(): void $typoScriptConfiguration = Util::getSolrConfiguration(); $typoScriptConfiguration->mergeSolrConfiguration([ - 'search.' =>[ + 'search.' => [ 'variants' => 1, 'variants.' => [ 'variantField' => 'pid', @@ -130,7 +130,7 @@ public function canGetCaseSensitiveVariants(): void $typoScriptConfiguration = Util::getSolrConfiguration(); $typoScriptConfiguration->mergeSolrConfiguration([ - 'search.' =>[ + 'search.' => [ 'variants' => 1, 'variants.' => [ 'variantField' => 'author', @@ -196,7 +196,7 @@ public function canGetZeroResultsWithVariantsOnEmptyIndex(): void $typoScriptConfiguration = Util::getSolrConfiguration(); $typoScriptConfiguration->mergeSolrConfiguration([ - 'search.' =>[ + 'search.' => [ 'variants' => 1, 'variants.' => [ 'variantField' => 'pid', diff --git a/Tests/Integration/Domain/Search/StatisticsRepository/StatisticsRepositoryTest.php b/Tests/Integration/Domain/Search/StatisticsRepository/StatisticsRepositoryTest.php index 7edd566e06..6680980a46 100644 --- a/Tests/Integration/Domain/Search/StatisticsRepository/StatisticsRepositoryTest.php +++ b/Tests/Integration/Domain/Search/StatisticsRepository/StatisticsRepositoryTest.php @@ -139,7 +139,7 @@ public function canSaveStatisticsRecord() protected static function getDaysSinceTimestamp(int $timestamp): int { $secondsUntilNow = time() - $timestamp; - $days = floor($secondsUntilNow / (60*60*24)); + $days = floor($secondsUntilNow / (60 * 60 * 24)); return (int)$days; } } diff --git a/Tests/Integration/System/Configuration/TypoScriptConfigurationTest.php b/Tests/Integration/System/Configuration/TypoScriptConfigurationTest.php index 8814bc6265..b90454f3bc 100644 --- a/Tests/Integration/System/Configuration/TypoScriptConfigurationTest.php +++ b/Tests/Integration/System/Configuration/TypoScriptConfigurationTest.php @@ -45,7 +45,7 @@ public function testCanUsePlainValuesFromConfiguration() $configuration = [ 'plugin.' => [ 'tx_solr.' => [ - 'search.' =>[ + 'search.' => [ 'sorting' => 1, ], ], diff --git a/Tests/Unit/Domain/Search/ResultSet/SearchResultSetServiceTest.php b/Tests/Unit/Domain/Search/ResultSet/SearchResultSetServiceTest.php index ea78141524..5b12675c5f 100644 --- a/Tests/Unit/Domain/Search/ResultSet/SearchResultSetServiceTest.php +++ b/Tests/Unit/Domain/Search/ResultSet/SearchResultSetServiceTest.php @@ -156,7 +156,7 @@ public function canCreateGroups(): void $parserRegistry = GeneralUtility::makeInstance(ResultParserRegistry::class, $typoScriptConfiguration); $parserRegistry->registerParser(GroupedResultParser::class, 300); - $queryMock= $this->createMock(Query::class); + $queryMock = $this->createMock(Query::class); $queryMock->expects(self::once())->method('getComponent')->willReturn($this->createMock(Grouping::class)); $queryBuilderMock = $this->createMock(QueryBuilder::class); $queryBuilderMock->expects(self::once())->method('buildSearchQuery')->willReturn($queryMock); diff --git a/Tests/Unit/Domain/Site/SiteRepositoryTest.php b/Tests/Unit/Domain/Site/SiteRepositoryTest.php index 7dd4966248..ac1b96e532 100644 --- a/Tests/Unit/Domain/Site/SiteRepositoryTest.php +++ b/Tests/Unit/Domain/Site/SiteRepositoryTest.php @@ -143,7 +143,7 @@ public function canGetAllLanguages(): void ); $siteOne = $this->siteRepository->getFirstAvailableSite(); - $connections =$siteOne->getAllSolrConnectionConfigurations(); + $connections = $siteOne->getAllSolrConnectionConfigurations(); self::assertEquals([0, 2, 5], array_keys($connections), 'Could not get languages for site'); }