rectorphp / rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
https://getrector.com
MIT License
8.71k stars 687 forks source link

Downgrade are not present in setlist #6705

Closed euberdeveloper closed 3 years ago

euberdeveloper commented 3 years ago

Bug Report

Subject Details
Rector version e.g. v0.11.53 (invoke vendor/bin/rector --version)
<?php

declare(strict_types=1);

use Rector\Core\Configuration\Option;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Set\ValueObject\SetList;

return static function (ContainerConfigurator $containerConfigurator): void {
  // get parameters
  $parameters = $containerConfigurator->parameters();
  $containerConfigurator->import(SetList::DOWNGRADE_PHP74);
};

link for reproduction

Expected Behaviour

The downgrade php should exist

euberdeveloper commented 3 years ago

For now I used:

$containerConfigurator->import(__DIR__ . '/vendor/rector/rector/config/set/downgrade-php53.php');
samsonasik commented 3 years ago

You can use \Rector\Set\ValueObject\DowngradeSetList::PHP_74 value object, see https://getrector.org/demo/1ec1e4ca-e45f-6112-aa7d-3b608238bcdc

euberdeveloper commented 3 years ago

Thank you, I did not find it in the docs

samsonasik commented 3 years ago

Feel free to create PR to improve the docs at https://github.com/rectorphp/rector-src/tree/main/build/target-repository/docs , thank you.