From 405e3148bdfceaf2821fa97b224cb1a586cc85e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 16 Aug 2019 12:54:48 +0200 Subject: [PATCH] getMany now returns only values --- src/Tenant.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Tenant.php b/src/Tenant.php index 76f78739..50b0bc27 100644 --- a/src/Tenant.php +++ b/src/Tenant.php @@ -80,13 +80,10 @@ class Tenant extends Model return $this->$key ?? $this->getFromData($key) ?? null; } + /** @todo In v2, this should return an associative array. */ public function getMany(array $keys): array { - return array_reduce($keys, function ($keys, $key) { - $keys[$key] = $this->get($key); - - return $keys; - }, []); + return array_map([$this, 'get'], $keys); } public function put(string $key, $value)