Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Adding UserCreationTrait to a test is currently very frustrating as the phpstan baseline has to change - see https://www.drupal.org/pift-ci-job/2516459
The same goes for AssertMailTrait.
Proposed resolution
Fix the traits and baseline
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
N/a
Comment | File | Size | Author |
---|---|---|---|
#5 | 3319683-10.0.x-3.patch | 77.46 KB | alexpott |
| |||
#5 | 3319683-3.patch | 76.77 KB | alexpott |
| |||
#2 | 3319683-2.patch | 64.7 KB | alexpott |
|
Comments
Comment #2
alexpottComment #3
mondrakeGood for 10.1.x, will need porting to 10.0
Comment #4
mondrakeComment #5
alexpottWidening the scope slightly to incorporate the other trait that causes issues like this. Crediting @mondrake since this is similar to the work in #3319582: Fix calls to methods with too many parameters passed in
And have patches for both 10.0.x and 10.1.x
Comment #6
alexpottNow that we have PHPStan level 1 any calls to assertMailString that have 4 arguments will produce an error - so we don't need to trigger a deprecation here.
As above.
Comment #7
alexpottThis patch shrinks core/phpstan-baseline.neon from 199K to 150K... not bad.
Comment #8
mallezieBoth patches look good to me. (Awaiting tests offcourse).
Both code and comments updated, Baseline removals are all in scope, nothing unexpected here. So RTBC.
Changes are small (and same on both patches). And they clean up a nice chunk in the baseline.
Comment #9
mallezieDon't we need the deprecation for contrib / custom testing using this trait?
Comment #10
mallezieSince PHP allows you to pass in as many extra params as you like this will not break any other contrib / custom code using this parameter. (Thanks @alexpott for explaining).
Solves my remark.
Comment #12
catchCommitted/pushed the respective patches to 10.1.x and 10.0.x, thanks!
Comment #13
mondrakeOpened #3322986: Missed removing a $group parameter from AssertMailTrait to fix a straggler.