Code Duplication    Length = 20-21 lines in 2 locations

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

@@ 572-591 (lines=20) @@
569
        return $viewModel;
570
    }
571
    
572
    public function fbshareAction()
573
    {
574
        $viewModel = new JsonModel();
575
        $viewModel->setTerminal(true);
576
        $fbId = $this->params()->fromQuery('fbId');
577
        if (!$this->game) {
578
            return $this->errorJson();
579
        }
580
        $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user);
581
        if (! $entry) {
582
            return $this->errorJson();
583
        }
584
        if (!$fbId) {
585
            return $this->errorJson();
586
        }
587
    
588
        $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry);
589
    
590
        return $this->successJson();
591
    }
592
    
593
    public function fbrequestAction()
594
    {
@@ 636-656 (lines=21) @@
633
        return $this->successJson();
634
    }
635
    
636
    public function googleAction()
637
    {
638
        $viewModel = new ViewModel();
639
        $viewModel->setTerminal(true);
640
        $googleId = $this->params()->fromQuery('googleId');
641
642
        if (!$this->game) {
643
            return $this->errorJson();
644
        }
645
        $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user);
646
        if (! $entry) {
647
            return $this->errorJson();
648
        }
649
        if (!$googleId) {
650
            return $this->errorJson();
651
        }
652
    
653
        $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry);
654
    
655
        return $this->successJson();
656
    }
657
658
    public function optinAction()
659
    {