Skip to content

add TypeInfo to base Generator functions - #5715

Open
Hanmac wants to merge 1 commit into
OpenMage:mainfrom
Hanmac:baseProvider
Open

add TypeInfo to base Generator functions#5715
Hanmac wants to merge 1 commit into
OpenMage:mainfrom
Hanmac:baseProvider

Conversation

@Hanmac

@Hanmac Hanmac commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description (*)

Small MR to add some TypeInfo to Base Generator functions

Related Pull Requests

  • see OpenMage/magento-lts#<issue_number>

Fixed Issues (if relevant)

  • fixes OpenMage/magento-lts#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All automated tests passed successfully (all builds are green, SonarCloud checks are not required to merge)

@Hanmac
Hanmac requested review from addison74 and sreichel July 31, 2026 14:26
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.generics baseline 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants