vimeo/psalm

Improve support for is_file and family

Open

#7,770 opened on Mar 10, 2022

 (13 comments) (0 reactions) (0 assignees)PHP (668 forks)batch import
Help wantedeasy problemsenhancementgood first issueinternal stubs/callmap

Repository metrics

Stars
 (5,369 stars)
PR merge metrics
 (Avg merge 3d 12h) (5 merged PRs in 30d)

Description

Hi,

The functions that expect a valid path (file_exists, is_readable, ...) always return false when an empty string is provided ( https://3v4l.org/TcecN ). So when those functions return true we can say that the argument is a non-empty string.

If my assumption is right it could help with situations like this: https://psalm.dev/r/26f209fe21

Contributor guide