1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 22:54:03 +00:00

[breaking fix] Add array return types to StorageDriver interface

This commit is contained in:
Samuel Štancl 2019-04-23 17:09:32 +02:00
parent e1c4dc8934
commit 9bc9b92d8d
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ interface StorageDriver
public function createTenant(string $domain, string $uuid): array; public function createTenant(string $domain, string $uuid): array;
public function deleteTenant(string $uuid): bool; public function deleteTenant(string $uuid): bool;
public function get(string $uuid, string $key); public function get(string $uuid, string $key);
public function getMany(string $uuid, array $keys); public function getMany(string $uuid, array $keys): array;
public function put(string $uuid, string $key, $value); 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? public function putMany(string $uuid, array $values); // todo better argument name than "values" for kv pairs?
} }

View file

@ -78,7 +78,7 @@ class TenantManager
throw new \Exception("Domain $domain is already occupied by tenant $id."); 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)); $this->database->create($this->getDatabaseName($tenant));
return $tenant; return $tenant;