Repository navigation
Add array value types to form, plugin, widget and views stubs - #1097
Open
giuseppe-esposito-87 wants to merge 3 commits into
Open
giuseppe-esposito-87 wants to merge 3 commits into
giuseppe-esposito-87 wants to merge 3 commits into
Conversation
Methods that inherit their PHPDoc with {@inheritdoc} from these core
classes and interfaces now get typed array parameters and return values,
so level 6+ no longer reports a missing iterable value type for them.
Covers forms, plugin forms, plugin create() and constructors, field
widgets and formatters, field items, entity list builders, entity forms,
access control handlers, derivers, typed data and views plugins. Empty
stubs are added for the classes these stubs reference so StubTest passes.
Assisted-by: claude-code/claude-opus-5-5
giuseppe-esposito-87
marked this pull request as draft
November 11, 2026 10:46
Core returns values from some validateForm(), submitForm() and submitConfigurationForm() implementations, for example ContentEntityForm::validateForm() returns the entity. A void return type in the stubs reported those as errors, so the stubs no longer declare these methods. Assisted-by: claude-code/claude-opus-5-5
Core passes PluginDefinitionInterface objects to derivers of object-based plugin types such as layouts, as DeriverInterface documents. Assisted-by: claude-code/claude-opus-5-5
giuseppe-esposito-87
marked this pull request as ready for review
November 11, 2026 11:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds array value types to the stubs of common Drupal form, plugin, field and views APIs. Methods that implement them with
{@inheritdoc}no longer report "no value type specified in iterable type array", so projects do not need to ignoremissingType.iterableValuefor them.FormInterface,ConfigFormBaseTrait,PluginFormInterface,EntityFormandEntityFormInterface.create(), plugin constructors,ConfigurableInterfaceandDeriverInterface.FieldItemInterfaceandPluginSettingsInterface.Empty stubs are added for the core and Symfony classes these stubs reference, so the stub validation test passes.
Behavior note:
validateConfigurationForm()and the viewsbuildOptionsForm()are typed@return void, matching core.validateForm(),submitForm()andsubmitConfigurationForm()are not stubbed, because some core implementations return values from them.PHPUnit, PHPCS and PHPStan pass with PHP 8.4 and Drupal 11.4. The new rule test fails without these stubs and passes with them.
Core baseline check: it fails only because core's baseline no longer matches. 271 entries are errors these stubs fix, and 14 are existing errors whose message now reads
array<mixed>instead ofarray. A local run against core HEAD shows no other new errors.