Active
Project:
Drupal core
Version:
main
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2026 at 01:15 UTC
Updated:
11 Oct 2026 at 16:14 UTC
Jump to comment: Most recent
Update to PHPSTan 2.2.14 and there are new errors. The workaround is that they are ignored in phpstan.neon.dist.
------ -------------------------------------------------------------------------------------------
Line core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
------ -------------------------------------------------------------------------------------------
68 A file could not be loaded from Drupal\Core\Extension\ModuleHandlerInterface::loadInclude
🪪 loadIncludes.fileNotLoadable
------ -------------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------
Line core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php
------ -------------------------------------------------------------------------------------------
52 A file could not be loaded from Drupal\Core\Extension\ModuleHandlerInterface::loadInclude
🪪 loadIncludes.fileNotLoadable
------ -------------------------------------------------------------------------------------------
Fix the error ;-)
Remove the @todo in phpstan.neon.dist
Review
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 #2
catchThis was failing at random after we updated phpstan (before it got reverted) so it may be an upstream bug in phpstan.
For Drupal 13 this code will go so it's a temporary situation either way.
Comment #3
leandro713 commentedThe issue identifies the two PHPStan violations, but the proposed resolution is currently open.
Would the expected approach be to move the required setup logic from
entity_test_install()into a reusable method in EntityTestHelper, and then call that method from both the install hook and the two affected tests?Alternatively, is there a smaller or preferred solution for avoiding the dynamic
loadInclude()calls?Should this change be developed against main, or tested against the PHPStan 2.2.14 branch from #3621326 until that issue is committed?
Comment #6
mondrakeI think the problem is somewhere in mglaman/phpstan-drupal, not in phpstan itself. At least, I can only see this error identifier only here https://github.com/mglaman/phpstan-drupal/blob/99d198489a50bf5a654187bf2...
Comment #7
mondrakeOpened https://github.com/mglaman/phpstan-drupal/issues/1062 upstream.