Rector upgrade rules for PHP frameworks, libraries, and tools.
Note
Star ⭐ this repo if you find it useful.
Warning
This project is not finished yet, work in progress.
You can install the package via composer:
composer require rector/rector --dev
composer require ghostwriter/revamp --dev
To add a rule or set to your config, with package version constants:
Ghostwriter\Revamp\Rule\Vendor\Package\Rector
Ghostwriter\Revamp\SetList\Vendor\Package\SetList
<?php
declare(strict_types=1);
use Ghostwriter\Revamp\Rule\Vendor\Package\LaminasRector;
use Ghostwriter\Revamp\Rule\Vendor\Package\MezzioRector;
use Ghostwriter\Revamp\Rule\Vendor\Package\MockeryRector;
use Ghostwriter\Revamp\Rule\Vendor\Package\PHPUnitRector;
use Ghostwriter\Revamp\Rule\Vendor\Package\PsalmRector;
use Ghostwriter\Revamp\Rule\Vendor\Package\PsrRector;
use Ghostwriter\Revamp\Rule\Vendor\Package\RectorRector;
use Ghostwriter\Revamp\SetList\Vendor\Package\MezzioSetList;
use Ghostwriter\Revamp\SetList\Vendor\Package\MockerySetList;
use Ghostwriter\Revamp\SetList\Vendor\Package\PHPUnitSetList;
use Ghostwriter\Revamp\SetList\Vendor\Package\PsalmSetList;
use Ghostwriter\Revamp\SetList\Vendor\Package\PsrSetList;
use Ghostwriter\Revamp\SetList\Vendor\Package\SetList;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
LaminasRector::class,
MezzioRector::class,
MockeryRector::class,
PHPUnitRector::class,
PsalmRector::class,
PsrRector::class,
RectorRector::class,
])
->withSets([
/**
* `*SetList::version(int $major, int $minor): string` method
*
* - To upgrade to a specific installed version of a package, use the version() method
* with the major and minor version numbers.
*
* - To use the latest installed version, use the version() method without arguments.
*/
LaminasSetList::version(), // Laminas (latest)
MezzioSetList::version(3, 20), // Mezzio 3.20
MockerySetList::version(), // Mockery (latest)
PHPUnitSetList::version(11, 4), // PHPUnit 11.4
PsalmSetList::version(5, 21), // Psalm 5.21
PsrSetList::version(), // Psr (latest)
RectorSetList::version(), // Rector (latest)
]);
Please see CHANGELOG.md for more information on what has changed recently.
Please see LICENSE for more information on the license that applies to this project.
Please see SECURITY.md for more information on security disclosure process.