Merge branch '6.4' into 7.3

* 6.4:
  Minor tweak
  [Security] abstract voter implements CacheableVoterInterface
This commit is contained in:
Javier Eguiluz
2026-01-28 17:18:53 +01:00

View File

@@ -49,11 +49,19 @@ which makes creating a voter even easier::
abstract protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool;
}
.. versionadded:: 7.3
The ``$vote`` argument of the ``voteOnAttribute()`` method was introduced
in Symfony 7.3.
.. note::
The Voter class also implements
:class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\CacheableVoterInterface`
with methods used to improve :ref:`voting performance <voter-improve-performance>`
thanks to caching.
.. _how-to-use-the-voter-in-a-controller:
Setup: Checking for Access in a Controller
@@ -302,6 +310,8 @@ If you're using the :ref:`default services.yaml configuration <service-container
you're done! Symfony will automatically pass the ``security.helper``
service when instantiating your voter (thanks to autowiring).
.. _voter-improve-performance:
Improving Voter Performance
---------------------------