Skip to content
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

add some more stubs for array functions #4271

Merged
merged 5 commits into from Oct 6, 2020

Conversation

marcosh
Copy link
Contributor

@marcosh marcosh commented Oct 2, 2020

This adds some more stubs for array functions

*
* @psalm-pure
*/
function array_intersect_ukey(array $arr, array $arr2, array ...$arr3, callable $keyCompareFunc): array {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Brackets mentioned twice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @andrew-demb

@muglug
Copy link
Collaborator

muglug commented Oct 2, 2020

Please remove the six stubs that are already covered by return type providers in Psalm (currently array_fill, array_merge, array_pad, array_pop, array_rand, array_reduce).

@marcosh
Copy link
Contributor Author

marcosh commented Oct 5, 2020

@muglug done. Just for the sake of understanding, are return type providers used when annotations are not enough to type correctly the function?

@muglug
Copy link
Collaborator

muglug commented Oct 6, 2020

are return type providers used when annotations are not enough to type correctly the function?

Yes, exactly. When I introduced conditional return types I removed (I think) all the return type providers that were simple enough to be implemented instead as conditional return types.

@muglug muglug merged commit a12fbb7 into vimeo:master Oct 6, 2020
@muglug
Copy link
Collaborator

muglug commented Oct 6, 2020

Thanks!

@marcosh marcosh deleted the new-stubs-for-array-functions branch October 6, 2020 15:39
muglug pushed a commit that referenced this pull request Oct 7, 2020
* add some more stubs for array functions

* add function brackets to stubs

* add parameter names

* remove redundant brackets

* remove stubs already defined in return type providers
muglug pushed a commit that referenced this pull request Oct 7, 2020
* add some more stubs for array functions

* add function brackets to stubs

* add parameter names

* remove redundant brackets

* remove stubs already defined in return type providers
danog pushed a commit to danog/psalm that referenced this pull request Jan 29, 2021
* add some more stubs for array functions

* add function brackets to stubs

* add parameter names

* remove redundant brackets

* remove stubs already defined in return type providers
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.

None yet

3 participants