Code Duplication    Length = 16-16 lines in 2 locations

src/Commands/UserCommands/SurveyCommand.php 2 locations

@@ 174-189 (lines=16) @@
171
172
            // no break
173
            case 4:
174
                if ($message->getLocation() === null) {
175
                    $notes['state'] = 4;
176
                    $this->conversation->update();
177
178
                    $data['reply_markup'] = (new Keyboard(
179
                        (new KeyboardButton('Share Location'))->setRequestLocation(true)
180
                    ))
181
                        ->setOneTimeKeyboard(true)
182
                        ->setResizeKeyboard(true)
183
                        ->setSelective(true);
184
185
                    $data['text'] = 'Share your location:';
186
187
                    $result = Request::sendMessage($data);
188
                    break;
189
                }
190
191
                $notes['longitude'] = $message->getLocation()->getLongitude();
192
                $notes['latitude']  = $message->getLocation()->getLatitude();
@@ 212-227 (lines=16) @@
209
210
            // no break
211
            case 6:
212
                if ($message->getContact() === null) {
213
                    $notes['state'] = 6;
214
                    $this->conversation->update();
215
216
                    $data['reply_markup'] = (new Keyboard(
217
                        (new KeyboardButton('Share Contact'))->setRequestContact(true)
218
                    ))
219
                        ->setOneTimeKeyboard(true)
220
                        ->setResizeKeyboard(true)
221
                        ->setSelective(true);
222
223
                    $data['text'] = 'Share your contact information:';
224
225
                    $result = Request::sendMessage($data);
226
                    break;
227
                }
228
229
                $notes['phone_number'] = $message->getContact()->getPhoneNumber();
230