Commit d4f2894a authored by Oliver Klee's avatar Oliver Klee
Browse files

[WIP]

parent 04d8ffed
......@@ -15,4 +15,5 @@
/phive.xml
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/rector.php
/tools/ export-ignore binary
<?php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Ssch\TYPO3Rector\Configuration\Typo3Option;
use Ssch\TYPO3Rector\PostRector\NameImportingPostRector;
use Ssch\TYPO3Rector\Rector\v9\v0\InjectAnnotationRector;
use Ssch\TYPO3Rector\Set\Typo3SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
// get parameters
$parameters = $containerConfigurator->parameters();
// Define what rule sets will be applied
$parameters->set(Option::SETS, [
Typo3SetList::TYPO3_95,
]
);
// FQN classes are not imported by default. If you don't do it manually after every Rector run, enable it by:
$parameters->set(Typo3Option::AUTO_IMPORT_NAMES, true);
// this will not import root namespace classes, like \DateTime or \Exception
$parameters->set(Option::IMPORT_SHORT_CLASSES, false);
// this will not import classes used in PHP DocBlocks, like in /** @var \Some\Class */
$parameters->set(Option::IMPORT_DOC_BLOCKS, false);
// Define your target version which you want to support
$parameters->set(Option::PHP_VERSION_FEATURES, '7.2');
// If you would like to see the changelog url when a rector is applied
$parameters->set(Typo3Option::OUTPUT_CHANGELOG, true);
// If you set option Typo3Option::AUTO_IMPORT_NAMES to true, you should consider excluding some TYPO3 files.
$parameters->set(Option::SKIP, [
NameImportingPostRector::class => [
'ClassAliasMap.php',
'class.ext_update.php',
'ext_localconf.php',
'ext_emconf.php',
'ext_tables.php',
__DIR__ . '/**/TCA/*',
],
]
);
// If you have trouble that rector cannot run because some TYPO3 constants are not defined add an additional constants file
// Have a look at https://github.com/sabbelasichon/typo3-rector/blob/master/typo3.constants.php
$parameters->set(Option::AUTOLOAD_PATHS, [
__DIR__ . '/typo3.constants.php'
]
);
// get services (needed for register a single rule)
// $services = $containerConfigurator->services();
// register a single rule
// $services->set(InjectAnnotationRector::class);
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment