From d6ff981a6ea369a338c53c8e974632fb0d48ab28 Mon Sep 17 00:00:00 2001 From: David Herrera Date: Fri, 29 Dec 2023 23:24:12 -0500 Subject: [PATCH] Simplify reliance on `getMultiple()` --- src/alley/wp/simplecache/class-metadata-adapter.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/alley/wp/simplecache/class-metadata-adapter.php b/src/alley/wp/simplecache/class-metadata-adapter.php index f16fe69..8f5ddc2 100644 --- a/src/alley/wp/simplecache/class-metadata-adapter.php +++ b/src/alley/wp/simplecache/class-metadata-adapter.php @@ -80,13 +80,7 @@ public static function for_term( int $term_id ): CacheInterface { public function get( string $key, mixed $default = null ): mixed { $get = $this->getMultiple( [ $key ], $default ); - $out = $default; - - foreach ( $get as $value ) { - $out = $value; - } - - return $out; + return $get[ $key ]; } /**