- πΊπ¦Ukraine mostepaniukvm
I've faced similar issues.
Project widely usesmodule_load_include()
I replaced it with\Drupal::moduleHandler()->loadInclude()
and it solved most of the problems.However, when dealing with multiple nested includes, PHPStan throws an exception: "\Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container."
As result, in "LOCAL SCAN RESULT" column of upgrade-status report I see reported problem with message: "A file could not be loaded from Drupal\Core\Extension\ModuleHandlerInterface::loadInclude"
- ππΊHungary GΓ‘bor Hojtsy Hungary
@mostepaniukvm you mean your scanned project code uses module_load_include()? (Upgrade Status does not). I think phpstan-drupal is supposed to work around this by providing a mock container.
- πΊπ¦Ukraine mostepaniukvm
Yes, it's client's project was using tons of module_load_include()
I was using latest phpstan-drupal 1.2.0
I agree that it sounds like phpstan-drupal problem and not upgrade_status.
Will test again, describe steps and report issue to phpstan-drupal - π¦πΉAustria maxilein
I'd like to add something I believe could be connected
https://www.drupal.org/project/upgrade_status/issues/3481662 π¬ Phpstan failed Active