| Gábor Hojtsy (he/him) |
@Fathima Asmat raised this |
| Gábor Hojtsy (he/him) |
https://www.drupal.org/project/rector is the project |
| Gábor Hojtsy (he/him) |
it has various drupal 10 to 11 rules |
| Björn Brala (bbrala) |
It has quite a few, we also enabled symfony ones to make sure that is compatible.There are quite a few changes not implemented, but everything that was detected more than a handfull times has either been implemented as fix or decide to be too complex.So, still changes to make it easier for contrib, but most high impact (detecable) issues are done. |
| berdir |
I think there's the data providers, I didn't entirely grok your replies there, but I think it would at least need something to make sure those existing conversions run? (it is, afaik also not discovered yet) https://drupal.slack.com/archives/C03L6441E1W/p1717530687990169 |
| Björn Brala (bbrala) |
This could work through phpunit. |
| Björn Brala (bbrala) |
But think that is a phpunit100 rule |
| Björn Brala (bbrala) |
Let me check |
| Björn Brala (bbrala) |
image.png |
| Björn Brala (bbrala) |
I'm a little scared to enable full phpunit 10 rules, there is quite a few |
| berdir |
yeah. just at first glance I see the prophecy thing, that caused a lot of confusion alrady in the d9 => d10 update as core does in fact add that already |
| Björn Brala (bbrala) |
https://github.com/rectorphp/rector-phpunit/blob/main/config/sets/phpuni... |
| Björn Brala (bbrala) |
thats the current full list for phpunit 10 |
| Björn Brala (bbrala) |
just kinda scared if its all BC or it contains breaking changes |
| Björn Brala (bbrala) |
we could enable only the rules that we want, like static/public dataproviders for example |
| berdir |
I think that would be a good start. so far, the only thing I had to adjust were data providers |
| Björn Brala (bbrala) |
I can add those for next run, np. |
| berdir |
https://git.drupalcode.org/search?group_id=2&repository_ref=&scope=blobs... |
| Björn Brala (bbrala) |
ppearantly it doesnt trigger a deprecation error |
| Björn Brala (bbrala) |
https://dev.acquia.com/drupal11/deprecation_status/errors?category=PHPUn... |
| Björn Brala (bbrala) |
yay for runtime stuff? |
| Björn Brala (bbrala) |
So basically:https://github.com/rectorphp/rector-phpunit/blob/main/docs/rector_rules_... https://github.com/rectorphp/rector-phpunit/blob/main/docs/rector_rules_... |
| berdir |
no, it's not discovered yet |
| Björn Brala (bbrala) |
Wonder if we should add also then:Call to deprecated method setMethods() of class PHPUnit\Framework\MockObject\MockBuilder: https://github.com/sebastianbergmann/phpunit/pull/3687 |
| Björn Brala (bbrala) |
(https://dev.acquia.com/drupal11/deprecation_status/errors?category=PHPUn...) |
| berdir |
I guess that should be fine, apparently just a method rename? |
| Björn Brala (bbrala) |
yeah it is |
| Björn Brala (bbrala) |
https://github.com/palantirnet/drupal-rector/pull/307Unfortunately the docgen package keeps breaking head... :disappointed: |
| berdir |
as per berdir.so if anything goes wrong, you can just blame it on me, I see... ;) |
| Björn Brala (bbrala) |
Hahaha :smile: |
| Björn Brala (bbrala) |
Now I just need approval for that one from someone... @mglaman? :sweat_smile: ❤️ |
| mglaman |
StaticDataProviderClassMethodRector fml over so much wasted time w/o this |
| Björn Brala (bbrala) |
Always check rector first xD |
| Björn Brala (bbrala) |
https://drupal.slack.com/archives/C0100FHELV9/p1718047152357289 |
| Björn Brala (bbrala) |
Should run next run this saturday |
| Gábor Hojtsy (he/him) |
Yay! I should work on the upgrade status queue a bit later this week to get some stuff in 🙂 |
| Gábor Hojtsy (he/him) |
then fold some of the applicable things to deprecation status too |
| Björn Brala (bbrala) |
awesome 🙂 |
| Gábor Hojtsy (he/him) |
Also raised by @Fathima Asmat |
| Gábor Hojtsy (he/him) |
Issue is at[#3142908] |
| Gábor Hojtsy (he/him) |
Are there specific hooks you are looking to get covered? The best we can do is to match some naming patterns, but probably can't get too close to perfect. |
| Fathima Asmat |
Hooks like file_validate_* for example, https://api.drupal.org/api/drupal/core%21modules%21file%21file.module/fu... |
| Björn Brala (bbrala) |
@mglaman and @Kingdutch did something around that I remember.Not sure if that got merged into phpstan. |
| berdir |
file_validate_* stuff isn't actually a hook, but configured callbacks, so probably tricky to discover. deprecated calls to file_validate() themself are discovered. (edited) |
| Kingdutch |
https://github.com/mglaman/phpstan-drupal/pull/634 has been merged into PHPStan Drupal about 7 months ago (didn't realise it's been that long :sweat_smile: )So in theory if you add @deprecated to a hook implementation in module.api.php then PHPStan Drupal should start complaining.If you find that's not the case then there's a bug and we'll have to investigate :smile: |
| Kingdutch |
Ooh right, an "opt-out" was added in https://github.com/mglaman/phpstan-drupal/pull/641However, depending on how you configure PHPStan Drupal, if you don't include the bleedingEdge.neon file that it now ships then the hook deprecation checking is no longer enabled :disappointed: |
| mglaman |
Yeah, apparently those files were crashing for people :/ |
| mglaman |
Maybe we can just load ones found in core only |
| mglaman |
Two flags: one for core one for contrib, easier to opt in |
| Kingdutch |
Yeah the idealist in me feels like contrib should fix their .api.php files to be valid PHP :upside_down_face: but I see how that's not necessarily feasible.I think the only oopsie from PHPStan Drupal's side is that it was broadcast as opt-out (i.e. works by default) whereas the feature is now explicitly opt-in (i.e. nothing happens unless you do something). Which is why the above issue is still open in upgrade_status and why I'm likely also no longer using this in Open Social projects where I thought I still had it :see_no_evil: |
| Kingdutch |
If we can update documentation to show how to opt-in, then keeping a single flag for now may be enough. If any of the ~700 modules we download for Open Social contain bad .api.php files then I'd be pretty happy to file a bugfix to them :grimacing: But not sure if that solves Gàbor's problem as well. (edited) |
| mglaman |
yeah docs were out of date do to quick fix.allowing opting into core api.php solves upgrade statusallowing opting into contrib = the current flag basically |
| mglaman |
I’ll open an issue quick and link here |
| mglaman |
https://github.com/mglaman/phpstan-drupal/issues/770 |
| mglaman |
I think this summarizes the needs |
| Kingdutch |
Looks good, added two questions :smile: |
Fathima Asmat, Gábor Hojtsy, VladimirAus, Kristen Pol, bbrala, Berdir, mglaman, Kingdutch
Comments
Comment #2
gábor hojtsyComment #9
mikelutzComment #11
mikelutzComment #12
smustgrave commentedVerified threads were captured and active participants were credited.