File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -402,19 +402,14 @@ class SongLoop implements \PHPWorkflow\Step\LoopControl {
402402 \PHPWorkflow\WorkflowControl $control,
403403 \PHPWorkflow\State\WorkflowContainer $container
404404 ): bool {
405- $songs = $container->get('songs');
406-
407- // no songs in container - end the loop
408- if (empty($songs)) {
405+ // all songs handled - end the loop
406+ if ($iteration === count($container->get('songs'))) {
409407 return false;
410408 }
411409
412410 // add the current song to the container so the steps
413411 // of the loop can access the entry
414- $container->set('currentSong', array_shift($songs));
415-
416- // update the songs entry to handle the songs step by step
417- $container->set('songs', $songs);
412+ $container->set('currentSong', $container->get('songs')[$iteration]);
418413
419414 return true;
420415 }
You can’t perform that action at this time.
0 commit comments