From 9bc9b92d8daf9dfdaaee1ebf0708b5595bfcd143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 23 Apr 2019 17:09:32 +0200 Subject: [PATCH] [breaking fix] Add array return types to StorageDriver interface --- src/Interfaces/StorageDriver.php | 4 ++-- src/TenantManager.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Interfaces/StorageDriver.php b/src/Interfaces/StorageDriver.php index 730c9c4d..fbb2d77c 100644 --- a/src/Interfaces/StorageDriver.php +++ b/src/Interfaces/StorageDriver.php @@ -11,7 +11,7 @@ interface StorageDriver public function createTenant(string $domain, string $uuid): array; public function deleteTenant(string $uuid): bool; public function get(string $uuid, string $key); - public function getMany(string $uuid, array $keys); - public function put(string $uuid, string $key, $value); + public function getMany(string $uuid, array $keys): array; + public function put(string $uuid, string $key, $value): array; public function putMany(string $uuid, array $values); // todo better argument name than "values" for kv pairs? } diff --git a/src/TenantManager.php b/src/TenantManager.php index f9e4c76b..254eaa9d 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -78,7 +78,7 @@ class TenantManager throw new \Exception("Domain $domain is already occupied by tenant $id."); } - $tenant = $this->jsonDecodeArrayValues($this->storage->createTenant($domain, \Webpatser\Uuid\Uuid::generate(1, $domain))); + $tenant = $this->jsonDecodeArrayValues($this->storage->createTenant($domain, (string) \Webpatser\Uuid\Uuid::generate(1, $domain))); $this->database->create($this->getDatabaseName($tenant)); return $tenant;