phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

Added stub files and tests for array_* functions.

Open mad-briller opened this issue 3 years ago • 2 comments

closes https://github.com/phpstan/phpstan/issues/7707

functions stubbed:

array_diff_uassoc array_diff_ukey array_intersect_uassoc array_intersect_ukey array_udiff_assoc array_udiff_uassoc array_uintersect_assoc array_uintersect_uassoc array_uintersect

whilst adding these, phpstan warned because i didn't add array iterable types for the returns so i've specified them in the stubs, however i noticed this return type extension plugin which seems to be overriding them anyway, if theres something i should do instead let me know

mad-briller avatar Jul 30 '22 14:07 mad-briller

i tried that but it seemed to break the templating by using array-key or even int|string and i couldn't quite figure out why

when using array-key it reverted to showing errors like this:

+30: Parameter #3 $data_comp_func of function array_diff_uassoc expects callable(mixed, mixed): int, Closure(string, string): int<-1, 1> given.

mad-briller avatar Jul 30 '22 16:07 mad-briller

Please push the stubs with array-key and then try to figure out why these errors are reported by debugging the codebase :) Thanks.

ondrejmirtes avatar Jul 30 '22 20:07 ondrejmirtes

Feel free to open a new PR if you decide to finish it, thank you :)

ondrejmirtes avatar Sep 01 '22 21:09 ondrejmirtes