Code Duplication    Length = 7-7 lines in 2 locations

src/Lodash/Commands/UserAdd.php 1 location

@@ 59-65 (lines=7) @@
56
57
        $email = $this->argument('email');
58
        $password = $this->argument('password');
59
        if (! $password) {
60
            if ($this->confirm('Let system generate password?', true)) {
61
                $password = str_random(16);
62
            } else {
63
                $password = $this->secret('Please enter new password');
64
            }
65
        }
66
        $crypted_password = bcrypt($password);
67
        $user->create([
68
            'email'    => $email,

src/Lodash/Commands/UserPassword.php 1 location

@@ 66-72 (lines=7) @@
63
        }
64
65
        $password = $this->argument('password');
66
        if (! $password) {
67
            if ($this->confirm('Let system generate password?', true)) {
68
                $password = str_random(16);
69
            } else {
70
                $password = $this->secret('Please enter new password');
71
            }
72
        }
73
        $crypted_password = bcrypt($password);
74
        $user->update([
75
            'password' => $crypted_password,