Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Rector Config Laravel Package

eliashaeussler/rector-config

Opinionated, reusable Rector configuration for PHP/Laravel projects. Provides curated rule sets and sensible defaults to quickly add automated refactoring and code upgrades, with easy integration into existing Rector setups.

View on GitHub
Deep Wiki
Context7

Rector config

Coverage 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(
        __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).

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport