| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 54 | public function handle() |
||
| 55 | { |
||
| 56 | $userLogin = $this->argument('login'); |
||
| 57 | $userPassword = $this->argument('password'); |
||
| 58 | |||
| 59 | try { |
||
| 60 | $user = User::where(['login' => $userLogin])->firstOrFail(); |
||
| 61 | } catch (ModelNotFoundException $e) { |
||
| 62 | $this->error("User not found"); |
||
| 63 | return 1; |
||
| 64 | } |
||
| 65 | |||
| 66 | $user->password = $userPassword; |
||
| 67 | $user->save(); |
||
| 68 | |||
| 69 | $this->info("Password changed"); |
||
| 70 | } |
||
| 72 |