My personal configuration for Rector

3.0.1 2024-02-14 17:21 UTC


Coverage Maintainability CGL Tests Supported PHP Versions

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

Packagist Packagist Downloads

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(

    // Skip specific paths

    // Include default PHPUnit sets

    // Include default Symfony sets

    // Include default TYPO3 sets

    // Include custom sets
        new CustomSet(

    // Skip specific rectors

    // Apply configuration

⭐ License

This project is licensed under GNU General Public License 3.0 (or later).