Code Duplication    Length = 7-7 lines in 2 locations

src/Lodash/Commands/UserAdd.php 1 location

@@ 52-58 (lines=7) @@
49
50
        $email = $this->argument('email');
51
        $password = $this->argument('password');
52
        if (! $password) {
53
            if ($this->confirm('Let system generate password?', true)) {
54
                $password = str_random(16);
55
            } else {
56
                $password = $this->secret('Please enter new password');
57
            }
58
        }
59
        $cryptedPassword = bcrypt($password);
60
        $user->create([
61
            'email'    => $email,

src/Lodash/Commands/UserPassword.php 1 location

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