add TypeInfo to base Generator functions - #5715
Open
Hanmac wants to merge 1 commit into
Open
Conversation
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves PHPStan type precision for shared PHPUnit data-provider traits by annotating their Generator return types with generics, and then removing now-unnecessary PHPStan baseline suppressions that were only present due to missing Generator type parameters.
Changes:
- Add
@return Generator<...>generic PHPDoc annotations to base data-provider traits (provideUrl,provideNumericString,provideIntOrNull,provideBool). - Remove corresponding
missingType.genericsbaseline ignore entries for the test classes that consume these traits.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/Traits/DataProvider/Base/UrlTrait.php | Adds PHPStan Generator generic return type info for the URL data provider. |
| tests/unit/Traits/DataProvider/Base/NumericStringTrait.php | Adds PHPStan Generator generic return type info for numeric-string provider data. |
| tests/unit/Traits/DataProvider/Base/IntOrNullTrait.php | Adds PHPStan Generator generic return type info for nullable-int provider data. |
| tests/unit/Traits/DataProvider/Base/BoolTrait.php | Adds PHPStan Generator generic return type info for boolean provider data. |
| .phpstan.dist.baselines/missingType.generics.php | Removes baseline ignores that should be resolved by the new trait annotations. |
addison74
approved these changes
Aug 1, 2026
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.



Description (*)
Small MR to add some TypeInfo to Base Generator functions
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)