File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -143,15 +143,15 @@ private static function parseUsers(string $filename): array
143
143
$ rolesIndex = array_search ('roles ' , $ header , true );
144
144
$ groupIndex = array_search ('group ' , $ header , true );
145
145
146
- if (!\is_int ($ emailIndex ) || !\is_int ($ nameIndex ) || ! \is_int ( $ rolesIndex ) ) {
147
- throw new \RuntimeException ("Could not find email, name, or roles in the header of {$ filename }. " );
146
+ if (!\is_int ($ emailIndex ) || !\is_int ($ nameIndex )) {
147
+ throw new \RuntimeException ("Could not find email or name in the header of {$ filename }. " );
148
148
}
149
149
150
150
$ users = [];
151
151
while (($ row = fgetcsv ($ file )) !== false ) {
152
152
$ email = $ row [$ emailIndex ];
153
153
$ name = $ row [$ nameIndex ];
154
- $ roles = $ row [$ rolesIndex ];
154
+ $ roles = false !== $ rolesIndex ? $ row [$ rolesIndex ] : null ;
155
155
$ group = false !== $ groupIndex ? $ row [$ groupIndex ] : null ;
156
156
157
157
if (null === $ email || null === $ name ) {
You can’t perform that action at this time.
0 commit comments