Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upgrade for rename getUsername to getUserIdentifier #7

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented May 24, 2022

This will already rename the sulu users getUsername to getUserIdentifier.

Try out this PR by copy following in your unix shell:

Upgrade for: sulu/sulu#6626

git clone [email protected]:sulu/sulu-rector.git
cd sulu-rector/
git remote add alex [email protected]:alexander-schranz/sulu-rector.git
git fetch alex
git checkout feature/replace-user-name-with-user-identifier-method
composer install
composer test

@alexander-schranz
Copy link
Member Author

I don't get why this is failing in the CI 🤔 it seems to work correctly locally.

@alexander-schranz
Copy link
Member Author

alexander-schranz commented May 24, 2022

@TomasVotruba Sorry for pinging you but I'm little bit lost again. Do you have any hint what is going wrong here? It works locally for me:

git clone [email protected]:sulu/sulu-rector.git
cd sulu-rector/
git remote add alex [email protected]:alexander-schranz/sulu-rector.git
git fetch alex
git checkout feature/replace-user-name-with-user-identifier-method
composer install
composer test

but the rule just don't work in the CI which is very strange. Even checked if the CI installs other dependencies but they are the same. Also did cat the files the looks also correclty in the CI not sure what is going wrong here. Even updated the composer install actions still the rule test does not work in the CI.

@TomasVotruba
Copy link
Contributor

TomasVotruba commented May 25, 2022

I've just tested for a while locally to find this fix: rectorphp/rector-src@cbebb9a

Basically this rename would break parent interface contract. Untill the Symfony require parent interface, the method rename would cause a BC break:

public function getUsername();

Yet, in this case, the change could be done in an interface 👍 I'll see if we can improve it

@TomasVotruba
Copy link
Contributor

This should help: rectorphp/rector-src#2362

Could you try rector dev-main?

@TomasVotruba
Copy link
Contributor

See #8

@alexander-schranz alexander-schranz force-pushed the feature/replace-user-name-with-user-identifier-method branch from eb5bb87 to 888eb72 Compare May 27, 2022 08:03
@alexander-schranz alexander-schranz deleted the feature/replace-user-name-with-user-identifier-method branch May 27, 2022 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new upgrade rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants