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

Validate FormBuilderInterface::getForm() arguments by inspecting form class

Open andriokha opened this issue 1 year ago • 1 comments

Feature request

While https://www.drupal.org/node/3432087 should improve phpstan processing of FormBuilderInterface::getForm(), it'd be great if we could use the first argument to look up what other arguments are valid.

For example when analyzing the following

$this->formBuilder->getForm(EntityModerationForm::class, $entity);

The correct number and types of arguments can be found by inspecting EntityModerationForm::buildForm().

andriokha avatar Apr 28 '24 09:04 andriokha

This may also be relevant: https://www.drupal.org/project/drupal/issues/3431285

nlighteneddesign avatar Apr 29 '24 14:04 nlighteneddesign