Closed as not planned
Description
I'm using the QueriesFlaggedEnums
trait in the Badge
model. I've defined a local scope which use the hasAnyFlags()
. PHPstan raises an error like:
------ ----------------------------------------------------------------------------------
Line app/Models/Badge.php
------ ----------------------------------------------------------------------------------
109 Call to an undefined method Illuminate\Database\Eloquent\Builder::hasAnyFlags().
------ ----------------------------------------------------------------------------------
This is the Laravel code:
107: public function scopeWithActuatorsIn(Builder $query, array $actuators): Builder
107: {
109: return $query
110: ->where('active', true)
111: ->hasAnyFlags('actuators', $actuators);
112: }
Someone was suggesting the use of PHP generics in order to avoid the problem. I've tried this approach using an stub file but nothing has changed.
The code could be find here: https://github.com/pacoorozco/gamify-laravel
Related to: larastan/larastan#1307