psalm: glob wrong return type
https://psalm.dev/r/726b2ba5b5
Result is not list<non-empty-string>
when the argument is empty string and no flags are present. (but should be array<never, never>
)
Glob needs a return type provider added to ensure the “non-empty-string” is not lost when a valid pattern is passed.
Bug added in https://github.com/vimeo/psalm/pull/9814 @Hanmac
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 28 (21 by maintainers)
Commits related to this issue
- Fixes #9820 — committed to ygottschalk/psalm by ygottschalk a year ago
my current testing shows exactly that:
glob( '' , GLOB_NOCHECK)
=>['']
glob( '' , GLOB_NOCHECK | GLOB_ONLYDIR)
=>[]