Problem/Motivation
The (recently revived) updated-deps daily GitLab CI job on 11.x fails PHPStan with a cheery:
------ ---------------------------------------------------------------------------------
Line core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php
------ ---------------------------------------------------------------------------------
132 Variable $test_meta in empty() always exists and is not falsy.
153 Variable $test_meta in empty() always exists and is not falsy.
------ ---------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------
Line core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
------ ----------------------------------------------------------------------------------
Ignored error pattern #^Variable \$depth_count might not be
defined\.$# in path
/builds/project/drupal/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
was not matched in reported errors.
------ ----------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------------------
Line core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
------ ----------------------------------------------------------------------------------------------------------
Ignored error pattern #^Variable \$entity might not be defined\.$# in
path
/builds/project/drupal/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
was not matched in reported errors.
------ ----------------------------------------------------------------------------------------------------------
[ERROR] Found 4 errors
Steps to reproduce
Look at the output of the scheduled runs (https://git.drupalcode.org/project/drupal/-/pipeline_schedules) and look at the update-deps jobs
The above failure can be seen at https://git.drupalcode.org/project/drupal/-/jobs/1090935
Proposed resolution
- Bump phpstan/phpstan-phpunit
to its latest version (currently 1.3.16
)
- Create new PHPStan baseline ($ vendor/bin/phpstan analyze --configuration=core/phpstan.neon.dist --generate-baseline core/.phpstan-baseline.php
)
- Set version constraint of phpstan/phpstan-phpunit
to its latest version in composer.*
, since the new PHPStan baseline wont pass in any lower version.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3431227
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
SpokjeComment #4
longwaveThanks @Spokje for keeping up with this.
Comment #5
longwaveThink we should also backport this to 10.3.x if we can.
Comment #7
alexpottCommitted 7de259e and pushed to 11.x. Thanks!
Committed fcabbe1 and pushed to 10.3.x. Thanks!
Backported to 10.3.x by carrying out the step in the issue summary on 10.3.x and comparing the diffs.