santigarcor/laratrust

Wrong phpdoc param type for function hasPermission()

lucasjose501 opened this issue · 1 comments

I'm using Larastan (PHP Stan) to scan the code for bugs and typos. The function hasPermission($permission, $team = null, $requireAll = false) accepts int in the $team variable handled by the helper 'getIdFor' but the phpdoc does not mention it and reports as error on phpstan.

Error: Parameter #2 $team of method App\Models\User::hasPermission() expects bool|string|null, int given.

The code is working, it's just a false positive report.

* @param string|bool $team Team name or requiredAll roles.

Will be fixed in the next release.