From 0d048175453fc998c4c6b768b55d53c69ab400de Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Sat, 14 Oct 2023 12:13:31 +1100 Subject: [PATCH] Inject cache --- src/Support/Fields.php | 4 ++-- src/Support/Includes.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Support/Fields.php b/src/Support/Fields.php index 4c62376..08787ff 100644 --- a/src/Support/Fields.php +++ b/src/Support/Fields.php @@ -25,9 +25,9 @@ final class Fields */ private WeakMap $cache; - private function __construct() + private function __construct(WeakMap $cache = new WeakMap) { - $this->cache = new WeakMap(); + $this->cache = $cache; } /** diff --git a/src/Support/Includes.php b/src/Support/Includes.php index 0ffdc3c..f38df5a 100644 --- a/src/Support/Includes.php +++ b/src/Support/Includes.php @@ -24,9 +24,9 @@ final class Includes */ private WeakMap $cache; - private function __construct() + private function __construct(WeakMap $cache = new WeakMap) { - $this->cache = new WeakMap(); + $this->cache = $cache; } /**