Skip to content

Add generic types to traversable implementations #42471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Aug 10, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? kinda
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Since tool support for generic types is growing, I wanted to give it a try and add generics to our traversable implementations. This should help Psalm to understand our code better. Furthermore, it helps app developers with running static code analysis on their own codebases.

Marking this as WIP for now until I reviewed all errors reported by Psalm.

@nicolas-grekas nicolas-grekas added this to the 5.4 milestone Aug 11, 2021
@lyrixx
Copy link
Member

lyrixx commented Aug 11, 2021

👍🏼 for the workflow part

@nicolas-grekas
Copy link
Member

Ldap's QueryInterface declares @return CollectionInterface|Entry[] but it should be something like @return CollectionInterface<Entry>

@derrabus derrabus force-pushed the improvement/generic-iterators branch 8 times, most recently from 0b5c0de to 170a802 Compare August 12, 2021 22:22
@derrabus derrabus force-pushed the improvement/generic-iterators branch 4 times, most recently from 5a761ed to 9a03d29 Compare August 18, 2021 23:02
@derrabus derrabus force-pushed the improvement/generic-iterators branch from 9a03d29 to 591b066 Compare August 28, 2021 18:05
@derrabus derrabus force-pushed the improvement/generic-iterators branch from 591b066 to 7f824fc Compare November 3, 2021 09:25
@fabpot fabpot changed the title WIP: Add generic types to traversable implementations Add generic types to traversable implementations Nov 3, 2021
@fabpot
Copy link
Member

fabpot commented Nov 3, 2021

Thank you @derrabus.

@fabpot fabpot merged commit a74fdac into symfony:5.4 Nov 3, 2021
@derrabus derrabus deleted the improvement/generic-iterators branch November 3, 2021 11:00
@derrabus derrabus mentioned this pull request Nov 3, 2021
fabpot added a commit that referenced this pull request Nov 4, 2021
This PR was merged into the 5.4 branch.

Discussion
----------

Fix more generic types

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

Some changes I wanted to push to #42471, but then it got merged already. 😇

Commits
-------

c54d61e Fix more generic types
This was referenced Nov 5, 2021
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.

7 participants