Skip to content

make LevelOptionResolver smarter#1521

Merged
TomasVotruba merged 3 commits intomasterfrom
level-nice
Jun 1, 2019
Merged

make LevelOptionResolver smarter#1521
TomasVotruba merged 3 commits intomasterfrom
level-nice

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jun 1, 2019

Closes #1518

There are now the same:

vendor/bin/rector process src --level symfony40
vendor/bin/rector process src --level Symfony40
vendor/bin/rector process src --level Symfony4.0
vendor/bin/rector process src --level Symfony.40
vendor/bin/rector process src --level symfony-40

New --set option

Added --set alias to --level

These are now equalivalent:

vendor/bin/rector process src --level symfony40
vendor/bin/rector process src --set symfony40

/cc @jkuchar

@TomasVotruba TomasVotruba merged commit 493ca3d into master Jun 1, 2019
@TomasVotruba TomasVotruba deleted the level-nice branch June 1, 2019 09:15
@jkuchar
Copy link
Copy Markdown
Contributor

jkuchar commented Jun 1, 2019

Much better! 🙂

@TomasVotruba
Copy link
Copy Markdown
Member Author

👍

I already used in the conference and people understood it better, thanks for the feedback

@jkuchar
Copy link
Copy Markdown
Contributor

jkuchar commented Jun 1, 2019

It was pleasure to contribute to this awesome project!

@TomasVotruba
Copy link
Copy Markdown
Member Author

Better send some PR with DDD :)

@tormi
Copy link
Copy Markdown

tormi commented Nov 5, 2020

--set doesn't work ATM with Rector v. 0.8.48, gives The "--set" option does not exist..

@TomasVotruba
Copy link
Copy Markdown
Member Author

TomasVotruba commented Nov 5, 2020

We got feedback on overlapping of these options and rector.php config ones. Also the set resolution was not warking correctly alwasy, ast php70 got magically resolved to PHP_70. Also the set option could not be used 3rd party packages.

Saying that, we decided to remove --set and prefer config, where constants can be used:

<?php

declare(strict_types=1);

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

return static function (ContainerConfigurator $containerConfigurator): void {
    $parameters = $containerConfigurator->parameters();

    $parameters->set(Option::SETS, [
        SetList::SYMFONY_40,
    ]);
};

@tormi
Copy link
Copy Markdown

tormi commented Nov 5, 2020

@TomasVotruba, thanks for the quick update, really appreciate it! However, there are some leftovers in the codebase, especially in the documentation remained: https://github.com/rectorphp/rector/search?q=%22--set%22

@TomasVotruba
Copy link
Copy Markdown
Member Author

I see. Could I kindly ask you to update those?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DX] be open to various level format

3 participants