Allow to cache support status of voters

This should increase the performance a bit
This commit is contained in:
Jan Böhmer 2023-08-28 23:06:37 +02:00
parent 879b702fc1
commit 7b6ba37667
14 changed files with 133 additions and 2 deletions

View file

@ -76,6 +76,11 @@ final class StructureVoter extends Voter
return false;
}
public function supportsType(string $subjectType): bool
{
return $subjectType === 'string' || $this->instanceToPermissionName($subjectType) !== null;
}
/**
* Maps an instance type to the permission name.
*