Code Duplication    Length = 9-9 lines in 2 locations

src/Mocky/Auth/AuthenticationWorkflow.php 2 locations

@@ 98-106 (lines=9) @@
95
        @list($username, $password) = $this->captureUserAndPassword($command->input);
96
97
        if ($username && $password && $workflow->can($subject, 'enter_username_n_password')) {
98
            if ($username === 'demo' && $password === 'demo') {
99
                $workflow->apply($subject, 'enter_username_n_password');
100
101
                $command->storage->setLineLastLogin(new \DateTimeImmutable());
102
                $command->active = false;
103
                $command->message->text = 'Success!';
104
            } else {
105
                $command->message->text = 'Try again ...';
106
            }
107
108
            return true;
109
        }
@@ 150-158 (lines=9) @@
147
        $password = $this->captureUserAndPassword($command->input)[0];
148
149
        if ($password && $workflow->can($subject, 'enter_password')) {
150
            if ($password === 'demo') {
151
                $workflow->apply($subject, 'enter_password');
152
153
                $command->storage->setLineLastLogin(new \DateTimeImmutable());
154
                $command->active = false;
155
                $command->message->text = 'Success!';
156
            } else {
157
                $command->message->text = 'Password not match, Try again ...';
158
            }
159
160
            return true;
161
        }