-
Notifications
You must be signed in to change notification settings - Fork 95
Add stubs for Acl #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stubs for Acl #148
Conversation
3dc9360
to
b438888
Compare
Hi @ondrejmirtes, any idea about this error ?
PHPStan Symfony Framework extensions and rules > phpstan:
In StubPhpDocProvider.php line 150:
Internal error.
analyse [--paths-file PATHS-FILE] [-c|--configuration CONFIGURATION] [-l|--level LEVEL] [--no-progress] [--debug] [-a|--autoload-file AUTOLOAD-FILE] [--error-format ERROR-FORMAT] [--generate-baseline [GENERATE-BASELINE]] [--memory-limit MEMORY-LIMIT] [--xdebug] [--fix] [--watch] [--pro] [--] [<paths>...]
AclProviderInterface.stub contains a parse error: https://phpstan.org/r/5b9d1718-66c8-40e6-8c0b-d9363de991f7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a space in the beginning of the line which causes the error 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With PHPStan's dev-master, the experience is a bit nicer:
------ --------------------------------------------------------------------------------------------
Line stubs/Symfony/Component/Security/Acl/Model/AclProviderInterface.stub
------ --------------------------------------------------------------------------------------------
3 Namespace declaration statement has to be the very first statement in the script on line 3
3 Namespace declaration statement has to be the very first statement in the script on line 3
3 Namespace declaration statement has to be the very first statement in the script on line 3
3 Namespace declaration statement has to be the very first statement in the script on line 3
------ --------------------------------------------------------------------------------------------
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoah, nice catch
132981f
to
8984b49
Compare
8984b49
to
236849b
Compare
This seems to be ready now :)
Thank you!
I'm not sure the stub is working as expected. @ondrejmirtes
The following PR is failing:
sonata-project/SonataAdminBundle#7095
/**
* @var MutableAclProviderInterface
*/
protected $aclProvider;
public function getObjectAcl(ObjectIdentityInterface $objectIdentity)
{
try {
return $this->aclProvider->findAcl($objectIdentity);
} catch (AclNotFoundException $e) {
return null;
}
}
is throwing an error
Method
Sonata\AdminBundle\Security\Handler\AclSecurityHandler::getObjectAcl(
) should return
Symfony\Component\Security\Acl\Model\MutableAclInterface|null but
returns Symfony\Component\Security\Acl\Model\AclInterface.
even if the stub is
/**
* @phpstan-param array<SecurityIdentityInterface> $sids
* @phpstan-return MutableAclInterface
*/
public function findAcl(ObjectIdentityInterface $oid, array $sids = []);
@VincentLanglet Please open an issue.
Done #149
No description provided.