Skip to content
generated from ghostwriter/wip

[WIP] Rector upgrade rules for PHP frameworks, libraries, and tools.

License

Notifications You must be signed in to change notification settings

ghostwriter/revamp

Repository files navigation

Revamp

Automation Supported PHP Version GitHub Sponsors Code Coverage Type Coverage Psalm Level Latest Version on Packagist Downloads

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.

Installation

You can install the package via composer:

composer require rector/rector --dev
composer require ghostwriter/revamp --dev

Usage

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)
    ]);

Credits

Changelog

Please see CHANGELOG.md for more information on what has changed recently.

License

Please see LICENSE for more information on the license that applies to this project.

Security

Please see SECURITY.md for more information on security disclosure process.

About

[WIP] Rector upgrade rules for PHP frameworks, libraries, and tools.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages