From 5c157122881346559747de213ddea885dcec7d43 Mon Sep 17 00:00:00 2001 From: "w.utz" <w.utz@psv-neo.de> Date: Mon, 13 Jan 2025 13:21:11 +0100 Subject: [PATCH] Update/Add config files for rector and fractor --- config/fractor.php | 12 ++++++++++++ config/rector.php | 1 - config/rector2.php | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 config/fractor.php create mode 100644 config/rector2.php diff --git a/config/fractor.php b/config/fractor.php new file mode 100644 index 0000000..a3907b4 --- /dev/null +++ b/config/fractor.php @@ -0,0 +1,12 @@ +<?php + +use a9f\Fractor\Configuration\FractorConfiguration; +use a9f\Typo3Fractor\Set\Typo3LevelSetList; + +$dir = $_ENV['PWD']; + +return FractorConfiguration::configure() + ->withPaths([$dir]) + ->withSets([ + Typo3LevelSetList::UP_TO_TYPO3_13 + ]); \ No newline at end of file diff --git a/config/rector.php b/config/rector.php index 63834a8..5c409e8 100644 --- a/config/rector.php +++ b/config/rector.php @@ -15,7 +15,6 @@ use Ssch\TYPO3Rector\Set\Typo3SetList; return static function (RectorConfig $rectorConfig): void { $dir = $_ENV['PWD']; - $rectorConfig->sets([ Typo3LevelSetList::UP_TO_TYPO3_12, LevelSetList::UP_TO_PHP_81, diff --git a/config/rector2.php b/config/rector2.php new file mode 100644 index 0000000..b40ab9b --- /dev/null +++ b/config/rector2.php @@ -0,0 +1,36 @@ +<?php + +declare(strict_types=1); + +use Rector\Config\RectorConfig; +use Rector\Set\ValueObject\LevelSetList; +use Ssch\TYPO3Rector\Configuration\Typo3Option; +use Ssch\TYPO3Rector\Set\Typo3LevelSetList; +use Ssch\TYPO3Rector\Set\Typo3SetList; + +return static function (RectorConfig $rectorConfig): void { + $dir = $_ENV['PWD']; + + $rectorConfig->sets([ + Typo3LevelSetList::UP_TO_TYPO3_13, + LevelSetList::UP_TO_PHP_82, + Typo3SetList::CODE_QUALITY, + Typo3SetList::GENERAL, + Typo3SetList::TYPO3_13, + ]); + $rectorConfig->phpstanConfig(Typo3Option::PHPSTAN_FOR_RECTOR_PATH); + $rectorConfig->importNames(); + $rectorConfig->disableParallel(); + $rectorConfig->importShortClasses(false); + $rectorConfig->skip([ + $dir . '/**/Configuration/ExtensionBuilder/*', + $dir . '/Resources/*', + $dir . '/vendor/*', + $dir . '/node_modules/*', + $dir . '/Build/*', + $dir . '/public/*', + $dir . '/.github/*', + $dir . '/.Build/*', + $dir . '/.idea/*', + ]); +}; -- GitLab