From 93b7eb8eea9d562cb9eff137ca71c5d5d9c2e394 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Sat, 15 Aug 2020 20:03:02 +0300 Subject: [PATCH] Document why we are doing an interface check before adding cacheability metadata. --- src/Event/AccessEventBase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Event/AccessEventBase.php b/src/Event/AccessEventBase.php index 740864ce8..520c24cb8 100644 --- a/src/Event/AccessEventBase.php +++ b/src/Event/AccessEventBase.php @@ -88,6 +88,8 @@ public function getUser(): AccountInterface { public function getAccessResult(): AccessResultInterface { $access = $this->access; + // Enrich the access result object with our cacheability metadata in case it + // supports it. if ($access instanceof RefinableCacheableDependencyInterface) { $access->addCacheableDependency($this); }