Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 267-275 (lines=9) @@
264
265
                // register position
266
                $key = array_search($this->params('action'), $viewSteps);
267
                if (!$key) {
268
                    // register is not a substep of the game so it's a step
269
                    $key = array_search($this->params('action'), $steps);
270
                    $keyStep = true;
271
                } else {
272
                    // register was a substep, i search the index of its parent
273
                    $key = array_search($key, $steps);
274
                    $keyStep = false;
275
                }
276
277
                // play position
278
                $keyplay = array_search('play', $viewSteps);
@@ 493-501 (lines=9) @@
490
491
        // share position
492
        $key = array_search($this->params('action'), $viewSteps);
493
        if (!$key) {
494
            // share is not a substep of the game so it's a step
495
            $key = array_search($this->params('action'), $steps);
496
            $keyStep = true;
497
        } else {
498
            // share was a substep, I search the index of its parent
499
            $key = array_search($key, $steps);
500
            $keyStep = false;
501
        }
502
503
        // play position
504
        $keyplay = array_search('play', $viewSteps);