Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 280-288 (lines=9) @@
277
                // play position
278
                $keyplay = array_search('play', $viewSteps);
279
280
                if (!$keyplay) {
281
                    // play is not a substep, so it's a step
282
                    $keyplay = array_search('play', $steps);
283
                    $keyplayStep = true;
284
                } else {
285
                    // play is a substep so I search the index of its parent
286
                    $keyplay = array_search($keyplay, $steps);
287
                    $keyplayStep = false;
288
                }
289
290
                // If register step before play, I don't have no entry yet. I have to create one
291
                // If register after play step, I search for the last entry created by play step.
@@ 506-514 (lines=9) @@
503
        // play position
504
        $keyplay = array_search('play', $viewSteps);
505
506
        if (!$keyplay) {
507
            // play is not a substep, so it's a step
508
            $keyplay = array_search('play', $steps);
509
            $keyplayStep = true;
510
        } else {
511
            // play is a substep so I search the index of its parent
512
            $keyplay = array_search($keyplay, $steps);
513
            $keyplayStep = false;
514
        }
515
516
        if ($key && $keyplay && $keyplay <= $key) {
517
            // Has the user finished the game ?