Refactor request password action #2231
Annotations
10 warnings
src/Action/LoginAction.php#L65
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function __invoke(Request $request) : Response
{
$event = new GetResponseLoginEvent($request);
- $this->eventDispatcher->dispatch($event, NucleosUserEvents::SECURITY_LOGIN_INITIALIZE);
+
if (null !== $event->getResponse()) {
return $event->getResponse();
}
|
src/Action/LoginAction.php#L72
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if (null !== $event->getResponse()) {
return $event->getResponse();
}
- $form = $this->formFactory->create(LoginFormType::class, null, ['action' => $this->router->generate('nucleos_user_security_check'), 'method' => 'POST'])->add('save', SubmitType::class, ['label' => 'security.login.submit']);
+ $form = $this->formFactory->create(LoginFormType::class, null, ['method' => 'POST'])->add('save', SubmitType::class, ['label' => 'security.login.submit']);
return new Response($this->twig->render('@NucleosUser/Security/login.html.twig', ['form' => $form->createView(), 'last_username' => $this->authenticationUtils->getLastUsername(), 'error' => $this->authenticationUtils->getLastAuthenticationError(), 'csrf_token' => $this->csrfTokenManager->getToken('authenticate')]));
}
}
|
src/Action/LoginAction.php#L76
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if (null !== $event->getResponse()) {
return $event->getResponse();
}
- $form = $this->formFactory->create(LoginFormType::class, null, ['action' => $this->router->generate('nucleos_user_security_check'), 'method' => 'POST'])->add('save', SubmitType::class, ['label' => 'security.login.submit']);
+ $form = $this->formFactory->create(LoginFormType::class, null, ['action' => $this->router->generate('nucleos_user_security_check'), 'method' => 'POST'])->add('save', SubmitType::class, []);
return new Response($this->twig->render('@NucleosUser/Security/login.html.twig', ['form' => $form->createView(), 'last_username' => $this->authenticationUtils->getLastUsername(), 'error' => $this->authenticationUtils->getLastAuthenticationError(), 'csrf_token' => $this->csrfTokenManager->getToken('authenticate')]));
}
}
|
src/Action/LoginAction.php#L83
Escaped Mutant for Mutator "ArrayItem":
--- Original
+++ New
@@ @@
return $event->getResponse();
}
$form = $this->formFactory->create(LoginFormType::class, null, ['action' => $this->router->generate('nucleos_user_security_check'), 'method' => 'POST'])->add('save', SubmitType::class, ['label' => 'security.login.submit']);
- return new Response($this->twig->render('@NucleosUser/Security/login.html.twig', ['form' => $form->createView(), 'last_username' => $this->authenticationUtils->getLastUsername(), 'error' => $this->authenticationUtils->getLastAuthenticationError(), 'csrf_token' => $this->csrfTokenManager->getToken('authenticate')]));
+ return new Response($this->twig->render('@NucleosUser/Security/login.html.twig', ['form' => $form->createView(), 'last_username' > $this->authenticationUtils->getLastUsername(), 'error' => $this->authenticationUtils->getLastAuthenticationError(), 'csrf_token' => $this->csrfTokenManager->getToken('authenticate')]));
}
}
|
src/Action/LoginAction.php#L84
Escaped Mutant for Mutator "ArrayItem":
--- Original
+++ New
@@ @@
return $event->getResponse();
}
$form = $this->formFactory->create(LoginFormType::class, null, ['action' => $this->router->generate('nucleos_user_security_check'), 'method' => 'POST'])->add('save', SubmitType::class, ['label' => 'security.login.submit']);
- return new Response($this->twig->render('@NucleosUser/Security/login.html.twig', ['form' => $form->createView(), 'last_username' => $this->authenticationUtils->getLastUsername(), 'error' => $this->authenticationUtils->getLastAuthenticationError(), 'csrf_token' => $this->csrfTokenManager->getToken('authenticate')]));
+ return new Response($this->twig->render('@NucleosUser/Security/login.html.twig', ['form' => $form->createView(), 'last_username' => $this->authenticationUtils->getLastUsername(), 'error' > $this->authenticationUtils->getLastAuthenticationError(), 'csrf_token' => $this->csrfTokenManager->getToken('authenticate')]));
}
}
|
src/Action/LoginAction.php#L85
Escaped Mutant for Mutator "ArrayItem":
--- Original
+++ New
@@ @@
return $event->getResponse();
}
$form = $this->formFactory->create(LoginFormType::class, null, ['action' => $this->router->generate('nucleos_user_security_check'), 'method' => 'POST'])->add('save', SubmitType::class, ['label' => 'security.login.submit']);
- return new Response($this->twig->render('@NucleosUser/Security/login.html.twig', ['form' => $form->createView(), 'last_username' => $this->authenticationUtils->getLastUsername(), 'error' => $this->authenticationUtils->getLastAuthenticationError(), 'csrf_token' => $this->csrfTokenManager->getToken('authenticate')]));
+ return new Response($this->twig->render('@NucleosUser/Security/login.html.twig', ['form' => $form->createView(), 'last_username' => $this->authenticationUtils->getLastUsername(), 'error' => $this->authenticationUtils->getLastAuthenticationError(), 'csrf_token' > $this->csrfTokenManager->getToken('authenticate')]));
}
}
|
src/Action/RequestResetAction.php#L85
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if (null !== $response) {
return $response;
}
- $form = $this->formFactory->create(RequestPasswordFormType::class, null, ['action' => $this->router->generate('nucleos_user_resetting_request'), 'method' => 'POST'])->add('save', SubmitType::class, ['label' => 'resetting.request.submit']);
+ $form = $this->formFactory->create(RequestPasswordFormType::class, null, ['method' => 'POST'])->add('save', SubmitType::class, ['label' => 'resetting.request.submit']);
return new Response($this->twig->render('@NucleosUser/Resetting/request.html.twig', ['form' => $form->createView()]));
}
/**
|
src/Action/RequestResetAction.php#L89
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if (null !== $response) {
return $response;
}
- $form = $this->formFactory->create(RequestPasswordFormType::class, null, ['action' => $this->router->generate('nucleos_user_resetting_request'), 'method' => 'POST'])->add('save', SubmitType::class, ['label' => 'resetting.request.submit']);
+ $form = $this->formFactory->create(RequestPasswordFormType::class, null, ['action' => $this->router->generate('nucleos_user_resetting_request'), 'method' => 'POST'])->add('save', SubmitType::class, []);
return new Response($this->twig->render('@NucleosUser/Resetting/request.html.twig', ['form' => $form->createView()]));
}
/**
|
src/Action/RequestResetAction.php#L104
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
*/
private function process(Request $request) : ?Response
{
- $username = (string) $request->request->get('username', '');
+ $username = $request->request->get('username', '');
$user = null;
try {
$user = '' === $username ? null : $this->userProvider->loadUserByIdentifier($username);
|
src/Action/RequestResetAction.php#L113
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
$user = '' === $username ? null : $this->userProvider->loadUserByIdentifier($username);
} catch (UserNotFoundException) {
}
- if (!$user instanceof UserInterface) {
+ if (!false) {
return null;
}
$event = new GetResponseNullableUserEvent($user, $request);
|
The logs for this run have expired and are no longer available.
Loading