From 2f010b766ad6db3cac9b73123ef961f76f10cff4 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 5 Sep 2019 15:00:52 +0200 Subject: [PATCH] Document the validator's switch to PSR-6. --- components/validator/resources.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/validator/resources.rst b/components/validator/resources.rst index a7cf3678c9d..1455c2518bc 100644 --- a/components/validator/resources.rst +++ b/components/validator/resources.rst @@ -147,17 +147,21 @@ can slow down your application because each file needs to be parsed, validated and converted into a :class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadata` instance. -To solve this problem, call the :method:`Symfony\\Component\\Validator\\ValidatorBuilder::setMetadataCache` +To solve this problem, call the :method:`Symfony\\Component\\Validator\\ValidatorBuilder::setMappingCache` method of the Validator builder and pass your own caching class (which must -implement :class:`Symfony\\Component\\Validator\\Mapping\\Cache\\CacheInterface`):: +implement the PSR-6 interface :class:`Psr\\Cache\\CacheItemPoolInterface`):: use Symfony\Component\Validator\Validation; $validator = Validation::createValidatorBuilder() // ... add loaders - ->setMetadataCache(new SomeImplementCacheInterface()); + ->setMappingCache(new SomePsr6Cache()); ->getValidator(); +.. versionadded:: 4.4 + + Support for PSR-6 compatible mapping caches was introduced in Symfony 4.4. + .. note:: The loaders already use a singleton load mechanism. That means that the pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy