php-stubs / wordpress-stubs

Up-to-date WordPress function and class declaration stubs for static analysis by PHPStan
https://packagist.org/packages/php-stubs/wordpress-stubs
MIT License
151 stars 19 forks source link

Use unsealed shapes in conditional return types #251

Closed IanDelMar closed 1 month ago

IanDelMar commented 1 month ago

Closes #248

kkmuffme commented 1 month ago

That's perfect how it should be in an ideal world :-) Unfortunately, some tools (afair phpstorm for example), still don't support the "..." syntax, but do support the &array syntax.

If you could just Search/Replace All ,... } with }&array ?

IanDelMar commented 1 month ago

I opted for the ,... } to avoid stating that the intersection of {A, B, C} and {C, D, E} is anything other than C. :disappointed: But will change to }&array...

IanDelMar commented 1 month ago

@szepeviktor This PR is complete.

szepeviktor commented 1 month ago

Unfortunately, some tools (afair phpstorm for example),

Viktor is also afraid.