symfony / security-acl

Symfony Security ACL Component
https://symfony.com/components/Security
MIT License
363 stars 48 forks source link

Improve findAcl phpdoc #83

Closed VincentLanglet closed 2 years ago

VincentLanglet commented 3 years ago

Hi @nicolas-grekas

I assume MutableAclProviderInterface::findAcl is supposed to return MutableAclInterface (and same for findAcls) but currently since MutableAclProviderInterface extends AclProviderInterface, it inherit of the same phpdoc for those method so return only an AclInterface.

This would avoid phpstan-symfony (and psalm-symfony) plugin to introduce some stub about those file.

Related phpstan issue: https://github.com/phpstan/phpstan-symfony/issues/183 Related psalm issue: https://github.com/psalm/psalm-plugin-symfony/issues/189

VincentLanglet commented 2 years ago

Friendly ping @nicolas-grekas @fabpot.

Would you agree to merge such a PR in this repository in order to fix some static analysis (and also narrow the API) issue about the return type of MutableAclProviderInterface::findAcl or should we find a solution with psalm-symfony and phpstan-symfony repository ?

Also, should I target main or 3.1 branch ?

Thanks

derrabus commented 2 years ago

Also, should I target main or 3.1 branch ?

The main branch is fine.

wouterj commented 2 years ago

Thanks Vincent!