refactor(support): complete toIntIds() rollout in tenant-area code

Final pass over tenant repositories and TenantScopeService, collapsing
the remaining two-line intval+filter and one-line intval+unique patterns
onto the shared `toIntIds()` helper. The inline pattern is now gone
from the codebase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 19:43:45 +02:00
parent 1c779b8eeb
commit dbeac6b095
7 changed files with 12 additions and 19 deletions

View File

@@ -82,8 +82,7 @@ class TenantRepository implements TenantRepositoryInterface
}
if (array_key_exists('tenantIds', $options)) {
$tenantIds = $options['tenantIds'];
$tenantIds = is_array($tenantIds) ? array_values(array_unique(array_map('intval', $tenantIds))) : [];
$tenantIds = array_values(array_filter($tenantIds, static fn ($id) => $id > 0));
$tenantIds = is_array($tenantIds) ? toIntIds($tenantIds) : [];
if ($tenantIds) {
$where[] = 'tenants.id in (???)';
$params[] = $tenantIds;