DX: fix phpstan errors

This commit is contained in:
2023-02-04 01:19:34 +01:00
parent 856eea37ee
commit 584ac05b53
12 changed files with 34 additions and 136 deletions

View File

@@ -26,28 +26,4 @@ use const E_USER_DEPRECATED;
*/
abstract class AbstractChillVoter extends Voter implements ChillVoterInterface
{
protected function supports($attribute, $subject)
{
@trigger_error(
'This voter should implements the new `supports` '
. 'methods introduced by Symfony 3.0, and do not rely on '
. 'getSupportedAttributes and getSupportedClasses methods.',
E_USER_DEPRECATED
);
// @TODO: getSupportedAttributes() should be created in here and made abstract or in ChillVoterInterface.
// @TODO: getSupportedClasses() should be created in here and made abstract or in ChillVoterInterface.
return in_array($attribute, $this->getSupportedAttributes($attribute), true)
&& in_array(get_class($subject), $this->getSupportedClasses(), true);
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
@trigger_error('This voter should implements the new `voteOnAttribute` '
. 'methods introduced by Symfony 3.0, and do not rely on '
. 'isGranted method', E_USER_DEPRECATED);
// @TODO: isGranted() should be created in here and made abstract or in ChillVoterInterface.
return $this->isGranted($attribute, $subject, $token->getUser());
}
}