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