File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 41
41
use function is_array ;
42
42
use function is_object ;
43
43
use function is_string ;
44
- use function key ;
45
44
use function MongoDB \BSON \fromPHP ;
46
45
use function MongoDB \BSON \toPHP ;
47
- use function reset ;
48
46
use function substr ;
49
47
50
48
/**
@@ -319,11 +317,9 @@ function is_last_pipeline_operator_write(array $pipeline): bool
319
317
return false ;
320
318
}
321
319
322
- $ lastOp = document_to_array ($ lastOp );
320
+ $ key = array_key_first ( document_to_array ($ lastOp) );
323
321
324
- reset ($ lastOp );
325
-
326
- return key ($ lastOp ) === '$merge ' || key ($ lastOp ) === '$out ' ;
322
+ return $ key === '$merge ' || $ key === '$out ' ;
327
323
}
328
324
329
325
/**
@@ -341,11 +337,7 @@ function is_mapreduce_output_inline($out): bool
341
337
return false ;
342
338
}
343
339
344
- $ out = document_to_array ($ out );
345
-
346
- reset ($ out );
347
-
348
- return key ($ out ) === 'inline ' ;
340
+ return array_key_first (document_to_array ($ out )) === 'inline ' ;
349
341
}
350
342
351
343
/**
You can’t perform that action at this time.
0 commit comments