Closed kkmuffme closed 1 month ago
This same mistake is there for other stuff too - e.g. wp_list_bookmarks
, wp_list_categories
,... since those all are for sealed array shapes but should be unsealed
@kkmuffme How many laser eyes do you have? 🙃
array{exit: false}
is wrong, since the array can have other keys in it too, e.g.code
and the correct type would bearray{exit: false}&array
Each of these is tested with an additional key. None of the tests are failing. Why is this?
Maybe because phpstan doesn't seal arrays by default (like how it was in psalm pre-v5)?
For PHPStan array{exit: false}&array
= array{exit: false}
. This is different in Psalm?
Yes (as it should be, since that behavior you just described was a bad design choice taken in psalm initially and copied by everybody)
The problem is that you’re using Psalm, and therefore array{exit: false}
doesn’t work as expected?
@szepeviktor Perhaps we could add support for this? See https://github.com/phpstan/phpdoc-parser/pull/169.
No, the problem is not that I'm using Psalm, it's that your type is wrong. If you want to know why, look up why we changed the behavior in psalm
I do not want to work on this package & I keep a distance from Psalm.
I do not want to work on this package
Don't need to, the fix will be PRed anyway. Maybe add other maintainers?
I keep a distance from Psalm
Why? :-)
I keep a distance from Psalm
Why? :-)
It has dark roots. That is all. I do not want to spark emotions.
If I may ask bc I'm unaware (and have contributed quite a bit to psalm): bc of initial funding of psalm? or personal experience with psalm's team?
Sorry. That is all. I've read it on psalm.dev many years ago.
@kkmuffme I’d appreciate it if you could have a look at #251.
https://github.com/php-stubs/wordpress-stubs/blame/v6.6.2/functionMap.php#L56
)
too much at the endarray{exit: false}
is wrong, since the array can have other keys in it too, e.g.code
and the correct type would bearray{exit: false}&array
https://developer.wordpress.org/reference/functions/wp_die/