Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class NewUsernameHandler implements FormHandlerInterface, ContextProviderInterface |
||
12 | { |
||
13 | private $entityManager; |
||
14 | private $tokenGenerator; |
||
15 | |||
16 | public function __construct( |
||
17 | EntityManagerInterface $entityManager, |
||
18 | TokenGenerator $tokenGenerator |
||
19 | ) { |
||
20 | $this->entityManager = $entityManager; |
||
21 | $this->tokenGenerator = $tokenGenerator; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @param Form $form |
||
26 | * @param User $data |
||
27 | * @param Request $request |
||
28 | * @return User |
||
29 | */ |
||
30 | public function success(Form $form, $data, Request $request): User |
||
31 | { |
||
32 | // send an email to the new email address with the confirmation token to validate the new email |
||
33 | $data->setUsernameConfirmationToken($this->tokenGenerator->generateToken()); |
||
34 | $this->entityManager->persist($data); |
||
35 | $this->entityManager->flush(); |
||
36 | return $data; |
||
37 | } |
||
38 | |||
39 | public function getContext(): ?array |
||
42 | } |
||
43 | } |
||
44 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths