From eef242802f01fd88935ce9fac46dbe5125f401af Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Fri, 26 Aug 2016 10:40:14 +0300 Subject: [PATCH] Remove deprecated FileCacheReader for doctrine annotations --- src/JMS/Serializer/SerializerBuilder.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/JMS/Serializer/SerializerBuilder.php b/src/JMS/Serializer/SerializerBuilder.php index 1f868d183..f1a36c89c 100644 --- a/src/JMS/Serializer/SerializerBuilder.php +++ b/src/JMS/Serializer/SerializerBuilder.php @@ -18,6 +18,8 @@ namespace JMS\Serializer; +use Doctrine\Common\Annotations\CachedReader; +use Doctrine\Common\Cache\FilesystemCache; use JMS\Serializer\Builder\DefaultDriverFactory; use JMS\Serializer\Builder\DriverFactoryInterface; use JMS\Serializer\Handler\PhpCollectionHandler; @@ -42,7 +44,6 @@ use JMS\Serializer\Naming\PropertyNamingStrategyInterface; use Doctrine\Common\Annotations\Reader; use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\Common\Annotations\FileCacheReader; use Metadata\Cache\FileCache; use JMS\Serializer\Naming\SerializedNameAnnotationStrategy; use JMS\Serializer\Exception\InvalidArgumentException; @@ -341,7 +342,8 @@ public function build() if (null !== $this->cacheDir) { $this->createDir($this->cacheDir.'/annotations'); - $annotationReader = new FileCacheReader($annotationReader, $this->cacheDir.'/annotations', $this->debug); + $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations'); + $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug); } }