| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function handle() |
||
| 42 | { |
||
| 43 | $userLogin = $this->argument('login'); |
||
| 44 | $userPassword = $this->argument('password'); |
||
| 45 | |||
| 46 | try { |
||
| 47 | $user = User::where(['login' => $userLogin])->firstOrFail(); |
||
| 48 | } catch (ModelNotFoundException $e) { |
||
| 49 | $this->error('User not found'); |
||
| 50 | return 1; |
||
| 51 | } |
||
| 52 | |||
| 53 | $user->password = $userPassword; |
||
| 54 | $user->save(); |
||
| 55 | |||
| 56 | $this->info('Password changed'); |
||
| 57 | } |
||
| 72 |