From 1f765779b5245da82b573cbbf1f7df910dcbe410 Mon Sep 17 00:00:00 2001 From: Ingo Pfennigstorf Date: Wed, 8 Jan 2025 10:43:26 +0100 Subject: [PATCH] Fix uninitualized variable --- Classes/Controller/SearchController.php | 2 +- Classes/ViewHelpers/Find/PageListViewHelper.php | 6 ++---- rector.php | 16 +++++++--------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Classes/Controller/SearchController.php b/Classes/Controller/SearchController.php index 84d07d2c..fef932d3 100644 --- a/Classes/Controller/SearchController.php +++ b/Classes/Controller/SearchController.php @@ -158,7 +158,7 @@ protected function addStandardAssignments(): void $this->searchProvider->setConfigurationValue('extendedSearch', $this->searchProvider->isExtendedSearch()); $this->searchProvider->setConfigurationValue( 'uid', - $this->configurationManager->getContentObject()->data['uid'] + $this->request->getAttribute('currentContentObject')->data['uid'] ); $this->searchProvider->setConfigurationValue('prefixID', 'tx_find_find'); $this->searchProvider->setConfigurationValue('pageTitle', $GLOBALS['TSFE']->page['title']); diff --git a/Classes/ViewHelpers/Find/PageListViewHelper.php b/Classes/ViewHelpers/Find/PageListViewHelper.php index 48f2d32e..6205a499 100644 --- a/Classes/ViewHelpers/Find/PageListViewHelper.php +++ b/Classes/ViewHelpers/Find/PageListViewHelper.php @@ -47,14 +47,11 @@ public function initializeArguments() $this->registerArgument('minimumGapSize', 'int', 'gaps of fewer items than this are filles', false, 2); } - /** - * @return array - */ public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext, - ) { + ): array { $currentPage = ($arguments['currentPage'] ? (int) $arguments['currentPage'] : 1); $numberOfPages = (int) ceil($arguments['resultCount'] / $arguments['perPage']); $adjacentPages = (int) $arguments['adjacentPages']; @@ -63,6 +60,7 @@ public static function renderStatic( $minimumGapSize = (int) $arguments['minimumGapSize']; $pageIndex = 1; + $pages = []; while ($pageIndex <= $numberOfPages) { $pageInfo = ['number' => $pageIndex, 'current' => false, 'gap' => false]; diff --git a/rector.php b/rector.php index 2ca6214e..3114bc4b 100644 --- a/rector.php +++ b/rector.php @@ -6,23 +6,21 @@ use Rector\Set\ValueObject\SetList; use Ssch\TYPO3Rector\Set\Typo3LevelSetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([ +return RectorConfig::configure()->withPaths( + [ __DIR__.'/Classes', __DIR__.'/Tests', __DIR__.'/Configuration', __DIR__.'/Resources', __DIR__.'/*.php', - ]); - - $rectorConfig->skip([__DIR__.'/.Build/vendor', + ] +) + ->withSkip([__DIR__.'/.Build/vendor', __DIR__.'/var', - __DIR__.'/*.cache', ]); - - $rectorConfig->sets([ + __DIR__.'/*.cache', ]) + ->withSets([ SetList::PHP_83, Typo3LevelSetList::UP_TO_TYPO3_12, SetList::CODE_QUALITY, SetList::CODING_STYLE, ]); -};