diff --git a/src/Command/CreateUsersCommand.php b/src/Command/CreateUsersCommand.php index 3643868..02be00c 100644 --- a/src/Command/CreateUsersCommand.php +++ b/src/Command/CreateUsersCommand.php @@ -154,14 +154,14 @@ private static function parseUsers(string $filename): array $roles = $row[$rolesIndex]; $group = false !== $groupIndex ? $row[$groupIndex] : null; - if (!\is_string($email) || !\is_string($name) || !\is_string($roles) || !\is_string($group)) { - throw new \RuntimeException("Invalid row in {$filename}."); + if (null === $email || null === $name) { + throw new \RuntimeException("Email or Name is required in {$filename}."); } $users[] = [ 'email' => $email, 'name' => $name, - 'roles' => explode(',', $roles), + 'roles' => null !== $roles ? explode(',', $roles) : [], 'group' => $group, ]; }