phpstan-drupal
phpstan-drupal copied to clipboard
Allow configuration of installed modules for inspection
Currently, this extension loads all available modules. In reality, we should be allowed to limit the scope of this.
This would require moving the bootstrap process into the container somehow, so the list of modules can be provided as a parameter
. If its empty we can assume "all of the things."
This is harder than it seems. The Extension class has no method of tracking dependencies.
It is actually parsed in \Drupal\Core\Extension\ModuleExtensionList::doList. Somehow, somewhere the extension has a magical info
property info, which is the parsed YAML.
Then in \Drupal\Core\Extension\ModuleHandler::buildModuleDependencies the dependencies are discovered.
Without this feature bugs in core like this one https://www.drupal.org/project/drupal/issues/3020142 causes an error, with this feature the modules won't be loaded :)
This can be achieved with https://github.com/mglaman/phpstan-drupal/issues/343.