From f18faf63ea97f66758ce62c02b87198a35208f21 Mon Sep 17 00:00:00 2001 From: Tim Weisenberger Date: Thu, 1 Feb 2024 14:02:03 +0100 Subject: [PATCH] fix: Ensure that callback definitions are not converted into closures, as closures can break the rendering of the configuration module in the TYPO3 backend --- ext_localconf.php | 5 ++++- rector.php | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ext_localconf.php b/ext_localconf.php index 30e1f94..f7cef8f 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -20,5 +20,8 @@ ] ], ]; - $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['defaultFilterCallbacks'][GeneratedFileNamesFilter::class] = GeneratedFileNamesFilter::filterGeneratedFiles(...); + $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['defaultFilterCallbacks'][GeneratedFileNamesFilter::class] = [ + GeneratedFileNamesFilter::class, + 'filterGeneratedFiles' + ]; })(); diff --git a/rector.php b/rector.php index f80890b..8f4ca9b 100644 --- a/rector.php +++ b/rector.php @@ -2,10 +2,12 @@ declare(strict_types=1); +use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector; use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector; +use Rector\Php81\Rector\Array_\FirstClassCallableRector; use Rector\PHPUnit\Set\PHPUnitLevelSetList; use Rector\PostRector\Rector\NameImportingPostRector; use Rector\Set\ValueObject\LevelSetList; @@ -96,6 +98,12 @@ $rectorConfig->skip([ // PHP AddLiteralSeparatorToNumberRector::class, + FirstClassCallableRector::class => [ + 'ext_localconf.php', + ], + CallableThisArrayToAnonymousFunctionRector::class => [ + 'ext_localconf.php', + ], // TYPO3 // @see https://github.com/sabbelasichon/typo3-rector/issues/2536