eliashaeussler / rector-config
My personal configuration for Rector
Installs: 246 118
Dependents: 13
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 1
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0
- composer-runtime-api: ^2.0
- rector/rector: ^1.2.9
Requires (Dev)
- armin/editorconfig-cli: ^1.8 || ^2.0
- composer/composer: ^2.0
- eliashaeussler/php-cs-fixer-config: ^2.0
- eliashaeussler/phpstan-config: ^2.0
- eliashaeussler/phpunit-attributes: ^1.0
- ergebnis/composer-normalize: ^2.30
- illuminate/container: ^10.39 || ^11.0
- phpstan/extension-installer: ^1.2
- phpunit/phpunit: ^10.4 || ^11.0
- ssch/typo3-rector: ^2.0
- symfony/config: ^5.4 || ^6.0 || ^7.0
- typo3/cms-core: ^12.4 || ^13.0
Suggests
- ssch/typo3-rector: Configures additional Rector rules for TYPO3 CMS projects (^2.0)
README
Rector config
This package contains basic Rector config for use in my personal projects. It is not meant to be used anywhere else. I won't provide support and don't accept pull requests for this repo.
🔥 Installation
composer require --dev eliashaeussler/rector-config
⚡ Usage
# rector.php use EliasHaeussler\RectorConfig\Config\Config; use EliasHaeussler\RectorConfig\Set\CustomSet; use Rector\Config\RectorConfig; use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; use Rector\Set\ValueObject\SetList; use Rector\ValueObject\PhpVersion; return static function (RectorConfig $rectorConfig): void { // Optional: Configure PHP version explicitly // Can be left out to use the current environment's PHP version $phpVersion = PhpVersion::PHP_81; // Create config from Rector config object $config = Config::create($rectorConfig, $phpVersion)->in( __DIR__.'/src', __DIR__.'/tests', ); // Skip specific paths $config->not( __DIR__.'/src/lib', __DIR__.'/tests/test-application/vendor', ); // Include default PHPUnit sets $config->withPHPUnit(); // Include default Symfony sets $config->withSymfony(); // Include default TYPO3 sets $config->withTYPO3(); // Include custom sets $config->withSets( new CustomSet( SetList::CODE_QUALITY, SetList::CODING_STYLE, ), ); // Skip specific rectors $config->skip( AnnotationToAttributeRector::class, [ __DIR__.'/src/Some/File.php', ], ); // Apply configuration $config->apply(); };
⭐ License
This project is licensed under GNU General Public License 3.0 (or later).