From 91c409fc8c6c3be9d4d53ebda9902fd5b69650a3 Mon Sep 17 00:00:00 2001 From: callan-stretton Date: Fri, 8 Jul 2022 10:58:51 +1200 Subject: [PATCH] added null coalescing operator to fallback to an empty string - fixes deprecated passing null to paramater string on trim() --- code/Aspects/CacheAfterCallAspect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Aspects/CacheAfterCallAspect.php b/code/Aspects/CacheAfterCallAspect.php index cc3ce51..e04bfb7 100644 --- a/code/Aspects/CacheAfterCallAspect.php +++ b/code/Aspects/CacheAfterCallAspect.php @@ -16,7 +16,7 @@ class CacheAfterCallAspect implements AfterCallAspect public function afterCall($proxied, $method, $args, $result) { $message = (empty($result)) ? "Missed: {$args[0]}" : "Hit: {$args[0]}"; - $result = preg_replace('/\s+/', ' ', trim($result)); + $result = preg_replace('/\s+/', ' ', trim($result) ?? ''); $result = Convert::raw2att($result); PartialCacheCollector::addTemplateCache( $message,