From b1474768fea3ec1abb8543865e2a382373fdeeda Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 17 Jan 2015 23:43:34 +0100 Subject: [PATCH] #954 DDC-2982 - Better type-safety in `Doctrine\ORM\Cache\Region\DefaultMultiGetRegion` instantiation logic --- .../Cache/Region/DefaultMultiGetRegion.php | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/ORM/Cache/Region/DefaultMultiGetRegion.php b/lib/Doctrine/ORM/Cache/Region/DefaultMultiGetRegion.php index b037732a8..39bf9c9e8 100644 --- a/lib/Doctrine/ORM/Cache/Region/DefaultMultiGetRegion.php +++ b/lib/Doctrine/ORM/Cache/Region/DefaultMultiGetRegion.php @@ -20,12 +20,8 @@ namespace Doctrine\ORM\Cache\Region; -use Doctrine\ORM\Cache\Lock; +use Doctrine\Common\Cache\MultiGetCache; use Doctrine\ORM\Cache\Region; -use Doctrine\ORM\Cache\CacheKey; -use Doctrine\ORM\Cache\CacheEntry; -use Doctrine\Common\Cache\CacheProvider; -use Doctrine\ORM\Cache\MultiGetRegion; use Doctrine\ORM\Cache\CollectionCacheEntry; /** @@ -36,6 +32,25 @@ use Doctrine\ORM\Cache\CollectionCacheEntry; */ class DefaultMultiGetRegion extends DefaultRegion { + /** + * Note that the multiple type is due to doctrine/cache not integrating the MultiGetCache interface + * in its signature due to BC in 1.x + * + * @var MultiGetCache|\Doctrine\Common\Cache\Cache + */ + protected $cache; + + /** + * {@inheritDoc} + * + * @param MultiGetCache $cache + */ + public function __construct($name, MultiGetCache $cache, $lifetime = 0) + { + /* @var $cache \Doctrine\Common\Cache\Cache */ + parent::__construct($name, $cache, $lifetime); + } + /** * {@inheritdoc} */