Problem/Motivation

Discovered in https://www.drupal.org/pift-ci-job/2297315

core/lib/Drupal/Core/Http/InputBag.php was deleted in that patch, and this causes PHPStan to fail as it is passed the full set of changed files including deleted files:

13:17:11 Running PHPStan on changed files.
13:17:14 Path /var/www/html/core/lib/Drupal/Core/Http/InputBag.php does not exist
13:17:14 
13:17:14 PHPStan: failed

Steps to reproduce

Proposed resolution

Do not pass deleted files in the list of changes to PHPStan.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review
FileSize
533 bytes

Added a check that each file exists when setting up the ABS_FILES variable.

I tried to do this earlier when FILES is set up, you can specify git diff --diff-filter=d to skip deleted files, but git ls-files is also used in some cases which cannot do this: https://stackoverflow.com/questions/68309798/git-ls-files-modified-lists...

murilohp’s picture

The code itself looks good, but I think we should test it, I made this new test-only patch based on 3162981 patch(which is the patch that generate this issue), let's see if the patch pass now.

mallezie’s picture

Status: Needs review » Reviewed & tested by the community

Phpstan succeeds on both patches. So this change looks good to me.

  • catch committed 3a2115b on 10.0.x
    Issue #3259142 by longwave, murilohp: PHPStan commit check fails if a...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 3a2115b and pushed to 10.0.x. Thanks!

mallezie’s picture

Issue tags: +PHPStan, +PHPStan-0

Status: Fixed » Closed (fixed)

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