Code Duplication    Length = 10-10 lines in 2 locations

src/Commands/AdminCommands/SendtochannelCommand.php 1 location

@@ 95-104 (lines=10) @@
92
        switch ($state) {
93
            case -1:
94
                // getConfig has not been configured asking for channel to administer
95
                if ($type !== 'message' || $text === '') {
96
                    $notes['state'] = -1;
97
                    $this->conversation->update();
98
99
                    $data['text']         = 'Insert the channel name: (@yourchannel)';
100
                    $data['reply_markup'] = Keyboard::remove(['selective' => true]);
101
                    $result               = Request::sendMessage($data);
102
103
                    break;
104
                }
105
                $notes['channel']         = $text;
106
                $notes['last_message_id'] = $message->getMessageId();
107
                // Jump to state 1

src/Commands/UserCommands/SurveyCommand.php 1 location

@@ 103-112 (lines=10) @@
100
        //Every time a step is achieved the track is updated
101
        switch ($state) {
102
            case 0:
103
                if ($text === '') {
104
                    $notes['state'] = 0;
105
                    $this->conversation->update();
106
107
                    $data['text']         = 'Type your name:';
108
                    $data['reply_markup'] = Keyboard::remove(['selective' => true]);
109
110
                    $result = Request::sendMessage($data);
111
                    break;
112
                }
113
114
                $notes['name'] = $text;
115
                $text          = '';