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

Update to PHPstan 2 and Rector 2 #312

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

ptmkenny
Copy link

@ptmkenny ptmkenny commented Dec 12, 2024

Description

Updates to Rector 2 + PHPStan 2

To Test

  • Not ready yet; Rector 2 has not been released (currently rc3; wanted to get this going to test how much work is needed to update)

Drupal.org issue

https://www.drupal.org/project/rector/issues/3493467

@ptmkenny ptmkenny changed the title update to rector 2.0-rc2 and bump phpstan dependencies to 2.x update to rector 2.0-rc and bump phpstan dependencies to 2.x Dec 12, 2024
@Holo96
Copy link

Holo96 commented Jan 6, 2025

Rector has stable release, can we merge this now?

@bbrala
Copy link
Collaborator

bbrala commented Jan 6, 2025

This could be merged, but needs updating i think in regards to the version numbers it seems, we'd want to work from stable right?

@Holo96
Copy link

Holo96 commented Jan 6, 2025

Yes, and I think PHP ^7.4 is supported, so change in .github/workflows/functional_test__rector_examples.yml is not needed
Also releasing Drupal rector 2.0 should be considered, following rector 2.0 and also phpstan-drupal 2.0

@ptmkenny
Copy link
Author

ptmkenny commented Jan 6, 2025

I bumped the rector dependency to ^2.0.

I agree with @Holo96 that it would be nice to have drupal-rector 2.0 to match phpstan-drupal 2.0 and rector 2.0.

Maintainers, please feel free to edit this MR however you like; as stating in the first post, I opened this as an experiment to test the feasibility of moving to phpstan 2.0.

@bbrala bbrala changed the title update to rector 2.0-rc and bump phpstan dependencies to 2.x Update to phpsatn 2.0 Jan 24, 2025
@bbrala bbrala changed the title Update to phpsatn 2.0 Update to PHPstan 2 and Rector 2 Jan 24, 2025
@bbrala
Copy link
Collaborator

bbrala commented Jan 24, 2025

Ok, i did some things to make compativbility happen.

Right now it tests on 1 and 2, since it seems that might juist be possibel. Unfortunately it seems that AnnotationToAttribute rector breaks in phpstan 2 right now. There might be more breaking tests.

I'm considering also to drop Drupal8 support, but not sure yet if that is needed.

@bbrala
Copy link
Collaborator

bbrala commented Jan 24, 2025

Fixed a few more things thta were weird. Only real issue remaining is the broken AnnotationToAttributeRector

@bbrala bbrala requested a review from mglaman January 31, 2025 15:31
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.

3 participants