From 6880ff518eb05c0d177c8e4fa44fb41f46647c2d Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 7 Jan 2016 01:50:55 +0100 Subject: [PATCH 1/2] Bugfix --- src/ArrayCachePool.php | 2 +- tests/IntegrationPoolTest.php | 4 +++- tests/IntegrationTagTest.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ArrayCachePool.php b/src/ArrayCachePool.php index cdd8092..88936c8 100644 --- a/src/ArrayCachePool.php +++ b/src/ArrayCachePool.php @@ -27,7 +27,7 @@ class ArrayCachePool extends AbstractCachePool /** * @param array $cache */ - public function __construct(array $cache = []) + public function __construct(array &$cache = []) { $this->cache = $cache; } diff --git a/tests/IntegrationPoolTest.php b/tests/IntegrationPoolTest.php index 9072c2d..d7f7c24 100644 --- a/tests/IntegrationPoolTest.php +++ b/tests/IntegrationPoolTest.php @@ -16,8 +16,10 @@ class IntegrationPoolTest extends CachePoolTest { + private $cacheArray = []; + public function createCachePool() { - return new ArrayCachePool(); + return new ArrayCachePool($this->cacheArray); } } diff --git a/tests/IntegrationTagTest.php b/tests/IntegrationTagTest.php index 11bfd1a..0641865 100644 --- a/tests/IntegrationTagTest.php +++ b/tests/IntegrationTagTest.php @@ -16,10 +16,10 @@ class IntegrationTagTest extends TaggableCachePoolTest { - private $cache = []; + private $cacheArray = []; public function createCachePool() { - return new ArrayCachePool($this->cache); + return new ArrayCachePool($this->cacheArray); } } From 8694d092a98f594464a1d516f21e5af76ff512c1 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 7 Jan 2016 02:18:52 +0100 Subject: [PATCH 2/2] Fix! --- src/ArrayCachePool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArrayCachePool.php b/src/ArrayCachePool.php index 88936c8..361a1b9 100644 --- a/src/ArrayCachePool.php +++ b/src/ArrayCachePool.php @@ -29,7 +29,7 @@ class ArrayCachePool extends AbstractCachePool */ public function __construct(array &$cache = []) { - $this->cache = $cache; + $this->cache = &$cache; } protected function fetchObjectFromCache($key)