vimeo/psalm
View on GitHubInfer class type based upon result of is_a() function call
Open
#3,629 opened on Jun 22, 2020
Help wantedenhancement
Repository metrics
- Stars
- (5,369 stars)
- PR merge metrics
- (Avg merge 3d 12h) (5 merged PRs in 30d)
Description
https://psalm.dev/r/8a00f9319d
I believe psalm should be able to infer that future calls to \Storage should resolve to \Illuminate\Support\Facades\Storage.
This is laravel's technique for aliasing classes.
If you'd like to provide some notes on how to implement, I'd be happy to take a stab. I'm not sure if the class should just be aliased in the scope of the is_a branch, or across the entire project. I'm thinking it might just need to be within the scope of the conditional