Code Duplication    Length = 9-9 lines in 2 locations

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

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