nette / security

🔑 Provides authentication, authorization and a role-based access control management via ACL (Access Control List)
https://doc.nette.org/access-control
Other
357 stars 40 forks source link

Static analysis fails for Permission#isAllowed() – Resource $resource is ambiguous #56

Closed dakur closed 3 years ago

dakur commented 3 years ago

Version: 3.1.1

Bug Description

phpstan throws an error on Permission#isAllowed()'s $resource parameter as there is Resource type annotated. As PHP is case-insensitive, it resolves resource as well and phpstan handles it as error. Even if it reports ambiguousity, still it would not pass.

I'm reporting it here because as far as I know it has to be fixed by listing FQN into isAllowed() method phpDoc (see phpstan issue).

See https://phpstan.org/r/1575505f-2322-436e-8ee8-b274fe452b9c