Weebly / phpstan-laravel

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

Support of @mixin annotation #5

Closed Ascendens closed 6 years ago

Ascendens commented 6 years ago

There are classes in Laravel which may be used as query builder and it's indicated via @mixin annotation, for example, relations. I guess, it is useful to consider this moment.

crissi commented 6 years ago

This needs to be added to the FacadeMethodExtension too since right now it is failing on DB::table('some_table'). The table method is located in Illuminate\Database\Connection and not the root facade Illuminate\Database\DatabaseManager, but the DatabaseManager do have a @mixin for the connection class

twistor commented 6 years ago

Thanks for the PR! And the tests!

Could we break this up into a collaborator, or even a base class method is fine?

twistor commented 6 years ago

Looks awesome, thanks!