Code Duplication    Length = 17-17 lines in 4 locations

src/Controller/Frontend/LotteryController.php 4 locations

@@ 123-139 (lines=17) @@
120
        return $viewModel;
121
    }
122
123
    public function fbshareAction()
124
    {
125
        $result = parent::fbshareAction();
126
        $bonusEntry = false;
127
128
        if ($result->getVariable('success')) {
129
            $bonusEntry = $this->getGameService()->addAnotherChance($this->game, $this->user, 1);
130
        }
131
132
        $response = $this->getResponse();
133
        $response->setContent(\Zend\Json\Json::encode(array(
134
            'success' => $result,
135
            'playBonus' => $bonusEntry
136
         )));
137
138
        return $response;
139
    }
140
141
    public function fbrequestAction()
142
    {
@@ 141-157 (lines=17) @@
138
        return $response;
139
    }
140
141
    public function fbrequestAction()
142
    {
143
        $result = parent::fbrequestAction();
144
        $bonusEntry = false;
145
146
        if ($result->getVariable('success')) {
147
            $bonusEntry = $this->getGameService()->addAnotherChance($this->game, $this->user, 1);
148
        }
149
150
        $response = $this->getResponse();
151
        $response->setContent(\Zend\Json\Json::encode(array(
152
            'success' => $result,
153
            'playBonus' => $bonusEntry
154
        )));
155
156
        return $response;
157
    }
158
159
    public function tweetAction()
160
    {
@@ 159-175 (lines=17) @@
156
        return $response;
157
    }
158
159
    public function tweetAction()
160
    {
161
        $result = parent::tweetAction();
162
        $bonusEntry = false;
163
164
        if ($result->getVariable('success')) {
165
            $bonusEntry = $this->getGameService()->addAnotherChance($this->game, $this->user, 1);
166
        }
167
168
        $response = $this->getResponse();
169
        $response->setContent(\Zend\Json\Json::encode(array(
170
            'success' => $result,
171
            'playBonus' => $bonusEntry
172
        )));
173
174
        return $response;
175
    }
176
177
    public function googleAction()
178
    {
@@ 177-193 (lines=17) @@
174
        return $response;
175
    }
176
177
    public function googleAction()
178
    {
179
        $result = parent::googleAction();
180
        $bonusEntry = false;
181
182
        if ($result->getVariable('success')) {
183
            $bonusEntry = $this->getGameService()->addAnotherChance($this->game, $this->user, 1);
184
        }
185
186
        $response = $this->getResponse();
187
        $response->setContent(\Zend\Json\Json::encode(array(
188
            'success' => $result,
189
            'playBonus' => $bonusEntry
190
        )));
191
192
        return $response;
193
    }
194
195
    public function getGameService()
196
    {