Weebly / phpstan-laravel

Laravel plugins for PHPStan
BSD 2-Clause "Simplified" License
51 stars 22 forks source link

[WIP] Very rudimentary starting point for Model::where*() methods #12

Open 3onyc opened 6 years ago

3onyc commented 6 years ago

So far this code fixes any errors with where*() methods, except for more complicated cases.

For reference

You seem to be able to call methods such as Model::whereEmailAndName($email, $name) and Model::whereEmailOrEmail($email, $otherEmail) but I haven't ever used these and would have to do more research.

I also think writing a library to easily create "fake" classes/methods/variables and easily construct types could be beneficial for the more magic methods such as this one, assuming such a library doesn't already exist.

Feel free to comment and contribute, as this is far from ready to be merged.