From 6dec59a418f747a7bff730a1167d10a4dba4ae66 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Tue, 12 Mar 2024 12:07:10 +1300 Subject: [PATCH] feat: add support for no config --- src/CacheInclude.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CacheInclude.php b/src/CacheInclude.php index ab75bf4..1b86b0f 100644 --- a/src/CacheInclude.php +++ b/src/CacheInclude.php @@ -53,10 +53,14 @@ class CacheInclude * @param ConfigInterface $config * @param bool $forceExpire */ - public function __construct(ConfigInterface $config, $forceExpire = false) + public function __construct(ConfigInterface $config = null, $forceExpire = false) { $this->cache = Injector::inst()->get(CacheInterface::class . '.CacheInclude'); - $this->config = $config; + + if ($config) { + $this->config = $config; + } + $this->forceExpire = $forceExpire; }