| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function postChangePassword($request,$response) |
||
| 18 | { |
||
| 19 | $validation = $this->validator->validate($request,[ |
||
| 20 | 'password_old' => v::noWhitespace()->notEmpty()->matchesPassword($this->auth->user()->password), |
||
| 21 | 'password' => v::noWhitespace()->notEmpty(), |
||
| 22 | ]); |
||
| 23 | |||
| 24 | if ($validation->failed()) { |
||
| 25 | return $response->withRedirect($this->router->pathFor('auth.password.change')); |
||
| 26 | } |
||
| 27 | |||
| 28 | $this->auth->user()->setPassword($request->getParam('password')); |
||
| 29 | |||
| 30 | $this->flash->addMessage('info','Your password was changed'); |
||
| 31 | |||
| 32 | return $response->withRedirect($this->router->pathFor('home')); |
||
| 33 | |||
| 34 | } |
||
| 35 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.