Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit dc81c1a

Browse files
committed
fix(command): Group and Roles can be null
1 parent 4438be3 commit dc81c1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Command/CreateUsersCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ private static function parseUsers(string $filename): array
154154
$roles = $row[$rolesIndex];
155155
$group = false !== $groupIndex ? $row[$groupIndex] : null;
156156

157-
if (!\is_string($email) || !\is_string($name) || !\is_string($roles) || !\is_string($group)) {
158-
throw new \RuntimeException("Invalid row in {$filename}.");
157+
if (null === $email || null === $name) {
158+
throw new \RuntimeException("Email or Name is required in {$filename}.");
159159
}
160160

161161
$users[] = [
162162
'email' => $email,
163163
'name' => $name,
164-
'roles' => explode(',', $roles),
164+
'roles' => null !== $roles ? explode(',', $roles) : [],
165165
'group' => $group,
166166
];
167167
}

0 commit comments

Comments
 (0)