Code Duplication    Length = 9-9 lines in 2 locations

src/PlaygroundGame/Controller/Frontend/GameController.php 2 locations

@@ 303-311 (lines=9) @@
300
                // play position
301
                $keyplay = array_search('play', $viewSteps);
302
303
                if (!$keyplay) {
304
                    // play is not a substep, so it's a step
305
                    $keyplay = array_search('play', $steps);
306
                    $keyplayStep = true;
307
                } else {
308
                    // play is a substep so I search the index of its parent
309
                    $keyplay = array_search($keyplay, $steps);
310
                    $keyplayStep = false;
311
                }
312
313
                // If register step before play, I don't have no entry yet. I have to create one
314
                // If register after play step, I search for the last entry created by play step.
@@ 529-537 (lines=9) @@
526
        // play position
527
        $keyplay = array_search('play', $viewSteps);
528
529
        if (!$keyplay) {
530
            // play is not a substep, so it's a step
531
            $keyplay = array_search('play', $steps);
532
            $keyplayStep = true;
533
        } else {
534
            // play is a substep so I search the index of its parent
535
            $keyplay = array_search($keyplay, $steps);
536
            $keyplayStep = false;
537
        }
538
539
        if ($key && $keyplay && $keyplay <= $key) {
540
            // Has the user finished the game ?