From 4dd0e11339637c79d1f4a2d919ae8ab717cdbb1b Mon Sep 17 00:00:00 2001 From: Jay Potter Date: Sat, 25 Oct 2025 12:02:18 -0400 Subject: [PATCH] Add unset() Method --- src/Potter/Aware/AbstractAware.php | 1 + src/Potter/Aware/AwareTrait.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/Potter/Aware/AbstractAware.php b/src/Potter/Aware/AbstractAware.php index 8ad8482..a114e21 100644 --- a/src/Potter/Aware/AbstractAware.php +++ b/src/Potter/Aware/AbstractAware.php @@ -9,4 +9,5 @@ abstract class AbstractAware implements AwareInterface abstract public function get(string $key): mixed; abstract public function has(string $key): bool; abstract protected function set(string $key, mixed $value): mixed; + abstract protected function unset(string $key): void; } diff --git a/src/Potter/Aware/AwareTrait.php b/src/Potter/Aware/AwareTrait.php index ba3abb5..547ad50 100644 --- a/src/Potter/Aware/AwareTrait.php +++ b/src/Potter/Aware/AwareTrait.php @@ -25,5 +25,10 @@ trait AwareTrait return $this->aware[$key] = $value; } + final protected function unset(string $key): void + { + unset($this->aware[$key]); + } + abstract public function clone(): CloneableInterface; }