Code Duplication    Length = 17-17 lines in 4 locations

src/PlaygroundGame/Controller/Frontend/LotteryController.php 4 locations

@@ 104-120 (lines=17) @@
101
        return $viewModel;
102
    }
103
104
    public function fbshareAction()
105
    {
106
        $result = parent::fbshareAction();
107
        $bonusEntry = false;
108
109
        if ($result->getVariable('success')) {
110
            $bonusEntry = $this->getGameService()->addAnotherChance($this->game, $this->user, 1);
111
        }
112
113
        $response = $this->getResponse();
114
        $response->setContent(\Zend\Json\Json::encode(array(
115
            'success' => $result,
116
            'playBonus' => $bonusEntry
117
         )));
118
119
        return $response;
120
    }
121
122
    public function fbrequestAction()
123
    {
@@ 122-138 (lines=17) @@
119
        return $response;
120
    }
121
122
    public function fbrequestAction()
123
    {
124
        $result = parent::fbrequestAction();
125
        $bonusEntry = false;
126
127
        if ($result->getVariable('success')) {
128
            $bonusEntry = $this->getGameService()->addAnotherChance($this->game, $this->user, 1);
129
        }
130
131
        $response = $this->getResponse();
132
        $response->setContent(\Zend\Json\Json::encode(array(
133
            'success' => $result,
134
            'playBonus' => $bonusEntry
135
        )));
136
137
        return $response;
138
    }
139
140
    public function tweetAction()
141
    {
@@ 140-156 (lines=17) @@
137
        return $response;
138
    }
139
140
    public function tweetAction()
141
    {
142
        $result = parent::tweetAction();
143
        $bonusEntry = false;
144
145
        if ($result->getVariable('success')) {
146
            $bonusEntry = $this->getGameService()->addAnotherChance($this->game, $this->user, 1);
147
        }
148
149
        $response = $this->getResponse();
150
        $response->setContent(\Zend\Json\Json::encode(array(
151
            'success' => $result,
152
            'playBonus' => $bonusEntry
153
        )));
154
155
        return $response;
156
    }
157
158
    public function googleAction()
159
    {
@@ 158-174 (lines=17) @@
155
        return $response;
156
    }
157
158
    public function googleAction()
159
    {
160
        $result = parent::googleAction();
161
        $bonusEntry = false;
162
163
        if ($result->getVariable('success')) {
164
            $bonusEntry = $this->getGameService()->addAnotherChance($this->game, $this->user, 1);
165
        }
166
167
        $response = $this->getResponse();
168
        $response->setContent(\Zend\Json\Json::encode(array(
169
            'success' => $result,
170
            'playBonus' => $bonusEntry
171
        )));
172
173
        return $response;
174
    }
175
176
    public function getGameService()
177
    {