phpstan-drupal icon indicating copy to clipboard operation
phpstan-drupal copied to clipboard

Allow configuration of installed modules for inspection

Open mglaman opened this issue 6 years ago • 3 comments

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."

mglaman avatar Dec 19 '18 21:12 mglaman

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.

mglaman avatar Dec 20 '18 03:12 mglaman

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 :)

morsok avatar Jan 09 '19 12:01 morsok

This can be achieved with https://github.com/mglaman/phpstan-drupal/issues/343.

mglaman avatar Feb 24 '22 05:02 mglaman