Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 285-293 (lines=9) @@
282
283
                // register position
284
                $key = array_search($this->params('action'), $viewSteps);
285
                if (!$key) {
286
                    // register is not a substep of the game so it's a step
287
                    $key = array_search($this->params('action'), $steps);
288
                    $keyStep = true;
289
                } else {
290
                    // register was a substep, i search the index of its parent
291
                    $key = array_search($key, $steps);
292
                    $keyStep = false;
293
                }
294
295
                // play position
296
                $keyplay = array_search('play', $viewSteps);
@@ 511-519 (lines=9) @@
508
509
        // share position
510
        $key = array_search($this->params('action'), $viewSteps);
511
        if (!$key) {
512
            // share is not a substep of the game so it's a step
513
            $key = array_search($this->params('action'), $steps);
514
            $keyStep = true;
515
        } else {
516
            // share was a substep, I search the index of its parent
517
            $key = array_search($key, $steps);
518
            $keyStep = false;
519
        }
520
521
        // play position
522
        $keyplay = array_search('play', $viewSteps);