| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 2 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 45 | { |
||
| 46 | 2 | $email = $input->getArgument('email'); |
|
| 47 | 2 | $pass = $input->getArgument('newPassword'); |
|
| 48 | 2 | $criteria = new UserCriteria(); |
|
| 49 | 2 | $criteria->setEmail($email); |
|
| 50 | 2 | $user = $this->userService->findOneByCriteria($criteria); |
|
| 51 | 2 | if ($user === null) { |
|
| 52 | 1 | $output->writeln('No User Found.'); |
|
| 53 | } else { |
||
| 54 | 1 | $this->userService->changePassword($user, $pass); |
|
| 55 | 1 | $this->userService->saveUser($user); |
|
| 56 | 1 | $output->writeln('Password changed for '.$email); |
|
| 57 | } |
||
| 58 | 2 | } |
|
| 59 | } |
||
| 60 |