Skip to content
Snippets Groups Projects
Commit 9e1838cd authored by Camille Simiand's avatar Camille Simiand
Browse files

Fix phpstan errors level 2

parent 5b086ff6
No related branches found
No related tags found
1 merge request!27tuleap-108-add-stricter-code-quality-tools-configuration
Pipeline #660 failed
......@@ -69,7 +69,8 @@
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^5.3",
"symfony/stopwatch": "5.3.*",
"symfony/web-profiler-bundle": "5.3.*"
"symfony/web-profiler-bundle": "5.3.*",
"ext-imap": "*"
},
"config": {
"optimize-autoloader": true,
......
......@@ -2,19 +2,19 @@
namespace App\Security;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface;
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface;
class EmailVerifier
{
private $verifyEmailHelper;
private $mailer;
private $entityManager;
private VerifyEmailHelperInterface $verifyEmailHelper;
private MailerInterface $mailer;
private EntityManagerInterface $entityManager;
public function __construct(
VerifyEmailHelperInterface $helper,
......@@ -28,7 +28,7 @@ class EmailVerifier
public function sendEmailConfirmation(
string $verifyEmailRouteName,
UserInterface $user,
User $user,
TemplatedEmail $email
): void {
$signatureComponents = $this->verifyEmailHelper->generateSignature(
......@@ -53,7 +53,7 @@ class EmailVerifier
*/
public function handleEmailConfirmation(
Request $request,
UserInterface $user
User $user
): void {
$this->verifyEmailHelper->validateEmailConfirmation($request->getUri(), $user->getId(), $user->getEmail());
......
......@@ -7,6 +7,7 @@ use App\Repository\UserRepository;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\RawMessage;
class RegistrationControllerTest extends WebTestCase
......@@ -170,6 +171,7 @@ class RegistrationControllerTest extends WebTestCase
private function clickOnEmailMessageLink(RawMessage $emailMessage, KernelBrowser $client): void
{
/** @phpstan-ignore-next-line */
$crawler = new Crawler($emailMessage->getHtmlBody());
$crawlerLink = $crawler->selectLink('Confirm my Email')->link();
$client->click($crawlerLink);
......
......@@ -111,6 +111,7 @@ class ResetPasswordControllerTest extends WebTestCase
{
$emailMessage = $this->getEmailMessageWithResetPasswordLinkForVerifiedUser();
/** @phpstan-ignore-next-line */
$crawler = new Crawler($emailMessage->getHtmlBody());
$crawlerLink = $crawler->selectLink('Reset my password')->link();
$this->client->click($crawlerLink);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment