Update code with rector
05. April 2022
05. April 2022
After the core upgrade (e.g. from 7.6 to 11.5), you can continue with your old extension code. Rector is a good tool for this.
https://github.com/rectorphp/rector
https://github.com/sabbelasichon/typo3-rector/blob/main/docs/best_practice_guide.md
composer require-dev ssch/typo3-rector
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Ssch\TYPO3Rector\Set\Typo3LevelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/packages/zwbisdrei_config',
]);
$rectorConfig->sets([Typo3LevelSetList::UP_TO_TYPO3_11]);
$rectorConfig->phpVersion(PhpVersion::PHP_74);
};
vendor/bin/rector --dry-run
vendor/bin/rector