forked from fa/breadcrumb-the-shire
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:
@@ -48,8 +48,7 @@ class TenantCustomFieldDefinitionRepository implements TenantCustomFieldDefiniti
|
||||
|
||||
public function listByTenantIds(array $tenantIds, bool $onlyActive = true): array
|
||||
{
|
||||
$tenantIds = array_values(array_unique(array_map('intval', $tenantIds)));
|
||||
$tenantIds = array_values(array_filter($tenantIds, static fn ($id) => $id > 0));
|
||||
$tenantIds = toIntIds($tenantIds);
|
||||
if (!$tenantIds) {
|
||||
return [];
|
||||
}
|
||||
@@ -65,8 +64,7 @@ class TenantCustomFieldDefinitionRepository implements TenantCustomFieldDefiniti
|
||||
|
||||
public function listFilterableByTenantIds(array $tenantIds): array
|
||||
{
|
||||
$tenantIds = array_values(array_unique(array_map('intval', $tenantIds)));
|
||||
$tenantIds = array_values(array_filter($tenantIds, static fn ($id) => $id > 0));
|
||||
$tenantIds = toIntIds($tenantIds);
|
||||
if (!$tenantIds) {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user