From 1d0749380f4713454a5217508cf8d36e19af70f9 Mon Sep 17 00:00:00 2001 From: markhuot Date: Wed, 29 Nov 2023 14:35:37 -0500 Subject: [PATCH] cleanup --- src/models/Component.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/models/Component.php b/src/models/Component.php index 4b692bb..672dbf6 100644 --- a/src/models/Component.php +++ b/src/models/Component.php @@ -96,9 +96,10 @@ public function withDisclosures(bool $withDisclosures = true): self public function isCollapsed(): bool { $shouldBeClosed = $this->getType()->getSlotDefinitions()->every(fn ($defn) => $defn->isCollapsed()); + $notForcedOpen = $this->disclosure->state !== 'open'; + $forcedClosed = $this->disclosure->state == 'closed'; - return ($shouldBeClosed && $this->disclosure->state !== 'open') || - $this->disclosure->state == 'closed'; + return ($shouldBeClosed && $notForcedOpen) || $forcedClosed; } /**