Problem/Motivation

PHPStan 1.9.2 was released.

Looking at the "updated deps" TestBot runs lately we can see there's an issue, probably caused by issue https://github.com/phpstan/phpstan/issues/8113 and "fixed" in PR https://github.com/phpstan/phpstan-src/pull/1987.

Running PHPStan on *all* files.
 ------ ----------------------------------------------------------------------- 
  Line   core/modules/config/tests/src/Functional/ConfigImportInstallProfileTe  
         st.php                                                                 
 ------ ----------------------------------------------------------------------- 
  72     Cannot unset offset 'syslog' on array{testing_config_import: 0}.       
  73     Cannot unset offset 'theme' on array{module:                           
         array{testing_config_import: 0}}.                                      
 ------ ----------------------------------------------------------------------- 


 [ERROR] Found 2 errors                           

Steps to reproduce

Proposed resolution

By "simply" moving the line $core['module']['testing_config_import'] = 0; from line 71 down to 73, so after the unsets PHPStan is complaining about, everything passes locally.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3321779-2.patch3.2 KBspokje

Comments

Spokje created an issue. See original summary.

spokje’s picture

StatusFileSize
new3.2 KB
spokje’s picture

Status: Active » Needs review
longwave’s picture

PHPStan has an extremely frequent release cycle and I'm not sure it is worthwhile chasing the updates. Maybe we should hold off on this until closer to Drupal 10.0.0? We should do a final round of updates in the first half of December, in preparation for the release.

spokje’s picture

I don't mind, but this time the update breaks the 'updated deps' daily run on 10.0.x and 10.1.x auto-test.
See https://www.drupal.org/pift-ci-job/2522957 and https://www.drupal.org/pift-ci-job/2522960.

If that's OK with everyone, I'm all for not updating.

mondrake’s picture

Well, maybe the fix itself, without the PHPStan bump, could be done anyway? Supported by the PHPStan report of the error on the updated version?

In the end, it's all about cleaning our code :)

longwave’s picture

Status: Needs review » Reviewed & tested by the community

I guess as this breaks the updated deps test then we should commit this fix, and we might as well bump the locked version while we are here.

  • catch committed 19788b9 on 10.0.x
    Issue #3321779 by Spokje, longwave, mondrake: Update PHPStan to 1.9.2
    
    (...
  • catch committed e7e25dd on 10.1.x
    Issue #3321779 by Spokje, longwave, mondrake: Update PHPStan to 1.9.2
    
catch’s picture

Version: 10.1.x-dev » 10.0.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.