Skip to content

Commit 435d852

Browse files
kg-botstancl
andauthored
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 <[email protected]>
1 parent 08bfd6f commit 435d852

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/CacheManager.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ public function __call($method, $parameters)
2020
$tags = [config('tenancy.cache.tag_base') . tenant()->getTenantKey()];
2121

2222
if ($method === 'tags') {
23-
if (count($parameters) !== 1) {
24-
throw new \Exception("Method tags() takes exactly 1 argument. {count($parameters)} passed.");
23+
$count = count($parameters);
24+
25+
if ($count !== 1) {
26+
throw new \Exception("Method tags() takes exactly 1 argument. $count passed.");
2527
}
2628

2729
$names = $parameters[0];

0 commit comments

Comments
 (0)