From ffc5452e8c6c8cd530640c1a44e3664a0bf382b4 Mon Sep 17 00:00:00 2001 From: Mark van Eijk Date: Thu, 9 May 2024 09:44:00 +0200 Subject: [PATCH] use updateAndGet --- src/CachedComponent.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CachedComponent.php b/src/CachedComponent.php index 325a719..3fbab97 100644 --- a/src/CachedComponent.php +++ b/src/CachedComponent.php @@ -22,8 +22,8 @@ public function resolveView() return parent::resolveView(); } - if (null !== $cachedValue = $this->get($this->getParameters())) { - return new HtmlString((string) $cachedValue); - } + $cachedValue = $this->get($this->getParameters()) ?: $this->updateAndGet($this->getParameters()); + + return new HtmlString((string) $cachedValue); } }