Prefixed Rector by Default

This feature is available since Rector 0.11.

Today we're introducing a big step up in making Rector developer experience more smooth and intuitive. It will also ease development for Rector contributors. We won't have to think about dependencies in composer.json anymore.

Are these goals in contradiction? Quite the contrary.

This move was inspired by PHPStan 0.12 development and release repository setup.

The prefixed version allows to use of Rector on an older version than Rector is being developed. E.g., if you need to refactor your project on 7.1.

If you have symfony/console 2.8 and wanted to install rector/rector on your project, it would fail:

composer require symfony/console:2.8
composer require rector/rector --dev

That's where prefixed version helps too.

composer require symfony/console:2.8
composer require rector/rector-prefixed --dev

The ultimate problem with this setup is a terrible user experience [with hidden knowledge](@todo memory lock post). As a user, I don't want to think about different names for the same package. Would you install symfony/console or symfony/console-prefixed based on conflicts on install? No.

Single Distribution Package

We knew this must be a single way to install Rector:

composer require symfony/console:2.8
composer require rector/rector --dev

In April and May we've been working hard to make rector/rector-prefixed experience identical to rector/rector. It included:

Last big change was a repository switch. The original rector/rector repository will become development only and will be replecated with distribution rector/rector-prefixe repository:

  • rector/rector-prefixedrector/rector - the distribution repository
  • rector/rectorrector/rector-src - the development repository
  • deprecate rector/rector-prefixed and suggest rector/rector as replacement

How to Upgrade?

The next version is still in progress and will be released in May 2021. We're now testing the dev version to ensure there are no glitches when the stable tag is out.

There are 2 ways to upgrade, depending on which version you use.

For prefixed version:

composer remove rector/rector-prefixed
composer require rector/rector:^0.11 --dev

For normal version:

composer update rector/rector:^0.11 --dev

From now on, every next Rector release will be under rector/rector package name. One less thing to worry about before you instantly upgrade your code.


Happy coding!