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

Fixed array to string conversion (#718)

* Fixed array to string conversion

Previous code would give this warning before actually showing exception message
`<warning>PHP Warning:  Array to string conversion in .../vendor/stancl/tenancy/src/CacheManager.php on line 24</warning>`

* Update variable & syntax

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
Stefan Ninic 2021-12-25 22:10:34 +01:00 committed by GitHub
parent 08bfd6f9bb
commit 435d8528a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,8 +20,10 @@ class CacheManager extends BaseCacheManager
$tags = [config('tenancy.cache.tag_base') . tenant()->getTenantKey()];
if ($method === 'tags') {
if (count($parameters) !== 1) {
throw new \Exception("Method tags() takes exactly 1 argument. {count($parameters)} passed.");
$count = count($parameters);
if ($count !== 1) {
throw new \Exception("Method tags() takes exactly 1 argument. $count passed.");
}
$names = $parameters[0];