vimeo/psalm

Improve support for is_file and family

Open

#7770 aperta il 10 mar 2022

Vedi su GitHub
 (13 commenti) (0 reazioni) (0 assegnatari)PHP (668 fork)batch import
Help wantedeasy problemsenhancementgood first issueinternal stubs/callmap

Metriche repository

Star
 (5369 star)
Metriche merge PR
 (Merge medio 3g 12h) (5 PR mergiate in 30 g)

Descrizione

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

Guida contributor