Skip to content

Refine return type annotation in Selectable interface for improved type hints for IDE - #551

Merged
greg0ire merged 1 commit into
doctrine:3.1.xfrom
dmitryuk:fix-selectable
Jul 17, 2026
Merged

Refine return type annotation in Selectable interface for improved type hints for IDE#551
greg0ire merged 1 commit into
doctrine:3.1.xfrom
dmitryuk:fix-selectable

Conversation

@dmitryuk

@dmitryuk dmitryuk commented Jul 15, 2026

Copy link
Copy Markdown

Hello!
This PR fixes the @return annotation of Selectable::matching() to properly propagate generic types (TKey, T) instead of falling back to mixed.

While static analysis tools like PHPStan or Psalm successfully read @phpstan-return and resolve the generics, most IDEs (including PhpStorm and editors using Intelephense) prioritize the standard @return tag.

Also ReadableCollection interface already implements Selectable #314, so no need to set it additionally

@greg0ire

Copy link
Copy Markdown
Member

There is a commit labeled fix2?

@dmitryuk

Copy link
Copy Markdown
Author

There is a commit labeled fix2?

Commits squashed now, thanks

@greg0ire greg0ire added this to the 3.1.1 milestone Jul 17, 2026
@greg0ire
greg0ire merged commit e292686 into doctrine:3.1.x Jul 17, 2026
8 checks passed
@greg0ire

Copy link
Copy Markdown
Member

Thanks @dmitryuk !

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants