Code Duplication    Length = 10-10 lines in 2 locations

src/Commands/AdminCommands/SendtochannelCommand.php 2 locations

@@ 158-167 (lines=10) @@
155
            // no break
156
            case 1:
157
                insert:
158
                if (($type === 'message' && $text === '') || $notes['last_message_id'] === $message->getMessageId()) {
159
                    $notes['state'] = 1;
160
                    $this->conversation->update();
161
162
                    $result = $this->replyToChat(
163
                        'Insert the content you want to share: text, photo, audio...',
164
                        ['reply_markup' => Keyboard::remove(['selective' => true])]
165
                    );
166
                    break;
167
                }
168
                $notes['last_message_id'] = $message->getMessageId();
169
                $notes['message']         = $message->getRawData();
170
                $notes['message_type']    = $type;
@@ 199-208 (lines=10) @@
196
                $notes['last_message_id'] = $message->getMessageId();
197
            // no break
198
            case 3:
199
                if ($notes['set_caption'] && ($notes['last_message_id'] === $message->getMessageId() || $type !== 'message')) {
200
                    $notes['state'] = 3;
201
                    $this->conversation->update();
202
203
                    $result = $this->replyToChat(
204
                        'Insert caption:',
205
                        ['reply_markup' => Keyboard::remove(['selective' => true])]
206
                    );
207
                    break;
208
                }
209
                $notes['last_message_id'] = $message->getMessageId();
210
                if (isset($notes['caption'])) {
211
                    // If caption has already been send with the file, no need to ask for it.